config

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// the address of the coordinator
	CfgCoordinatorAddress = "coordinator.address"
	// the security level used in coordinator signatures
	CfgCoordinatorSecurityLevel = "coordinator.securityLevel"
	// the depth of the Merkle tree which in turn determines the number of leaves (private keys) that the coordinator can use to sign a message.
	CfgCoordinatorMerkleTreeDepth = "coordinator.merkleTreeDepth"
	// the minimum weight magnitude is the number of trailing 0s that must appear in the end of a transaction hash.
	// increasing this number by 1 will result in proof of work that is 3 times as hard.
	CfgCoordinatorMWM = "coordinator.mwm"
	// the path to the state file of the coordinator
	CfgCoordinatorStateFilePath = "coordinator.stateFilePath"
	// the path to the Merkle tree of the coordinator
	CfgCoordinatorMerkleTreeFilePath = "coordinator.merkleTreeFilePath"
	// the interval milestones are issued
	CfgCoordinatorIntervalSeconds = "coordinator.intervalSeconds"
	// the hash function the coordinator will use to calculate milestone merkle tree hash (see RFC-0012)
	CfgCoordinatorMilestoneMerkleTreeHashFunc = "coordinator.milestoneMerkleTreeHashFunc"
	// the maximum amount of known bundle tails for milestone tipselection
	// if this limit is exceeded, a new checkpoint is issued
	CfgCoordinatorCheckpointsMaxTrackedTails = "coordinator.checkpoints.maxTrackedTransactions"
	// the minimum threshold of unconfirmed transactions in the heaviest branch for milestone tipselection
	// if the value falls below that threshold, no more heaviest branch tips are picked
	CfgCoordinatorTipselectMinHeaviestBranchUnconfirmedTransactionsThreshold = "coordinator.tipsel.minHeaviestBranchUnconfirmedTransactionsThreshold"
	// the maximum amount of checkpoint transactions with heaviest branch tips that are picked
	// if the heaviest branch is not below "UnconfirmedTransactionsThreshold" before
	CfgCoordinatorTipselectMaxHeaviestBranchTipsPerCheckpoint = "coordinator.tipsel.maxHeaviestBranchTipsPerCheckpoint"
	// the amount of checkpoint transactions with random tips that are picked if a checkpoint is issued and at least
	// one heaviest branch tip was found, otherwise no random tips will be picked
	CfgCoordinatorTipselectRandomTipsPerCheckpoint = "coordinator.tipsel.randomTipsPerCheckpoint"
	// the maximum duration to select the heaviest branch tips in milliseconds
	CfgCoordinatorTipselectHeaviestBranchSelectionDeadlineMilliseconds = "coordinator.tipsel.heaviestBranchSelectionDeadlineMilliseconds"
)
View Source
const (
	// the bind address on which the dashboard can be access from
	CfgDashboardBindAddress = "dashboard.bindAddress"
	// whether to run the dashboard in dev mode
	CfgDashboardDevMode = "dashboard.dev"
	// the theme for the dashboard to use (default or dark)
	CfgDashboardTheme = "dashboard.theme"
	// whether to use HTTP basic auth
	CfgDashboardBasicAuthEnabled = "dashboard.basicAuth.enabled"
	// the HTTP basic auth username
	CfgDashboardBasicAuthUsername = "dashboard.basicAuth.username"
	// the HTTP basic auth password+salt as a sha256 hash
	CfgDashboardBasicAuthPasswordHash = "dashboard.basicauth.passwordhash" // config key must be lower cased (for hiding passwords in PrintConfig)
	// the HTTP basic auth salt used for hashing the password
	CfgDashboardBasicAuthPasswordSalt = "dashboard.basicauth.passwordsalt" // config key must be lower cased (for hiding passwords in PrintConfig)
)
View Source
const (
	// Defines if IPv6 is preferred for peers added through the API
	CfgNetPreferIPv6 = "network.preferIPv6"
	// the bind address of the gossip TCP server
	CfgNetGossipBindAddress = "network.gossip.bindAddress"
	// the number of seconds to wait before trying to reconnect to a disconnected peer
	CfgNetGossipReconnectAttemptIntervalSeconds = "network.gossip.reconnectAttemptIntervalSeconds"

	// enable inbound connections from unknown peers
	CfgPeeringAcceptAnyConnection = "acceptAnyConnection"
	// set the maximum number of peers
	CfgPeeringMaxPeers = "maxPeers"
	// set the URLs and IP addresses of peers
	CfgPeers = "peers"

	// list of autopeering entry nodes to use
	CfgNetAutopeeringEntryNodes = "network.autopeering.entryNodes"
	// bind address for global services such as autopeering and gossip
	CfgNetAutopeeringBindAddr = "network.autopeering.bindAddress"
	// private key seed used to derive the node identity; optional Base64 encoded 256-bit string
	CfgNetAutopeeringSeed = "network.autopeering.seed"
	// whether the node should act as an autopeering entry node
	CfgNetAutopeeringRunAsEntryNode = "network.autopeering.runAsEntryNode"
	// the number of inbound autopeers
	CfgNetAutopeeringInboundPeers = "network.autopeering.inboundPeers"
	// the number of outbound autopeers
	CfgNetAutopeeringOutboundPeers = "network.autopeering.outboundPeers"
	// lifetime (in minutes) of the private and public local salt
	CfgNetAutopeeringSaltLifetime = "network.autopeering.saltLifetime"
	// maximum percentage of dropped packets in one minute before an autopeered neighbor gets dropped
	CfgNetAutopeeringMaxDroppedPacketsPercentage = "network.autopeering.maxDroppedPacketsPercentage"
)
View Source
const (
	// CfgNodeAlias set an alias to identify a node
	CfgNodeAlias = "node.alias"
	// CfgNodeShowAliasInGetNodeInfo defines whether to show the alias in getNodeInfo
	CfgNodeShowAliasInGetNodeInfo = "node.showAliasInGetNodeInfo"
)
View Source
const (
	// the bind address on which the Prometheus exporter listens on
	CfgPrometheusBindAddress = "prometheus.bindAddress"
	// include go metrics
	CfgPrometheusGoMetrics = "prometheus.goMetrics"
	// include process metrics
	CfgPrometheusProcessMetrics = "prometheus.processMetrics"
	// include promhttp metrics
	CfgPrometheusPromhttpMetrics = "prometheus.promhttpMetrics"
	// whether the plugin should write a Prometheus 'file SD' file
	CfgPrometheusFileServiceDiscoveryEnabled = "prometheus.fileServiceDiscovery.enabled"
	// the path where to write the 'file SD' file to
	CfgPrometheusFileServiceDiscoveryPath = "prometheus.fileServiceDiscovery.path"
	// the target to write into the 'file SD' file
	CfgPrometheusFileServiceDiscoveryTarget = "prometheus.fileServiceDiscovery.target"
)
View Source
const (
	// which snapshot type to load. 'local' or 'global'
	CfgSnapshotLoadType = "snapshots.loadType"
	// the depth, respectively the starting point, at which a local snapshot of the ledger is generated
	CfgLocalSnapshotsDepth = "snapshots.local.depth"
	// interval, in milestone transactions, at which snapshot files are created if the ledger is fully synchronized
	CfgLocalSnapshotsIntervalSynced = "snapshots.local.intervalSynced"
	// interval, in milestone transactions, at which snapshot files are created if the ledger is not fully synchronized
	CfgLocalSnapshotsIntervalUnsynced = "snapshots.local.intervalUnsynced"
	// path to the local snapshot file
	CfgLocalSnapshotsPath = "snapshots.local.path"
	// URL to load the local snapshot file from
	CfgLocalSnapshotsDownloadURLs = "snapshots.local.downloadURLs"
	// path to the global snapshot file containing the ledger state
	CfgGlobalSnapshotPath = "snapshots.global.path"
	// paths to the spent addresses files
	CfgGlobalSnapshotSpentAddressesPaths = "snapshots.global.spentAddressesPaths"
	// milestone index of the global snapshot
	CfgGlobalSnapshotIndex = "snapshots.global.index"
	// whether to delete old transaction data from the database
	CfgPruningEnabled = "snapshots.pruning.enabled"
	// amount of milestone transactions to keep in the database
	CfgPruningDelay = "snapshots.pruning.delay"
	// enable support for wereAddressesSpentFrom (needed for Trinity, but local snapshots are much bigger)
	CfgSpentAddressesEnabled = "spentAddresses.enabled"
)
View Source
const (
	// the target address of the spam
	CfgSpammerAddress = "spammer.address"
	// the message to embed within the spam transactions
	CfgSpammerMessage = "spammer.message"
	// the tag of the transaction
	CfgSpammerTag = "spammer.tag"
	// the tag of the transaction if the semi-lazy pool is used (uses "tag" if empty)
	CfgSpammerTagSemiLazy = "spammer.tagSemiLazy"
	// workers remains idle for a while when cpu usage gets over this limit (0 = disable)
	CfgSpammerCPUMaxUsage = "spammer.cpuMaxUsage"
	// the rate limit for the spammer (0 = no limit)
	CfgSpammerTPSRateLimit = "spammer.tpsRateLimit"
	// the size of the spam bundles
	CfgSpammerBundleSize = "spammer.bundleSize"
	// should be spammed with value bundles
	CfgSpammerValueSpam = "spammer.valueSpam"
	// the amount of parallel running spammers
	CfgSpammerWorkers = "spammer.workers"
	// CfgSpammerAutostart automatically starts the spammer on node startup
	CfgSpammerAutostart = "spammer.autostart"
)
View Source
const (
	// the path to the database folder
	CfgDatabasePath = "db.path"
	// ignore the check for corrupted databases (should only be used for debug reasons)
	CfgDatabaseDebug = "db.debug"
)
View Source
const (
	// CfgTipSelMaxDeltaTxYoungestRootSnapshotIndexToLSMI is the maximum allowed delta
	// value for the YTRSI of a given transaction in relation to the current LSMI before it gets lazy.
	CfgTipSelMaxDeltaTxYoungestRootSnapshotIndexToLSMI = "tipsel.maxDeltaTxYoungestRootSnapshotIndexToLSMI"
	// CfgTipSelMaxDeltaTxOldestRootSnapshotIndexToLSMI is the maximum allowed delta
	// value between OTRSI of a given transaction in relation to the current LSMI before it gets semi-lazy.
	CfgTipSelMaxDeltaTxOldestRootSnapshotIndexToLSMI = "tipsel.maxDeltaTxOldestRootSnapshotIndexToLSMI"
	// CfgTipSelBelowMaxDepth is the maximum allowed delta
	// value between OTRSI of a given transaction in relation to the current LSMI before it gets lazy.
	CfgTipSelBelowMaxDepth = "tipsel.belowMaxDepth"
	// the config group used for the non-lazy tip-pool
	CfgTipSelNonLazy = "tipsel.nonLazy."
	// the config group used for the semi-lazy tip-pool
	CfgTipSelSemiLazy = "tipsel.semiLazy."
	// CfgTipSelRetentionRulesTipsLimit is the maximum amount of current tips for which "CfgTipSelMaxReferencedTipAgeSeconds"
	// and "CfgTipSelMaxApprovers" are checked. if the amount of tips exceeds this limit,
	// referenced tips get removed directly to reduce the amount of tips in the network.
	CfgTipSelRetentionRulesTipsLimit = "retentionRulesTipsLimit"
	// CfgTipSelMaxReferencedTipAgeSeconds is the maximum time a tip remains in the tip pool
	// after it was referenced by the first transaction.
	CfgTipSelMaxReferencedTipAgeSeconds = "maxReferencedTipAgeSeconds"
	// CfgTipSelMaxApprovers is the maximum amount of references by other transactions
	// before the tip is removed from the tip pool.
	CfgTipSelMaxApprovers = "maxApprovers"
	// CfgTipSelSpammerTipsThreshold is the maximum amount of tips in a tip-pool before the spammer tries to reduce these (0 = disable (semi-lazy), 0 = always (non-lazy))
	// this is used to support the network if someone attacks the tangle by spamming a lot of tips
	CfgTipSelSpammerTipsThreshold = "spammerTipsThreshold"
)
View Source
const (
	// the bind address on which the HTTP API listens on
	CfgWebAPIBindAddress = "httpAPI.bindAddress"
	// the allowed HTTP API calls which can be called from non whitelisted addresses
	CfgWebAPIPermitRemoteAccess = "httpAPI.permitRemoteAccess"
	// the allowed HTTP REST routes which can be called from non whitelisted addresses
	CfgWebAPIPermittedRoutes = "httpAPI.permittedRoutes"
	// the whitelist of addresses which are allowed to access the HTTP API
	CfgWebAPIWhitelistedAddresses = "httpAPI.whitelistedAddresses"
	// whether to allow the health check route anyways
	CfgWebAPIExcludeHealthCheckFromAuth = "httpAPI.excludeHealthCheckFromAuth"
	// whether to use HTTP basic auth for the HTTP API
	CfgWebAPIBasicAuthEnabled = "httpAPI.basicAuth.enabled"
	// the username of the HTTP basic auth
	CfgWebAPIBasicAuthUsername = "httpAPI.basicAuth.username"
	// the HTTP basic auth password+salt as a sha256 hash
	CfgWebAPIBasicAuthPasswordHash = "httpapi.basicauth.passwordhash" // must be lower cased
	// the HTTP basic auth salt used for hashing the password
	CfgWebAPIBasicAuthPasswordSalt = "httpapi.basicauth.passwordsalt" // must be lower cased
	// the maximum number of characters that the body of an API call may contain
	CfgWebAPILimitsMaxBodyLengthBytes = "httpAPI.limits.bodyLengthBytes"
	// the maximum number of transactions that may be returned by the findTransactions endpoint
	CfgWebAPILimitsMaxFindTransactions = "httpAPI.limits.findTransactions"
	// the maximum number of trytes that may be returned by the getTrytes endpoint
	CfgWebAPILimitsMaxGetTrytes = "httpAPI.limits.getTrytes"
	// the maximum number of parameters in an API call
	CfgWebAPILimitsMaxRequestsList = "httpAPI.limits.requestsList"
)
View Source
const (
	// protocol used to connect to the zmq feed [unix, tcp, udp, inproc]
	CfgZMQBindAddress = "zmq.bindAddress"
	// the bind address of the ZMQ feed
	CfgZMQProtocol = "zmq.protocol"
)
View Source
const (
	// path to the MQTT broker config file
	CfgMQTTConfig = "mqtt.config"
)
View Source
const (
	// the bind address on which the profiler listens on
	CfgProfilingBindAddress = "profiling.bindAddress"
)
View Source
const (
	// the used advancement range per warpsync checkpoint
	CfgWarpSyncAdvancementRange = "warpsync.advancementRange"
)

