Browse Source

fix up config defaults

pull/484/head
Ethan Buchman 8 years ago
parent
commit
24ce90fc72
2 changed files with 43 additions and 46 deletions
  1. +19
    -21
      config/tendermint/config.go
  2. +24
    -25
      config/tendermint_test/config.go

+ 19
- 21
config/tendermint/config.go View File

@ -57,32 +57,32 @@ func GetConfig(rootDir string) *viper.Viper {
cmn.Exit("Cannot set 'chain_id' via config.toml")
}
//mapConfig.SetRequired("chain_id") // blows up if you try to use it before setting.
config.SetDefault("node.moniker", "anonymous")
config.SetDefault("node.log_level", "info")
config.SetDefault("node.prof_laddr", "")
config.SetDefault("chain.genesis_file", rootDir+"/genesis.json")
config.SetDefault("abci.proxy_app", "tcp://127.0.0.1:46658")
config.SetDefault("abci.mode", "socket")
config.SetDefault("abci.filter_peers", false)
config.SetDefault("moniker", "anonymous")
config.SetDefault("log_level", "info")
config.SetDefault("prof_laddr", "")
config.SetDefault("genesis_file", rootDir+"/genesis.json")
config.SetDefault("proxy_app", "tcp://127.0.0.1:46658")
config.SetDefault("abci", "socket")
config.SetDefault("filter_peers", false)
config.SetDefault("fast_sync", true)
config.SetDefault("priv_validator_file", rootDir+"/priv_validator.json")
config.SetDefault("db_backend", "leveldb")
config.SetDefault("db_dir", rootDir+"/data")
config.SetDefault("rpc_laddr", "tcp://0.0.0.0:46657")
config.SetDefault("grpc_laddr", "")
config.SetDefault("tx_index", "kv")
config.SetDefault("network.listen_addr", "tcp://0.0.0.0:46656")
config.SetDefault("network.seeds", "")
config.SetDefault("network.skip_upnp", false)
config.SetDefault("blockchain.fast_sync", true)
config.SetDefault("network.addrbook_file", rootDir+"/addrbook.json")
config.SetDefault("network.addrbook_strict", true) // disable to allow connections locally
config.SetDefault("network.pex_reactor", false) // enable for peer exchange
config.SetDefault("node.priv_validator_file", rootDir+"/priv_validator.json")
config.SetDefault("db.backend", "leveldb")
config.SetDefault("db.dir", rootDir+"/data")
config.SetDefault("rpc.listen_addr", "tcp://0.0.0.0:46657")
config.SetDefault("rpc.grpc_listen_addr", "")
config.SetDefault("consensus.wal_file", rootDir+"/data/cs.wal/wal")
config.SetDefault("consensus.wal_light", false)
config.SetDefault("block.max_txs", 10000) // max number of txs
config.SetDefault("block.part_size", 65536) // part size 64K
config.SetDefault("block.disable_data_hash", false)
config.SetDefault("consensus.max_block_size_txs", 10000) // max number of txs
config.SetDefault("consensus.block_part_size", 65536) // part size 64K
// all timeouts are in ms
config.SetDefault("consensus.timeout_handshake", 10000)
config.SetDefault("consensus.timeout_propose", 3000)
@ -92,16 +92,14 @@ func GetConfig(rootDir string) *viper.Viper {
config.SetDefault("consensus.timeout_precommit", 1000)
config.SetDefault("consensus.timeout_precommit_delta", 500)
config.SetDefault("consensus.timeout_commit", 1000)
// make progress asap (no `timeout_commit`) on full precommit votes
config.SetDefault("consensus.skip_timeout_commit", false)
config.SetDefault("mempool.recheck", true)
config.SetDefault("mempool.recheck_empty", true)
config.SetDefault("mempool.broadcast", true)
config.SetDefault("mempool.wal_dir", rootDir+"/data/mempool.wal")
config.SetDefault("db.tx_index", "kv")
return config
}


+ 24
- 25
config/tendermint_test/config.go View File

@ -80,10 +80,6 @@ func ResetConfig(localPath string) *viper.Viper {
config.SetDefault("moniker", "anonymous")
config.SetDefault("node_laddr", "tcp://0.0.0.0:36656")
config.SetDefault("fast_sync", false)
config.SetDefault("skip_upnp", true)
config.SetDefault("addrbook_file", rootDir+"/addrbook.json")
config.SetDefault("addrbook_strict", true) // disable to allow connections locally
config.SetDefault("pex_reactor", false) // enable for peer exchange
config.SetDefault("priv_validator_file", rootDir+"/priv_validator.json")
config.SetDefault("db_backend", "memdb")
config.SetDefault("db_dir", rootDir+"/data")
@ -91,30 +87,33 @@ func ResetConfig(localPath string) *viper.Viper {
config.SetDefault("rpc_laddr", "tcp://0.0.0.0:36657")
config.SetDefault("grpc_laddr", "tcp://0.0.0.0:36658")
config.SetDefault("prof_laddr", "")
config.SetDefault("revision_file", rootDir+"/revision")
config.SetDefault("cs_wal_file", rootDir+"/data/cs.wal/wal")
config.SetDefault("cs_wal_light", false)
config.SetDefault("filter_peers", false)
config.SetDefault("block_size", 10000)
config.SetDefault("block_part_size", 65536) // part size 64K
config.SetDefault("disable_data_hash", false)
config.SetDefault("timeout_handshake", 10000)
config.SetDefault("timeout_propose", 2000)
config.SetDefault("timeout_propose_delta", 1)
config.SetDefault("timeout_prevote", 10)
config.SetDefault("timeout_prevote_delta", 1)
config.SetDefault("timeout_precommit", 10)
config.SetDefault("timeout_precommit_delta", 1)
config.SetDefault("timeout_commit", 10)
config.SetDefault("skip_timeout_commit", true)
config.SetDefault("mempool_recheck", true)
config.SetDefault("mempool_recheck_empty", true)
config.SetDefault("mempool_broadcast", true)
config.SetDefault("mempool_wal_dir", "")
config.SetDefault("tx_index", "kv")
config.SetDefault("p2p.skip_upnp", true)
config.SetDefault("p2p.addrbook_file", rootDir+"/addrbook.json")
config.SetDefault("p2p.addrbook_strict", true) // disable to allow connections locally
config.SetDefault("p2p.pex_reactor", false) // enable for peer exchange
config.SetDefault("consensus.wal_file", rootDir+"/data/cs.wal/wal")
config.SetDefault("consensus.wal_light", false)
config.SetDefault("consensus.max_block_size_txs", 10000)
config.SetDefault("consensus.block_part_size", 65536) // part size 64K
config.SetDefault("consensus.timeout_handshake", 10000)
config.SetDefault("consensus.timeout_propose", 2000)
config.SetDefault("consensus.timeout_propose_delta", 1)
config.SetDefault("consensus.timeout_prevote", 10)
config.SetDefault("consensus.timeout_prevote_delta", 1)
config.SetDefault("consensus.timeout_precommit", 10)
config.SetDefault("consensus.timeout_precommit_delta", 1)
config.SetDefault("consensus.timeout_commit", 10)
config.SetDefault("consensus.skip_timeout_commit", true)
config.SetDefault("mempool.recheck", true)
config.SetDefault("mempool.recheck_empty", true)
config.SetDefault("mempool.broadcast", true)
config.SetDefault("mempool.wal_dir", "")
logger.SetLogLevel(config.GetString("log_level"))
return config


Loading…
Cancel
Save