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.

528 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. # If this node is many blocks behind the tip of the chain, BlockSync
  30. # allows them to catchup quickly by downloading blocks in parallel
  31. # and verifying their commits
  32. fast-sync = true
  33. # Mode of Node: full | validator | seed (default: "validator")
  34. # * validator node (default)
  35. # - all reactors
  36. # - with priv_validator_key.json, priv_validator_state.json
  37. # * full node
  38. # - all reactors
  39. # - No priv_validator_key.json, priv_validator_state.json
  40. # * seed node
  41. # - only P2P, PEX Reactor
  42. # - No priv_validator_key.json, priv_validator_state.json
  43. mode = "validator"
  44. # Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb
  45. # * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
  46. # - pure go
  47. # - stable
  48. # * cleveldb (uses levigo wrapper)
  49. # - fast
  50. # - requires gcc
  51. # - use cleveldb build tag (go build -tags cleveldb)
  52. # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
  53. # - EXPERIMENTAL
  54. # - may be faster is some use-cases (random reads - indexer)
  55. # - use boltdb build tag (go build -tags boltdb)
  56. # * rocksdb (uses github.com/tecbot/gorocksdb)
  57. # - EXPERIMENTAL
  58. # - requires gcc
  59. # - use rocksdb build tag (go build -tags rocksdb)
  60. # * badgerdb (uses github.com/dgraph-io/badger)
  61. # - EXPERIMENTAL
  62. # - use badgerdb build tag (go build -tags badgerdb)
  63. db-backend = "goleveldb"
  64. # Database directory
  65. db-dir = "data"
  66. # Output level for logging, including package level options
  67. log-level = "info"
  68. # Output format: 'plain' (colored text) or 'json'
  69. log-format = "plain"
  70. ##### additional base config options #####
  71. # Path to the JSON file containing the initial validator set and other meta data
  72. genesis-file = "config/genesis.json"
  73. # Path to the JSON file containing the private key to use as a validator in the consensus protocol
  74. priv-validator-key-file = "config/priv_validator_key.json"
  75. # Path to the JSON file containing the last sign state of a validator
  76. priv-validator-state-file = "data/priv_validator_state.json"
  77. # TCP or UNIX socket address for Tendermint to listen on for
  78. # connections from an external PrivValidator process
  79. priv-validator-laddr = ""
  80. # Path to the JSON file containing the private key to use for node authentication in the p2p protocol
  81. node-key-file = "config/node_key.json"
  82. # Mechanism to connect to the ABCI application: socket | grpc
  83. abci = "socket"
  84. # If true, query the ABCI app on connecting to a new peer
  85. # so the app can decide if we should keep the connection or not
  86. filter-peers = false
  87. #######################################################################
  88. ### Advanced Configuration Options ###
  89. #######################################################################
  90. #######################################################
  91. ### RPC Server Configuration Options ###
  92. #######################################################
  93. [rpc]
  94. # TCP or UNIX socket address for the RPC server to listen on
  95. laddr = "tcp://127.0.0.1:26657"
  96. # A list of origins a cross-domain request can be executed from
  97. # Default value '[]' disables cors support
  98. # Use '["*"]' to allow any origin
  99. cors-allowed-origins = []
  100. # A list of methods the client is allowed to use with cross-domain requests
  101. cors-allowed-methods = ["HEAD", "GET", "POST", ]
  102. # A list of non simple headers the client is allowed to use with cross-domain requests
  103. cors-allowed-headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ]
  104. # TCP or UNIX socket address for the gRPC server to listen on
  105. # NOTE: This server only supports /broadcast_tx_commit
  106. grpc-laddr = ""
  107. # Maximum number of simultaneous connections.
  108. # Does not include RPC (HTTP&WebSocket) connections. See max-open-connections
  109. # If you want to accept a larger number than the default, make sure
  110. # you increase your OS limits.
  111. # 0 - unlimited.
  112. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  113. # 1024 - 40 - 10 - 50 = 924 = ~900
  114. grpc-max-open-connections = 900
  115. # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
  116. unsafe = false
  117. # Maximum number of simultaneous connections (including WebSocket).
  118. # Does not include gRPC connections. See grpc-max-open-connections
  119. # If you want to accept a larger number than the default, make sure
  120. # you increase your OS limits.
  121. # 0 - unlimited.
  122. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  123. # 1024 - 40 - 10 - 50 = 924 = ~900
  124. max-open-connections = 900
  125. # Maximum number of unique clientIDs that can /subscribe
  126. # If you're using /broadcast_tx_commit, set to the estimated maximum number
  127. # of broadcast_tx_commit calls per block.
  128. max-subscription-clients = 100
  129. # Maximum number of unique queries a given client can /subscribe to
  130. # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
  131. # the estimated # maximum number of broadcast_tx_commit calls per block.
  132. max-subscriptions-per-client = 5
  133. # How long to wait for a tx to be committed during /broadcast_tx_commit.
  134. # WARNING: Using a value larger than 10s will result in increasing the
  135. # global HTTP write timeout, which applies to all connections and endpoints.
  136. # See https://github.com/tendermint/tendermint/issues/3435
  137. timeout-broadcast-tx-commit = "10s"
  138. # Maximum size of request body, in bytes
  139. max-body-bytes = 1000000
  140. # Maximum size of request header, in bytes
  141. max-header-bytes = 1048576
  142. # The path to a file containing certificate that is used to create the HTTPS server.
  143. # Might be either absolute path or path related to Tendermint's config directory.
  144. # If the certificate is signed by a certificate authority,
  145. # the certFile should be the concatenation of the server's certificate, any intermediates,
  146. # and the CA's certificate.
  147. # NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server.
  148. # Otherwise, HTTP server is run.
  149. tls-cert-file = ""
  150. # The path to a file containing matching private key that is used to create the HTTPS server.
  151. # Might be either absolute path or path related to Tendermint's config directory.
  152. # NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server.
  153. # Otherwise, HTTP server is run.
  154. tls-key-file = ""
  155. # pprof listen address (https://golang.org/pkg/net/http/pprof)
  156. pprof-laddr = ""
  157. #######################################################
  158. ### P2P Configuration Options ###
  159. #######################################################
  160. [p2p]
  161. # Address to listen for incoming connections
  162. laddr = "tcp://0.0.0.0:26656"
  163. # Address to advertise to peers for them to dial
  164. # If empty, will use the same port as the laddr,
  165. # and will introspect on the listener or use UPnP
  166. # to figure out the address.
  167. external-address = ""
  168. # Comma separated list of seed nodes to connect to
  169. seeds = ""
  170. # Comma separated list of nodes to keep persistent connections to
  171. persistent-peers = ""
  172. # UPNP port forwarding
  173. upnp = false
  174. # Path to address book
  175. addr-book-file = "config/addrbook.json"
  176. # Set true for strict address routability rules
  177. # Set false for private or local networks
  178. addr-book-strict = true
  179. # Maximum number of inbound peers
  180. max-num-inbound-peers = 40
  181. # Maximum number of outbound peers to connect to, excluding persistent peers
  182. max-num-outbound-peers = 10
  183. # Maximum number of connections (inbound and outbound).
  184. max-connections = 64
  185. # Rate limits the number of incoming connection attempts per IP address.
  186. max-incoming-connection-attempts = 100
  187. # List of node IDs, to which a connection will be (re)established ignoring any existing limits
  188. unconditional-peer-ids = ""
  189. # Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)
  190. persistent-peers-max-dial-period = "0s"
  191. # Time to wait before flushing messages out on the connection
  192. flush-throttle-timeout = "100ms"
  193. # Maximum size of a message packet payload, in bytes
  194. max-packet-msg-payload-size = 1024
  195. # Rate at which packets can be sent, in bytes/second
  196. send-rate = 5120000
  197. # Rate at which packets can be received, in bytes/second
  198. recv-rate = 5120000
  199. # Set true to enable the peer-exchange reactor
  200. pex = true
  201. # Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
  202. private-peer-ids = ""
  203. # Toggle to disable guard against peers connecting from the same ip.
  204. allow-duplicate-ip = false
  205. # Peer connection configuration.
  206. handshake-timeout = "20s"
  207. dial-timeout = "3s"
  208. #######################################################
  209. ### Mempool Configuration Option ###
  210. #######################################################
  211. [mempool]
  212. # Mempool version to use:
  213. # 1) "v0" - The legacy non-prioritized mempool reactor.
  214. # 2) "v1" (default) - The prioritized mempool reactor.
  215. version = "v1"
  216. recheck = true
  217. broadcast = true
  218. # Maximum number of transactions in the mempool
  219. size = 5000
  220. # Limit the total size of all txs in the mempool.
  221. # This only accounts for raw transactions (e.g. given 1MB transactions and
  222. # max-txs-bytes=5MB, mempool will only accept 5 transactions).
  223. max-txs-bytes = 1073741824
  224. # Size of the cache (used to filter transactions we saw earlier) in transactions
  225. cache-size = 10000
  226. # Do not remove invalid transactions from the cache (default: false)
  227. # Set to true if it's not possible for any invalid transaction to become valid
  228. # again in the future.
  229. keep-invalid-txs-in-cache = false
  230. # Maximum size of a single transaction.
  231. # NOTE: the max size of a tx transmitted over the network is {max-tx-bytes}.
  232. max-tx-bytes = 1048576
  233. # Maximum size of a batch of transactions to send to a peer
  234. # Including space needed by encoding (one varint per transaction).
  235. # XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796
  236. max-batch-bytes = 0
  237. # ttl-duration, if non-zero, defines the maximum amount of time a transaction
  238. # can exist for in the mempool.
  239. #
  240. # Note, if ttl-num-blocks is also defined, a transaction will be removed if it
  241. # has existed in the mempool at least ttl-num-blocks number of blocks or if it's
  242. # insertion time into the mempool is beyond ttl-duration.
  243. ttl-duration = "0s"
  244. # ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction
  245. # can exist for in the mempool.
  246. #
  247. # Note, if ttl-duration is also defined, a transaction will be removed if it
  248. # has existed in the mempool at least ttl-num-blocks number of blocks or if
  249. # it's insertion time into the mempool is beyond ttl-duration.
  250. ttl-num-blocks = 0
  251. #######################################################
  252. ### State Sync Configuration Options ###
  253. #######################################################
  254. [statesync]
  255. # State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine
  256. # snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in
  257. # the network to take and serve state machine snapshots. State sync is not attempted if the node
  258. # has any local state (LastBlockHeight > 0). The node will have a truncated block history,
  259. # starting from the height of the snapshot.
  260. enable = false
  261. # RPC servers (comma-separated) for light client verification of the synced state machine and
  262. # retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding
  263. # header hash obtained from a trusted source, and a period during which validators can be trusted.
  264. #
  265. # For Cosmos SDK-based chains, trust-period should usually be about 2/3 of the unbonding time (~2
  266. # weeks) during which they can be financially punished (slashed) for misbehavior.
  267. rpc-servers = ""
  268. trust-height = 0
  269. trust-hash = ""
  270. trust-period = "168h0m0s"
  271. # Time to spend discovering snapshots before initiating a restore.
  272. discovery-time = "15s"
  273. # Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp).
  274. # Will create a new, randomly named directory within, and remove it when done.
  275. temp-dir = ""
  276. #######################################################
  277. ### BlockSync Configuration Connections ###
  278. #######################################################
  279. [fastsync]
  280. # Block Sync version to use:
  281. # 1) "v0" (default) - the legacy block sync implementation
  282. # 2) "v2" - complete redesign of v0, optimized for testability & readability
  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.