Variables

View Source
var (

	// Viper
	NodeConfig     = viper.New()
	PeeringConfig  = viper.New()
	ProfilesConfig = viper.New()
)

Functions

func AcquirePeeringConfigHotReload

func AcquirePeeringConfigHotReload() bool

func AllowPeeringConfigHotReload

func AllowPeeringConfigHotReload()

func DenyPeeringConfigHotReload

func DenyPeeringConfigHotReload()

func FetchConfig

func FetchConfig() error

FetchConfig fetches config values from a dir defined via CLI flag --config-dir (or the current working dir if not set).

It automatically reads in a single config file starting with "config" (can be changed via the --config CLI flag) and ending with: .json, .toml, .yaml or .yml (in this sequence).

func HideConfigFlags

func HideConfigFlags()

HideConfigFlags hides all non essential flags from the help/usage text.

func LoadHashFromEnvironment

func LoadHashFromEnvironment(name string, length ...int) (trinary.Hash, error)

LoadHashFromEnvironment loads a hash from the given environment variable.

func PrintConfig

func PrintConfig(ignoreSettingsAtPrint ...[]string)

Types

type PeerConfig

type PeerConfig struct {
	ID         string `json:"identity" mapstructure:"identity"`
	Alias      string `json:"alias" mapstructure:"alias"`
	PreferIPv6 bool   `json:"preferIPv6" mapstructure:"preferIPv6"`
}

PeerConfig holds the initial information about peers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL