github.com/noirx94/tendermintmp@v0.0.1/docs/tendermint-core/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 # 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 65 # Database directory 66 db_dir = "data" 67 68 # Output level for logging, including package level options 69 log_level = "main:info,state:info,statesync:info,*:error" 70 71 # Output format: 'plain' (colored text) or 'json' 72 log_format = "plain" 73 74 ##### additional base config options ##### 75 76 # Path to the JSON file containing the initial validator set and other meta data 77 genesis_file = "config/genesis.json" 78 79 # Path to the JSON file containing the private key to use as a validator in the consensus protocol 80 priv_validator_key_file = "config/priv_validator_key.json" 81 82 # Path to the JSON file containing the last sign state of a validator 83 priv_validator_state_file = "data/priv_validator_state.json" 84 85 # TCP or UNIX socket address for Tendermint to listen on for 86 # connections from an external PrivValidator process 87 priv_validator_laddr = "" 88 89 # Path to the JSON file containing the private key to use for node authentication in the p2p protocol 90 node_key_file = "config/node_key.json" 91 92 # Mechanism to connect to the ABCI application: socket | grpc 93 abci = "socket" 94 95 # If true, query the ABCI app on connecting to a new peer 96 # so the app can decide if we should keep the connection or not 97 filter_peers = false 98 99 100 ####################################################################### 101 ### Advanced Configuration Options ### 102 ####################################################################### 103 104 ####################################################### 105 ### RPC Server Configuration Options ### 106 ####################################################### 107 [rpc] 108 109 # TCP or UNIX socket address for the RPC server to listen on 110 laddr = "tcp://127.0.0.1:26657" 111 112 # A list of origins a cross-domain request can be executed from 113 # Default value '[]' disables cors support 114 # Use '["*"]' to allow any origin 115 cors_allowed_origins = [] 116 117 # A list of methods the client is allowed to use with cross-domain requests 118 cors_allowed_methods = ["HEAD", "GET", "POST", ] 119 120 # A list of non simple headers the client is allowed to use with cross-domain requests 121 cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] 122 123 # TCP or UNIX socket address for the gRPC server to listen on 124 # NOTE: This server only supports /broadcast_tx_commit 125 grpc_laddr = "" 126 127 # Maximum number of simultaneous connections. 128 # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections 129 # If you want to accept a larger number than the default, make sure 130 # you increase your OS limits. 131 # 0 - unlimited. 132 # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} 133 # 1024 - 40 - 10 - 50 = 924 = ~900 134 grpc_max_open_connections = 900 135 136 # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool 137 unsafe = false 138 139 # Maximum number of simultaneous connections (including WebSocket). 140 # Does not include gRPC connections. See grpc_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 max_open_connections = 900 147 148 # Maximum number of unique clientIDs that can /subscribe 149 # If you're using /broadcast_tx_commit, set to the estimated maximum number 150 # of broadcast_tx_commit calls per block. 151 max_subscription_clients = 100 152 153 # Maximum number of unique queries a given client can /subscribe to 154 # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to 155 # the estimated # maximum number of broadcast_tx_commit calls per block. 156 max_subscriptions_per_client = 5 157 158 # How long to wait for a tx to be committed during /broadcast_tx_commit. 159 # WARNING: Using a value larger than 10s will result in increasing the 160 # global HTTP write timeout, which applies to all connections and endpoints. 161 # See https://github.com/tendermint/tendermint/issues/3435 162 timeout_broadcast_tx_commit = "10s" 163 164 # Maximum size of request body, in bytes 165 max_body_bytes = 1000000 166 167 # Maximum size of request header, in bytes 168 max_header_bytes = 1048576 169 170 # The path to a file containing certificate that is used to create the HTTPS server. 171 # Migth be either absolute path or path related to tendermint's config directory. 172 # If the certificate is signed by a certificate authority, 173 # the certFile should be the concatenation of the server's certificate, any intermediates, 174 # and the CA's certificate. 175 # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. 176 # Otherwise, HTTP server is run. 177 tls_cert_file = "" 178 179 # The path to a file containing matching private key that is used to create the HTTPS server. 180 # Migth be either absolute path or path related to tendermint's config directory. 181 # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. 182 # Otherwise, HTTP server is run. 183 tls_key_file = "" 184 185 # pprof listen address (https://golang.org/pkg/net/http/pprof) 186 pprof_laddr = "" 187 188 ####################################################### 189 ### P2P Configuration Options ### 190 ####################################################### 191 [p2p] 192 193 # Address to listen for incoming connections 194 laddr = "tcp://0.0.0.0:26656" 195 196 # Address to advertise to peers for them to dial 197 # If empty, will use the same port as the laddr, 198 # and will introspect on the listener or use UPnP 199 # to figure out the address. 200 external_address = "" 201 202 # Comma separated list of seed nodes to connect to 203 seeds = "" 204 205 # Comma separated list of nodes to keep persistent connections to 206 persistent_peers = "" 207 208 # UPNP port forwarding 209 upnp = false 210 211 # Path to address book 212 addr_book_file = "config/addrbook.json" 213 214 # Set true for strict address routability rules 215 # Set false for private or local networks 216 addr_book_strict = true 217 218 # Maximum number of inbound peers 219 max_num_inbound_peers = 40 220 221 # Maximum number of outbound peers to connect to, excluding persistent peers 222 max_num_outbound_peers = 10 223 224 # List of node IDs, to which a connection will be (re)established ignoring any existing limits 225 unconditional_peer_ids = "" 226 227 # Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) 228 persistent_peers_max_dial_period = "0s" 229 230 # Time to wait before flushing messages out on the connection 231 flush_throttle_timeout = "100ms" 232 233 # Maximum size of a message packet payload, in bytes 234 max_packet_msg_payload_size = 1024 235 236 # Rate at which packets can be sent, in bytes/second 237 send_rate = 5120000 238 239 # Rate at which packets can be received, in bytes/second 240 recv_rate = 5120000 241 242 # Set true to enable the peer-exchange reactor 243 pex = true 244 245 # Seed mode, in which node constantly crawls the network and looks for 246 # peers. If another node asks it for addresses, it responds and disconnects. 247 # 248 # Does not work if the peer-exchange reactor is disabled. 249 seed_mode = false 250 251 # Comma separated list of peer IDs to keep private (will not be gossiped to other peers) 252 private_peer_ids = "" 253 254 # Toggle to disable guard against peers connecting from the same ip. 255 allow_duplicate_ip = false 256 257 # Peer connection configuration. 258 handshake_timeout = "20s" 259 dial_timeout = "3s" 260 261 ####################################################### 262 ### Mempool Configurattion Option ### 263 ####################################################### 264 [mempool] 265 266 recheck = true 267 broadcast = true 268 wal_dir = "" 269 270 # Maximum number of transactions in the mempool 271 size = 5000 272 273 # Limit the total size of all txs in the mempool. 274 # This only accounts for raw transactions (e.g. given 1MB transactions and 275 # max_txs_bytes=5MB, mempool will only accept 5 transactions). 276 max_txs_bytes = 1073741824 277 278 # Size of the cache (used to filter transactions we saw earlier) in transactions 279 cache_size = 10000 280 281 # Do not remove invalid transactions from the cache (default: false) 282 # Set to true if it's not possible for any invalid transaction to become valid 283 # again in the future. 284 keep-invalid-txs-in-cache = false 285 286 # Maximum size of a single transaction. 287 # NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. 288 max_tx_bytes = 1048576 289 290 # Maximum size of a batch of transactions to send to a peer 291 # Including space needed by encoding (one varint per transaction). 292 # XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 293 max_batch_bytes = 10485760 294 295 ####################################################### 296 ### State Sync Configuration Options ### 297 ####################################################### 298 [statesync] 299 # State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine 300 # snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in 301 # the network to take and serve state machine snapshots. State sync is not attempted if the node 302 # has any local state (LastBlockHeight > 0). The node will have a truncated block history, 303 # starting from the height of the snapshot. 304 enable = false 305 306 # RPC servers (comma-separated) for light client verification of the synced state machine and 307 # retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding 308 # header hash obtained from a trusted source, and a period during which validators can be trusted. 309 # 310 # For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 311 # weeks) during which they can be financially punished (slashed) for misbehavior. 312 rpc_servers = "" 313 trust_height = 0 314 trust_hash = "" 315 trust_period = "0s" 316 317 # Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). 318 # Will create a new, randomly named directory within, and remove it when done. 319 temp_dir = "" 320 321 ####################################################### 322 ### Fast Sync Configuration Connections ### 323 ####################################################### 324 [fastsync] 325 326 # Fast Sync version to use: 327 # 1) "v0" (default) - the legacy fast sync implementation 328 # 2) "v1" - refactor of v0 version for better testability 329 # 2) "v2" - complete redesign of v0, optimized for testability & readability 330 version = "v0" 331 332 ####################################################### 333 ### Consensus Configuration Options ### 334 ####################################################### 335 [consensus] 336 337 wal_file = "data/cs.wal/wal" 338 339 # How long we wait for a proposal block before prevoting nil 340 timeout_propose = "3s" 341 # How much timeout_propose increases with each round 342 timeout_propose_delta = "500ms" 343 # How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) 344 timeout_prevote = "1s" 345 # How much the timeout_prevote increases with each round 346 timeout_prevote_delta = "500ms" 347 # How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) 348 timeout_precommit = "1s" 349 # How much the timeout_precommit increases with each round 350 timeout_precommit_delta = "500ms" 351 # How long we wait after committing a block, before starting on the new 352 # height (this gives us a chance to receive some more precommits, even 353 # though we already have +2/3). 354 timeout_commit = "1s" 355 356 # How many blocks to look back to check existence of the node's consensus votes before joining consensus 357 # When non-zero, the node will panic upon restart 358 # if the same consensus key was used to sign {double_sign_check_height} last blocks. 359 # So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. 360 double_sign_check_height = 0 361 362 # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) 363 skip_timeout_commit = false 364 365 # EmptyBlocks mode and possible interval between empty blocks 366 create_empty_blocks = true 367 create_empty_blocks_interval = "0s" 368 369 # Reactor sleep duration parameters 370 peer_gossip_sleep_duration = "100ms" 371 peer_query_maj23_sleep_duration = "2s" 372 373 ####################################################### 374 ### Transaction Indexer Configuration Options ### 375 ####################################################### 376 [tx_index] 377 378 # What indexer to use for transactions 379 # 380 # The application will set which txs to index. In some cases a node operator will be able 381 # to decide which txs to index based on configuration set in the application. 382 # 383 # Options: 384 # 1) "null" 385 # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). 386 # - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. 387 indexer = "kv" 388 389 ####################################################### 390 ### Instrumentation Configuration Options ### 391 ####################################################### 392 [instrumentation] 393 394 # When true, Prometheus metrics are served under /metrics on 395 # PrometheusListenAddr. 396 # Check out the documentation for the list of available metrics. 397 prometheus = false 398 399 # Address to listen for Prometheus collector(s) connections 400 prometheus_listen_addr = ":26660" 401 402 # Maximum number of simultaneous connections. 403 # If you want to accept a larger number than the default, make sure 404 # you increase your OS limits. 405 # 0 - unlimited. 406 max_open_connections = 3 407 408 # Instrumentation namespace 409 namespace = "tendermint" 410 411 ``` 412 413 ## Empty blocks VS no empty blocks 414 415 ### create_empty_blocks = true 416 417 If `create_empty_blocks` is set to `true` in your config, blocks will be 418 created ~ every second (with default consensus parameters). You can regulate 419 the delay between blocks by changing the `timeout_commit`. E.g. `timeout_commit = "10s"` should result in ~ 10 second blocks. 420 421 ### create_empty_blocks = false 422 423 In this setting, blocks are created when transactions received. 424 425 Note after the block H, Tendermint creates something we call a "proof block" 426 (only if the application hash changed) H+1. The reason for this is to support 427 proofs. If you have a transaction in block H that changes the state to X, the 428 new application hash will only be included in block H+1. If after your 429 transaction is committed, you want to get a light-client proof for the new state 430 (X), you need the new block to be committed in order to do that because the new 431 block has the new application hash for the state X. That's why we make a new 432 (empty) block if the application hash changes. Otherwise, you won't be able to 433 make a proof for the new state. 434 435 Plus, if you set `create_empty_blocks_interval` to something other than the 436 default (`0`), Tendermint will be creating empty blocks even in the absence of 437 transactions every `create_empty_blocks_interval`. For instance, with 438 `create_empty_blocks = false` and `create_empty_blocks_interval = "30s"`, 439 Tendermint will only create blocks if there are transactions, or after waiting 440 30 seconds without receiving any transactions. 441 442 ## Consensus timeouts explained 443 444 There's a variety of information about timeouts in [Running in 445 production](./running-in-production.md) 446 447 You can also find more detailed technical explanation in the spec: [The latest 448 gossip on BFT consensus](https://arxiv.org/abs/1807.04938). 449 450 ```toml 451 [consensus] 452 ... 453 454 timeout_propose = "3s" 455 timeout_propose_delta = "500ms" 456 timeout_prevote = "1s" 457 timeout_prevote_delta = "500ms" 458 timeout_precommit = "1s" 459 timeout_precommit_delta = "500ms" 460 timeout_commit = "1s" 461 ``` 462 463 Note that in a successful round, the only timeout that we absolutely wait no 464 matter what is `timeout_commit`. 465 466 Here's a brief summary of the timeouts: 467 468 - `timeout_propose` = how long we wait for a proposal block before prevoting 469 nil 470 - `timeout_propose_delta` = how much timeout_propose increases with each round 471 - `timeout_prevote` = how long we wait after receiving +2/3 prevotes for 472 anything (ie. not a single block or nil) 473 - `timeout_prevote_delta` = how much the timeout_prevote increases with each 474 round 475 - `timeout_precommit` = how long we wait after receiving +2/3 precommits for 476 anything (ie. not a single block or nil) 477 - `timeout_precommit_delta` = how much the timeout_precommit increases with 478 each round 479 - `timeout_commit` = how long we wait after committing a block, before starting 480 on the new height (this gives us a chance to receive some more precommits, 481 even though we already have +2/3)