github.com/fiagdao/tendermint@v0.32.11-0.20220824195748-2087fcc480c1/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  ```
    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  ##### main base config options #####
    29  
    30  # TCP or UNIX socket address of the ABCI application,
    31  # or the name of an ABCI application compiled in with the Tendermint binary
    32  proxy_app = "tcp://127.0.0.1:26658"
    33  
    34  # A custom human readable name for this node
    35  moniker = "anonymous"
    36  
    37  # If this node is many blocks behind the tip of the chain, FastSync
    38  # allows them to catchup quickly by downloading blocks in parallel
    39  # and verifying their commits
    40  fast_sync = true
    41  
    42  # Database backend: goleveldb | cleveldb | boltdb | rocksdb
    43  # * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
    44  #   - pure go
    45  #   - stable
    46  # * cleveldb (uses levigo wrapper)
    47  #   - fast
    48  #   - requires gcc
    49  #   - use cleveldb build tag (go build -tags cleveldb)
    50  # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
    51  #   - EXPERIMENTAL
    52  #   - may be faster is some use-cases (random reads - indexer)
    53  #   - use boltdb build tag (go build -tags boltdb)
    54  # * rocksdb (uses github.com/tecbot/gorocksdb)
    55  #   - EXPERIMENTAL
    56  #   - requires gcc
    57  #   - use rocksdb build tag (go build -tags rocksdb)
    58  db_backend = "goleveldb"
    59  
    60  # Database directory
    61  db_dir = "data"
    62  
    63  # Output level for logging, including package level options
    64  log_level = "main:info,state:info,*:error"
    65  
    66  # Output format: 'plain' (colored text) or 'json'
    67  log_format = "plain"
    68  
    69  ##### additional base config options #####
    70  
    71  # Path to the JSON file containing the initial validator set and other meta data
    72  genesis_file = "config/genesis.json"
    73  
    74  # Path to the JSON file containing the private key to use as a validator in the consensus protocol
    75  priv_validator_file = "config/priv_validator.json"
    76  
    77  # TCP or UNIX socket address for Tendermint to listen on for
    78  # connections from an external PrivValidator process
    79  priv_validator_laddr = ""
    80  
    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  
    84  # Mechanism to connect to the ABCI application: socket | grpc
    85  abci = "socket"
    86  
    87  # TCP or UNIX socket address for the profiling server to listen on
    88  prof_laddr = ""
    89  
    90  # If true, query the ABCI app on connecting to a new peer
    91  # so the app can decide if we should keep the connection or not
    92  filter_peers = false
    93  
    94  ##### advanced configuration options #####
    95  
    96  ##### rpc server configuration options #####
    97  [rpc]
    98  
    99  # TCP or UNIX socket address for the RPC server to listen on
   100  laddr = "tcp://0.0.0.0:26657"
   101  
   102  # A list of origins a cross-domain request can be executed from
   103  # Default value '[]' disables cors support
   104  # Use '["*"]' to allow any origin
   105  cors_allowed_origins = []
   106  
   107  # A list of methods the client is allowed to use with cross-domain requests
   108  cors_allowed_methods = ["HEAD", "GET", "POST"]
   109  
   110  # A list of non simple headers the client is allowed to use with cross-domain requests
   111  cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time"]
   112  
   113  # TCP or UNIX socket address for the gRPC server to listen on
   114  # NOTE: This server only supports /broadcast_tx_commit
   115  grpc_laddr = ""
   116  
   117  # Maximum number of simultaneous connections.
   118  # Does not include RPC (HTTP&WebSocket) connections. See 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  grpc_max_open_connections = 900
   125  
   126  # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
   127  unsafe = false
   128  
   129  # Maximum number of simultaneous connections (including WebSocket).
   130  # Does not include gRPC connections. See grpc_max_open_connections
   131  # If you want to accept a larger number than the default, make sure
   132  # you increase your OS limits.
   133  # 0 - unlimited.
   134  # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
   135  # 1024 - 40 - 10 - 50 = 924 = ~900
   136  max_open_connections = 900
   137  
   138  # Maximum number of unique clientIDs that can /subscribe
   139  # If you're using /broadcast_tx_commit, set to the estimated maximum number
   140  # of broadcast_tx_commit calls per block.
   141  max_subscription_clients = 100
   142  
   143  # Maximum number of unique queries a given client can /subscribe to
   144  # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
   145  # the estimated # maximum number of broadcast_tx_commit calls per block.
   146  max_subscriptions_per_client = 5
   147  
   148  # How long to wait for a tx to be committed during /broadcast_tx_commit.
   149  # WARNING: Using a value larger than 10s will result in increasing the
   150  # global HTTP write timeout, which applies to all connections and endpoints.
   151  # See https://github.com/tendermint/tendermint/issues/3435
   152  timeout_broadcast_tx_commit = "10s"
   153  
   154  # Maximum size of request body, in bytes
   155  max_body_bytes = {{ .RPC.MaxBodyBytes }}
   156  
   157  # Maximum size of request header, in bytes
   158  max_header_bytes = {{ .RPC.MaxHeaderBytes }}
   159  
   160  # The path to a file containing certificate that is used to create the HTTPS server.
   161  # Migth be either absolute path or path related to tendermint's config directory.
   162  # If the certificate is signed by a certificate authority,
   163  # the certFile should be the concatenation of the server's certificate, any intermediates,
   164  # and the CA's certificate.
   165  # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run.
   166  tls_cert_file = ""
   167  
   168  # The path to a file containing matching private key that is used to create the HTTPS server.
   169  # Migth be either absolute path or path related to tendermint's config directory.
   170  # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run.
   171  tls_key_file = ""
   172  
   173  ##### peer to peer configuration options #####
   174  [p2p]
   175  
   176  # Address to listen for incoming connections
   177  laddr = "tcp://0.0.0.0:26656"
   178  
   179  # Address to advertise to peers for them to dial
   180  # If empty, will use the same port as the laddr,
   181  # and will introspect on the listener or use UPnP
   182  # to figure out the address.
   183  external_address = ""
   184  
   185  # Comma separated list of seed nodes to connect to
   186  seeds = ""
   187  
   188  # Comma separated list of nodes to keep persistent connections to
   189  persistent_peers = ""
   190  
   191  # UPNP port forwarding
   192  upnp = false
   193  
   194  # Path to address book
   195  addr_book_file = "config/addrbook.json"
   196  
   197  # Set true for strict address routability rules
   198  # Set false for private or local networks
   199  addr_book_strict = true
   200  
   201  # Maximum number of inbound peers
   202  max_num_inbound_peers = 40
   203  
   204  # Maximum number of outbound peers to connect to, excluding persistent peers
   205  max_num_outbound_peers = 10
   206  
   207  # Time to wait before flushing messages out on the connection
   208  flush_throttle_timeout = "100ms"
   209  
   210  # Maximum size of a message packet payload, in bytes
   211  max_packet_msg_payload_size = 1024
   212  
   213  # Rate at which packets can be sent, in bytes/second
   214  send_rate = 5120000
   215  
   216  # Rate at which packets can be received, in bytes/second
   217  recv_rate = 5120000
   218  
   219  # Set true to enable the peer-exchange reactor
   220  pex = true
   221  
   222  # Seed mode, in which node constantly crawls the network and looks for
   223  # peers. If another node asks it for addresses, it responds and disconnects.
   224  #
   225  # Does not work if the peer-exchange reactor is disabled.
   226  seed_mode = false
   227  
   228  # Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
   229  private_peer_ids = ""
   230  
   231  # Toggle to disable guard against peers connecting from the same ip.
   232  allow_duplicate_ip = false
   233  
   234  # Peer connection configuration.
   235  handshake_timeout = "20s"
   236  dial_timeout = "3s"
   237  
   238  ##### mempool configuration options #####
   239  [mempool]
   240  
   241  recheck = true
   242  broadcast = true
   243  wal_dir = ""
   244  
   245  # Maximum number of transactions in the mempool
   246  size = 5000
   247  
   248  # Limit the total size of all txs in the mempool.
   249  # This only accounts for raw transactions (e.g. given 1MB transactions and
   250  # max_txs_bytes=5MB, mempool will only accept 5 transactions).
   251  max_txs_bytes = 1073741824
   252  
   253  # Size of the cache (used to filter transactions we saw earlier) in transactions
   254  cache_size = 10000
   255  
   256  # Maximum size of a single transaction.
   257  # NOTE: the max size of a tx transmitted over the network is {max_tx_bytes} + {amino overhead}.
   258  max_tx_bytes = 1048576
   259  
   260  ##### fast sync configuration options #####
   261  [fastsync]
   262  
   263  # Fast Sync version to use:
   264  #   1) "v0" (default) - the legacy fast sync implementation
   265  #   2) "v1" - refactor of v0 version for better testability
   266  version = "v0"
   267  
   268  ##### consensus configuration options #####
   269  [consensus]
   270  
   271  wal_file = "data/cs.wal/wal"
   272  
   273  timeout_propose = "3s"
   274  timeout_propose_delta = "500ms"
   275  timeout_prevote = "1s"
   276  timeout_prevote_delta = "500ms"
   277  timeout_precommit = "1s"
   278  timeout_precommit_delta = "500ms"
   279  timeout_commit = "1s"
   280  
   281  # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
   282  skip_timeout_commit = false
   283  
   284  # EmptyBlocks mode and possible interval between empty blocks
   285  create_empty_blocks = true
   286  create_empty_blocks_interval = "0s"
   287  
   288  # Reactor sleep duration parameters
   289  peer_gossip_sleep_duration = "100ms"
   290  peer_query_maj23_sleep_duration = "2s"
   291  
   292  # Block time parameters. Corresponds to the minimum time increment between consecutive blocks.
   293  blocktime_iota = "1s"
   294  
   295  ##### transactions indexer configuration options #####
   296  [tx_index]
   297  
   298  # What indexer to use for transactions
   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  indexer = "kv"
   304  
   305  # Comma-separated list of compositeKeys to index (by default the only key is "tx.hash")
   306  # Remember that Event has the following structure: type.key
   307  # type: [
   308  #  key: value,
   309  #  ...
   310  # ]
   311  #
   312  # You can also index transactions by height by adding "tx.height" event here.
   313  #
   314  # It's recommended to index only a subset of keys due to possible memory
   315  # bloat. This is, of course, depends on the indexer's DB and the volume of
   316  # transactions.
   317  index_keys = ""
   318  
   319  # When set to true, tells indexer to index all compositeKeys (predefined keys:
   320  # "tx.hash", "tx.height" and all keys from DeliverTx responses).
   321  #
   322  # Note this may be not desirable (see the comment above). IndexEvents has a
   323  # precedence over IndexAllEvents (i.e. when given both, IndexEvents will be
   324  # indexed).
   325  index_all_keys = false
   326  
   327  ##### instrumentation configuration options #####
   328  [instrumentation]
   329  
   330  # When true, Prometheus metrics are served under /metrics on
   331  # PrometheusListenAddr.
   332  # Check out the documentation for the list of available metrics.
   333  prometheus = false
   334  
   335  # Address to listen for Prometheus collector(s) connections
   336  prometheus_listen_addr = ":26660"
   337  
   338  # Maximum number of simultaneous connections.
   339  # If you want to accept a larger number than the default, make sure
   340  # you increase your OS limits.
   341  # 0 - unlimited.
   342  max_open_connections = 3
   343  
   344  # Instrumentation namespace
   345  namespace = "tendermint"
   346  ```
   347  
   348  ## Empty blocks VS no empty blocks
   349  
   350  **create_empty_blocks = true**
   351  
   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  
   356  **create_empty_blocks = false**
   357  
   358  In this setting, blocks are created when transactions received.
   359  
   360  Note after the block H, Tendermint creates something we call a "proof block"
   361  (only if the application hash changed) H+1. The reason for this is to support
   362  proofs. If you have a transaction in block H that changes the state to X, the
   363  new application hash will only be included in block H+1. If after your
   364  transaction is committed, you want to get a lite-client proof for the new state
   365  (X), you need the new block to be committed in order to do that because the new
   366  block has the new application hash for the state X. That's why we make a new
   367  (empty) block if the application hash changes. Otherwise, you won't be able to
   368  make a proof for the new state.
   369  
   370  Plus, if you set `create_empty_blocks_interval` to something other than the
   371  default (`0`), Tendermint will be creating empty blocks even in the absence of
   372  transactions every `create_empty_blocks_interval`. For instance, with
   373  `create_empty_blocks = false` and `create_empty_blocks_interval = "30s"`,
   374  Tendermint will only create blocks if there are transactions, or after waiting
   375  30 seconds without receiving any transactions.
   376  
   377  ## Consensus timeouts explained
   378  
   379  There's a variety of information about timeouts in [Running in
   380  production](./running-in-production.md)
   381  
   382  You can also find more detailed technical explanation in the spec: [The latest
   383  gossip on BFT consensus](https://arxiv.org/abs/1807.04938).
   384  
   385  ```
   386  [consensus]
   387  ...
   388  
   389  timeout_propose = "3s"
   390  timeout_propose_delta = "500ms"
   391  timeout_prevote = "1s"
   392  timeout_prevote_delta = "500ms"
   393  timeout_precommit = "1s"
   394  timeout_precommit_delta = "500ms"
   395  timeout_commit = "1s"
   396  ```
   397  
   398  Note that in a successful round, the only timeout that we absolutely wait no
   399  matter what is `timeout_commit`.
   400  
   401  Here's a brief summary of the timeouts:
   402  
   403  - `timeout_propose` = how long we wait for a proposal block before prevoting
   404    nil
   405  - `timeout_propose_delta` = how much timeout_propose increases with each round
   406  - `timeout_prevote` = how long we wait after receiving +2/3 prevotes for
   407    anything (ie. not a single block or nil)
   408  - `timeout_prevote_delta` = how much the timeout_prevote increases with each
   409    round
   410  - `timeout_precommit` = how long we wait after receiving +2/3 precommits for
   411    anything (ie. not a single block or nil)
   412  - `timeout_precommit_delta` = how much the timeout_precommit increases with
   413    each round
   414  - `timeout_commit` = how long we wait after committing a block, before starting
   415    on the new height (this gives us a chance to receive some more precommits,
   416    even though we already have +2/3)