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.

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