You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

529 lines
21 KiB

  1. ---
  2. order: 3
  3. ---
  4. # Configuration
  5. Tendermint Core can be configured via a TOML file in
  6. `$TMHOME/config/config.toml`. Some of these parameters can be overridden by
  7. command-line flags. For most users, the options in the `##### main base configuration options #####` are intended to be modified while config options
  8. further below are intended for advance power users.
  9. ## Options
  10. The default configuration file create by `tendermint init` has all
  11. the parameters set with their default values. It will look something
  12. like the file below, however, double check by inspecting the
  13. `config.toml` created with your version of `tendermint` installed:
  14. ```toml
  15. # This is a TOML config file.
  16. # For more information, see https://github.com/toml-lang/toml
  17. # NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or
  18. # relative to the home directory (e.g. "data"). The home directory is
  19. # "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable
  20. # or --home cmd flag.
  21. #######################################################################
  22. ### Main Base Config Options ###
  23. #######################################################################
  24. # TCP or UNIX socket address of the ABCI application,
  25. # or the name of an ABCI application compiled in with the Tendermint binary
  26. proxy-app = "tcp://127.0.0.1:26658"
  27. # A custom human readable name for this node
  28. moniker = "anonymous"
  29. # Mode of Node: full | validator | seed (default: "validator")
  30. # * validator node (default)
  31. # - all reactors
  32. # - with priv_validator_key.json, priv_validator_state.json
  33. # * full node
  34. # - all reactors
  35. # - No priv_validator_key.json, priv_validator_state.json
  36. # * seed node
  37. # - only P2P, PEX Reactor
  38. # - No priv_validator_key.json, priv_validator_state.json
  39. mode = "validator"
  40. # Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb
  41. # * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
  42. # - pure go
  43. # - stable
  44. # * cleveldb (uses levigo wrapper)
  45. # - fast
  46. # - requires gcc
  47. # - use cleveldb build tag (go build -tags cleveldb)
  48. # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
  49. # - EXPERIMENTAL
  50. # - may be faster is some use-cases (random reads - indexer)
  51. # - use boltdb build tag (go build -tags boltdb)
  52. # * rocksdb (uses github.com/tecbot/gorocksdb)
  53. # - EXPERIMENTAL
  54. # - requires gcc
  55. # - use rocksdb build tag (go build -tags rocksdb)
  56. # * badgerdb (uses github.com/dgraph-io/badger)
  57. # - EXPERIMENTAL
  58. # - use badgerdb build tag (go build -tags badgerdb)
  59. db-backend = "goleveldb"
  60. # Database directory
  61. db-dir = "data"
  62. # Output level for logging, including package level options
  63. log-level = "info"
  64. # Output format: 'plain' (colored text) or 'json'
  65. log-format = "plain"
  66. ##### additional base config options #####
  67. # Path to the JSON file containing the initial validator set and other meta data
  68. genesis-file = "config/genesis.json"
  69. # Path to the JSON file containing the private key to use as a validator in the consensus protocol
  70. priv-validator-key-file = "config/priv_validator_key.json"
  71. # Path to the JSON file containing the last sign state of a validator
  72. priv-validator-state-file = "data/priv_validator_state.json"
  73. # TCP or UNIX socket address for Tendermint to listen on for
  74. # connections from an external PrivValidator process
  75. priv-validator-laddr = ""
  76. # Path to the JSON file containing the private key to use for node authentication in the p2p protocol
  77. node-key-file = "config/node_key.json"
  78. # Mechanism to connect to the ABCI application: socket | grpc
  79. abci = "socket"
  80. # If true, query the ABCI app on connecting to a new peer
  81. # so the app can decide if we should keep the connection or not
  82. filter-peers = false
  83. #######################################################################
  84. ### Advanced Configuration Options ###
  85. #######################################################################
  86. #######################################################
  87. ### RPC Server Configuration Options ###
  88. #######################################################
  89. [rpc]
  90. # TCP or UNIX socket address for the RPC server to listen on
  91. laddr = "tcp://127.0.0.1:26657"
  92. # A list of origins a cross-domain request can be executed from
  93. # Default value '[]' disables cors support
  94. # Use '["*"]' to allow any origin
  95. cors-allowed-origins = []
  96. # A list of methods the client is allowed to use with cross-domain requests
  97. cors-allowed-methods = ["HEAD", "GET", "POST", ]
  98. # A list of non simple headers the client is allowed to use with cross-domain requests
  99. cors-allowed-headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ]
  100. # TCP or UNIX socket address for the gRPC server to listen on
  101. # NOTE: This server only supports /broadcast_tx_commit
  102. grpc-laddr = ""
  103. # Maximum number of simultaneous connections.
  104. # Does not include RPC (HTTP&WebSocket) connections. See max-open-connections
  105. # If you want to accept a larger number than the default, make sure
  106. # you increase your OS limits.
  107. # 0 - unlimited.
  108. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  109. # 1024 - 40 - 10 - 50 = 924 = ~900
  110. grpc-max-open-connections = 900
  111. # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
  112. unsafe = false
  113. # Maximum number of simultaneous connections (including WebSocket).
  114. # Does not include gRPC connections. See grpc-max-open-connections
  115. # If you want to accept a larger number than the default, make sure
  116. # you increase your OS limits.
  117. # 0 - unlimited.
  118. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  119. # 1024 - 40 - 10 - 50 = 924 = ~900
  120. max-open-connections = 900
  121. # Maximum number of unique clientIDs that can /subscribe
  122. # If you're using /broadcast_tx_commit, set to the estimated maximum number
  123. # of broadcast_tx_commit calls per block.
  124. max-subscription-clients = 100
  125. # Maximum number of unique queries a given client can /subscribe to
  126. # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
  127. # the estimated # maximum number of broadcast_tx_commit calls per block.
  128. max-subscriptions-per-client = 5
  129. # How long to wait for a tx to be committed during /broadcast_tx_commit.
  130. # WARNING: Using a value larger than 10s will result in increasing the
  131. # global HTTP write timeout, which applies to all connections and endpoints.
  132. # See https://github.com/tendermint/tendermint/issues/3435
  133. timeout-broadcast-tx-commit = "10s"
  134. # Maximum size of request body, in bytes
  135. max-body-bytes = 1000000
  136. # Maximum size of request header, in bytes
  137. max-header-bytes = 1048576
  138. # The path to a file containing certificate that is used to create the HTTPS server.
  139. # Might be either absolute path or path related to Tendermint's config directory.
  140. # If the certificate is signed by a certificate authority,
  141. # the certFile should be the concatenation of the server's certificate, any intermediates,
  142. # and the CA's certificate.
  143. # NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server.
  144. # Otherwise, HTTP server is run.
  145. tls-cert-file = ""
  146. # The path to a file containing matching private key that is used to create the HTTPS server.
  147. # Might be either absolute path or path related to Tendermint's config directory.
  148. # NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server.
  149. # Otherwise, HTTP server is run.
  150. tls-key-file = ""
  151. # pprof listen address (https://golang.org/pkg/net/http/pprof)
  152. pprof-laddr = ""
  153. #######################################################
  154. ### P2P Configuration Options ###
  155. #######################################################
  156. [p2p]
  157. # Address to listen for incoming connections
  158. laddr = "tcp://0.0.0.0:26656"
  159. # Address to advertise to peers for them to dial
  160. # If empty, will use the same port as the laddr,
  161. # and will introspect on the listener or use UPnP
  162. # to figure out the address.
  163. external-address = ""
  164. # Comma separated list of seed nodes to connect to
  165. seeds = ""
  166. # Comma separated list of nodes to keep persistent connections to
  167. persistent-peers = ""
  168. # UPNP port forwarding
  169. upnp = false
  170. # Path to address book
  171. addr-book-file = "config/addrbook.json"
  172. # Set true for strict address routability rules
  173. # Set false for private or local networks
  174. addr-book-strict = true
  175. # Maximum number of inbound peers
  176. max-num-inbound-peers = 40
  177. # Maximum number of outbound peers to connect to, excluding persistent peers
  178. max-num-outbound-peers = 10
  179. # Maximum number of connections (inbound and outbound).
  180. max-connections = 64
  181. # Rate limits the number of incoming connection attempts per IP address.
  182. max-incoming-connection-attempts = 100
  183. # List of node IDs, to which a connection will be (re)established ignoring any existing limits
  184. unconditional-peer-ids = ""
  185. # Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)
  186. persistent-peers-max-dial-period = "0s"
  187. # Time to wait before flushing messages out on the connection
  188. flush-throttle-timeout = "100ms"
  189. # Maximum size of a message packet payload, in bytes
  190. max-packet-msg-payload-size = 1024
  191. # Rate at which packets can be sent, in bytes/second
  192. send-rate = 5120000
  193. # Rate at which packets can be received, in bytes/second
  194. recv-rate = 5120000
  195. # Set true to enable the peer-exchange reactor
  196. pex = true
  197. # Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
  198. private-peer-ids = ""
  199. # Toggle to disable guard against peers connecting from the same ip.
  200. allow-duplicate-ip = false
  201. # Peer connection configuration.
  202. handshake-timeout = "20s"
  203. dial-timeout = "3s"
  204. #######################################################
  205. ### Mempool Configuration Option ###
  206. #######################################################
  207. [mempool]
  208. # Mempool version to use:
  209. # 1) "v0" - The legacy non-prioritized mempool reactor.
  210. # 2) "v1" (default) - The prioritized mempool reactor.
  211. version = "v1"
  212. recheck = true
  213. broadcast = true
  214. # Maximum number of transactions in the mempool
  215. size = 5000
  216. # Limit the total size of all txs in the mempool.
  217. # This only accounts for raw transactions (e.g. given 1MB transactions and
  218. # max-txs-bytes=5MB, mempool will only accept 5 transactions).
  219. max-txs-bytes = 1073741824
  220. # Size of the cache (used to filter transactions we saw earlier) in transactions
  221. cache-size = 10000
  222. # Do not remove invalid transactions from the cache (default: false)
  223. # Set to true if it's not possible for any invalid transaction to become valid
  224. # again in the future.
  225. keep-invalid-txs-in-cache = false
  226. # Maximum size of a single transaction.
  227. # NOTE: the max size of a tx transmitted over the network is {max-tx-bytes}.
  228. max-tx-bytes = 1048576
  229. # Maximum size of a batch of transactions to send to a peer
  230. # Including space needed by encoding (one varint per transaction).
  231. # XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796
  232. max-batch-bytes = 0
  233. # ttl-duration, if non-zero, defines the maximum amount of time a transaction
  234. # can exist for in the mempool.
  235. #
  236. # Note, if ttl-num-blocks is also defined, a transaction will be removed if it
  237. # has existed in the mempool at least ttl-num-blocks number of blocks or if it's
  238. # insertion time into the mempool is beyond ttl-duration.
  239. ttl-duration = "0s"
  240. # ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction
  241. # can exist for in the mempool.
  242. #
  243. # Note, if ttl-duration is also defined, a transaction will be removed if it
  244. # has existed in the mempool at least ttl-num-blocks number of blocks or if
  245. # it's insertion time into the mempool is beyond ttl-duration.
  246. ttl-num-blocks = 0
  247. #######################################################
  248. ### State Sync Configuration Options ###
  249. #######################################################
  250. [statesync]
  251. # State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine
  252. # snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in
  253. # the network to take and serve state machine snapshots. State sync is not attempted if the node
  254. # has any local state (LastBlockHeight > 0). The node will have a truncated block history,
  255. # starting from the height of the snapshot.
  256. enable = false
  257. # RPC servers (comma-separated) for light client verification of the synced state machine and
  258. # retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding
  259. # header hash obtained from a trusted source, and a period during which validators can be trusted.
  260. #
  261. # For Cosmos SDK-based chains, trust-period should usually be about 2/3 of the unbonding time (~2
  262. # weeks) during which they can be financially punished (slashed) for misbehavior.
  263. rpc-servers = ""
  264. trust-height = 0
  265. trust-hash = ""
  266. trust-period = "168h0m0s"
  267. # Time to spend discovering snapshots before initiating a restore.
  268. discovery-time = "15s"
  269. # Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp).
  270. # Will create a new, randomly named directory within, and remove it when done.
  271. temp-dir = ""
  272. #######################################################
  273. ### BlockSync Configuration Connections ###
  274. #######################################################
  275. [blocksync]
  276. # If this node is many blocks behind the tip of the chain, BlockSync
  277. # allows them to catchup quickly by downloading blocks in parallel
  278. # and verifying their commits
  279. enable = true
  280. # Block Sync version to use:
  281. # 1) "v0" (default) - the standard block sync implementation
  282. # 2) "v2" - DEPRECATED, please use v0
  283. version = "v0"
  284. #######################################################
  285. ### Consensus Configuration Options ###
  286. #######################################################
  287. [consensus]
  288. wal-file = "data/cs.wal/wal"
  289. # How long we wait for a proposal block before prevoting nil
  290. timeout-propose = "3s"
  291. # How much timeout-propose increases with each round
  292. timeout-propose-delta = "500ms"
  293. # How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil)
  294. timeout-prevote = "1s"
  295. # How much the timeout-prevote increases with each round
  296. timeout-prevote-delta = "500ms"
  297. # How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil)
  298. timeout-precommit = "1s"
  299. # How much the timeout-precommit increases with each round
  300. timeout-precommit-delta = "500ms"
  301. # How long we wait after committing a block, before starting on the new
  302. # height (this gives us a chance to receive some more precommits, even
  303. # though we already have +2/3).
  304. timeout-commit = "1s"
  305. # How many blocks to look back to check existence of the node's consensus votes before joining consensus
  306. # When non-zero, the node will panic upon restart
  307. # if the same consensus key was used to sign {double-sign-check-height} last blocks.
  308. # So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic.
  309. double-sign-check-height = 0
  310. # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
  311. skip-timeout-commit = false
  312. # EmptyBlocks mode and possible interval between empty blocks
  313. create-empty-blocks = true
  314. create-empty-blocks-interval = "0s"
  315. # Reactor sleep duration parameters
  316. peer-gossip-sleep-duration = "100ms"
  317. peer-query-maj23-sleep-duration = "2s"
  318. #######################################################
  319. ### Transaction Indexer Configuration Options ###
  320. #######################################################
  321. [tx-index]
  322. # What indexer to use for transactions
  323. #
  324. # The application will set which txs to index. In some cases a node operator will be able
  325. # to decide which txs to index based on configuration set in the application.
  326. #
  327. # Options:
  328. # 1) "null"
  329. # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
  330. # - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed.
  331. indexer = "kv"
  332. #######################################################
  333. ### Instrumentation Configuration Options ###
  334. #######################################################
  335. [instrumentation]
  336. # When true, Prometheus metrics are served under /metrics on
  337. # PrometheusListenAddr.
  338. # Check out the documentation for the list of available metrics.
  339. prometheus = false
  340. # Address to listen for Prometheus collector(s) connections
  341. prometheus-listen-addr = ":26660"
  342. # Maximum number of simultaneous connections.
  343. # If you want to accept a larger number than the default, make sure
  344. # you increase your OS limits.
  345. # 0 - unlimited.
  346. max-open-connections = 3
  347. # Instrumentation namespace
  348. namespace = "tendermint"
  349. ```
  350. ## Empty blocks VS no empty blocks
  351. ### create-empty-blocks = true
  352. If `create-empty-blocks` is set to `true` in your config, blocks will be
  353. created ~ every second (with default consensus parameters). You can regulate
  354. the delay between blocks by changing the `timeout-commit`. E.g. `timeout-commit = "10s"` should result in ~ 10 second blocks.
  355. ### create-empty-blocks = false
  356. In this setting, blocks are created when transactions received.
  357. Note after the block H, Tendermint creates something we call a "proof block"
  358. (only if the application hash changed) H+1. The reason for this is to support
  359. proofs. If you have a transaction in block H that changes the state to X, the
  360. new application hash will only be included in block H+1. If after your
  361. transaction is committed, you want to get a light-client proof for the new state
  362. (X), you need the new block to be committed in order to do that because the new
  363. block has the new application hash for the state X. That's why we make a new
  364. (empty) block if the application hash changes. Otherwise, you won't be able to
  365. make a proof for the new state.
  366. Plus, if you set `create-empty-blocks-interval` to something other than the
  367. default (`0`), Tendermint will be creating empty blocks even in the absence of
  368. transactions every `create-empty-blocks-interval`. For instance, with
  369. `create-empty-blocks = false` and `create-empty-blocks-interval = "30s"`,
  370. Tendermint will only create blocks if there are transactions, or after waiting
  371. 30 seconds without receiving any transactions.
  372. ## Consensus timeouts explained
  373. There's a variety of information about timeouts in [Running in
  374. production](../tendermint-core/running-in-production.md)
  375. You can also find more detailed technical explanation in the spec: [The latest
  376. gossip on BFT consensus](https://arxiv.org/abs/1807.04938).
  377. ```toml
  378. [consensus]
  379. ...
  380. timeout-propose = "3s"
  381. timeout-propose-delta = "500ms"
  382. timeout-prevote = "1s"
  383. timeout-prevote-delta = "500ms"
  384. timeout-precommit = "1s"
  385. timeout-precommit-delta = "500ms"
  386. timeout-commit = "1s"
  387. ```
  388. Note that in a successful round, the only timeout that we absolutely wait no
  389. matter what is `timeout-commit`.
  390. Here's a brief summary of the timeouts:
  391. - `timeout-propose` = how long we wait for a proposal block before prevoting
  392. nil
  393. - `timeout-propose-delta` = how much timeout-propose increases with each round
  394. - `timeout-prevote` = how long we wait after receiving +2/3 prevotes for
  395. anything (ie. not a single block or nil)
  396. - `timeout-prevote-delta` = how much the timeout-prevote increases with each
  397. round
  398. - `timeout-precommit` = how long we wait after receiving +2/3 precommits for
  399. anything (ie. not a single block or nil)
  400. - `timeout-precommit-delta` = how much the timeout-precommit increases with
  401. each round
  402. - `timeout-commit` = how long we wait after committing a block, before starting
  403. on the new height (this gives us a chance to receive some more precommits,
  404. even though we already have +2/3)
  405. ## P2P settings
  406. This section will cover settings within the p2p section of the `config.toml`.
  407. - `external-address` = is the address that will be advertised for other nodes to use. We recommend setting this field with your public IP and p2p port.
  408. - > We recommend setting an external address. When used in a private network, Tendermint Core currently doesn't advertise the node's public address. There is active and ongoing work to improve the P2P system, but this is a helpful workaround for now.
  409. - `seeds` = is a list of comma separated seed nodes that you will connect upon a start and ask for peers. A seed node is a node that does not participate in consensus but only helps propagate peers to nodes in the networks
  410. - `persistent-peers` = is a list of comma separated peers that you will always want to be connected to. If you're already connected to the maximum number of peers, persistent peers will not be added.
  411. - `max-num-inbound-peers` = is the maximum number of peers you will accept inbound connections from at one time (where they dial your address and initiate the connection).
  412. - `max-num-outbound-peers` = is the maximum number of peers you will initiate outbound connects to at one time (where you dial their address and initiate the connection).
  413. - `unconditional-peer-ids` = is similar to `persistent-peers` except that these peers will be connected to even if you are already connected to the maximum number of peers. This can be a validator node ID on your sentry node.
  414. - `pex` = turns the peer exchange reactor on or off. Validator node will want the `pex` turned off so it would not begin gossiping to unknown peers on the network. PeX can also be turned off for statically configured networks with fixed network connectivity. For full nodes on open, dynamic networks, it should be turned on.
  415. - `private-peer-ids` = is a comma-separated list of node ids that will _not_ be exposed to other peers (i.e., you will not tell other peers about the ids in this list). This can be filled with a validator's node id.