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