github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/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  #   2) "v2" - complete redesign of v0, optimized for testability & readability
   267  version = "v0"
   268  
   269  ##### consensus configuration options #####
   270  [consensus]
   271  
   272  wal_file = "data/cs.wal/wal"
   273  
   274  timeout_propose = "3s"
   275  timeout_propose_delta = "500ms"
   276  timeout_prevote = "1s"
   277  timeout_prevote_delta = "500ms"
   278  timeout_precommit = "1s"
   279  timeout_precommit_delta = "500ms"
   280  timeout_commit = "1s"
   281  
   282  # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
   283  skip_timeout_commit = false
   284  
   285  # EmptyBlocks mode and possible interval between empty blocks
   286  create_empty_blocks = true
   287  create_empty_blocks_interval = "0s"
   288  
   289  # Reactor sleep duration parameters
   290  peer_gossip_sleep_duration = "100ms"
   291  peer_query_maj23_sleep_duration = "2s"
   292  
   293  # Block time parameters. Corresponds to the minimum time increment between consecutive blocks.
   294  blocktime_iota = "1s"
   295  
   296  ##### transactions indexer configuration options #####
   297  [tx_index]
   298  
   299  # What indexer to use for transactions
   300  #
   301  # Options:
   302  #   1) "null"
   303  #   2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
   304  indexer = "kv"
   305  
   306  # Comma-separated list of compositeKeys to index (by default the only key is "tx.hash")
   307  # Remember that Event has the following structure: type.key
   308  # type: [
   309  #  key: value,
   310  #  ...
   311  # ]
   312  #
   313  # You can also index transactions by height by adding "tx.height" event here.
   314  #
   315  # It's recommended to index only a subset of keys due to possible memory
   316  # bloat. This is, of course, depends on the indexer's DB and the volume of
   317  # transactions.
   318  index_keys = ""
   319  
   320  # When set to true, tells indexer to index all compositeKeys (predefined keys:
   321  # "tx.hash", "tx.height" and all keys from DeliverTx responses).
   322  #
   323  # Note this may be not desirable (see the comment above). IndexEvents has a
   324  # precedence over IndexAllEvents (i.e. when given both, IndexEvents will be
   325  # indexed).
   326  index_all_keys = false
   327  
   328  ##### instrumentation configuration options #####
   329  [instrumentation]
   330  
   331  # When true, Prometheus metrics are served under /metrics on
   332  # PrometheusListenAddr.
   333  # Check out the documentation for the list of available metrics.
   334  prometheus = false
   335  
   336  # Address to listen for Prometheus collector(s) connections
   337  prometheus_listen_addr = ":26660"
   338  
   339  # Maximum number of simultaneous connections.
   340  # If you want to accept a larger number than the default, make sure
   341  # you increase your OS limits.
   342  # 0 - unlimited.
   343  max_open_connections = 3
   344  
   345  # Instrumentation namespace
   346  namespace = "tendermint"
   347  ```
   348  
   349  ## Empty blocks VS no empty blocks
   350  
   351  **create_empty_blocks = true**
   352  
   353  If `create_empty_blocks` is set to `true` in your config, blocks will be
   354  created ~ every second (with default consensus parameters). You can regulate
   355  the delay between blocks by changing the `timeout_commit`. E.g. `timeout_commit = "10s"` should result in ~ 10 second blocks.
   356  
   357  **create_empty_blocks = false**
   358  
   359  In this setting, blocks are created when transactions received.
   360  
   361  Note after the block H, Tendermint creates something we call a "proof block"
   362  (only if the application hash changed) H+1. The reason for this is to support
   363  proofs. If you have a transaction in block H that changes the state to X, the
   364  new application hash will only be included in block H+1. If after your
   365  transaction is committed, you want to get a light-client proof for the new state
   366  (X), you need the new block to be committed in order to do that because the new
   367  block has the new application hash for the state X. That's why we make a new
   368  (empty) block if the application hash changes. Otherwise, you won't be able to
   369  make a proof for the new state.
   370  
   371  Plus, if you set `create_empty_blocks_interval` to something other than the
   372  default (`0`), Tendermint will be creating empty blocks even in the absence of
   373  transactions every `create_empty_blocks_interval`. For instance, with
   374  `create_empty_blocks = false` and `create_empty_blocks_interval = "30s"`,
   375  Tendermint will only create blocks if there are transactions, or after waiting
   376  30 seconds without receiving any transactions.
   377  
   378  ## Consensus timeouts explained
   379  
   380  There's a variety of information about timeouts in [Running in
   381  production](./running-in-production.md)
   382  
   383  You can also find more detailed technical explanation in the spec: [The latest
   384  gossip on BFT consensus](https://arxiv.org/abs/1807.04938).
   385  
   386  ```
   387  [consensus]
   388  ...
   389  
   390  timeout_propose = "3s"
   391  timeout_propose_delta = "500ms"
   392  timeout_prevote = "1s"
   393  timeout_prevote_delta = "500ms"
   394  timeout_precommit = "1s"
   395  timeout_precommit_delta = "500ms"
   396  timeout_commit = "1s"
   397  ```
   398  
   399  Note that in a successful round, the only timeout that we absolutely wait no
   400  matter what is `timeout_commit`.
   401  
   402  Here's a brief summary of the timeouts:
   403  
   404  - `timeout_propose` = how long we wait for a proposal block before prevoting
   405    nil
   406  - `timeout_propose_delta` = how much timeout_propose increases with each round
   407  - `timeout_prevote` = how long we wait after receiving +2/3 prevotes for
   408    anything (ie. not a single block or nil)
   409  - `timeout_prevote_delta` = how much the timeout_prevote increases with each
   410    round
   411  - `timeout_precommit` = how long we wait after receiving +2/3 precommits for
   412    anything (ie. not a single block or nil)
   413  - `timeout_precommit_delta` = how much the timeout_precommit increases with
   414    each round
   415  - `timeout_commit` = how long we wait after committing a block, before starting
   416    on the new height (this gives us a chance to receive some more precommits,
   417    even though we already have +2/3)