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.

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