|
|
@ -53,59 +53,54 @@ func GetConfig(rootDir string) *viper.Viper { |
|
|
|
//config.WatchConfig()
|
|
|
|
|
|
|
|
// Set defaults or panic
|
|
|
|
if config.IsSet("chain_id") { |
|
|
|
if config.IsSet("chain.chain_id") { |
|
|
|
cmn.Exit("Cannot set 'chain_id' via config.toml") |
|
|
|
} |
|
|
|
if config.IsSet("revision_file") { |
|
|
|
cmn.Exit("Cannot set 'revision_file' via config.toml. It must match what's in the Makefile") |
|
|
|
} |
|
|
|
//mapConfig.SetRequired("chain_id") // blows up if you try to use it before setting.
|
|
|
|
config.SetDefault("genesis_file", rootDir+"/genesis.json") |
|
|
|
config.SetDefault("proxy_app", "tcp://127.0.0.1:46658") |
|
|
|
config.SetDefault("abci", "socket") |
|
|
|
config.SetDefault("moniker", "anonymous") |
|
|
|
config.SetDefault("node_laddr", "tcp://0.0.0.0:46656") |
|
|
|
config.SetDefault("seeds", "") |
|
|
|
// config.SetDefault("seeds", "goldenalchemist.chaintest.net:46656")
|
|
|
|
config.SetDefault("fast_sync", true) |
|
|
|
config.SetDefault("skip_upnp", false) |
|
|
|
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", "leveldb") |
|
|
|
config.SetDefault("db_dir", rootDir+"/data") |
|
|
|
config.SetDefault("log_level", "info") |
|
|
|
config.SetDefault("rpc_laddr", "tcp://0.0.0.0:46657") |
|
|
|
config.SetDefault("grpc_laddr", "") |
|
|
|
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) // max number of txs
|
|
|
|
config.SetDefault("block_part_size", 65536) // part size 64K
|
|
|
|
config.SetDefault("disable_data_hash", false) |
|
|
|
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("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) |
|
|
|
|
|
|
|
// all timeouts are in ms
|
|
|
|
config.SetDefault("timeout_handshake", 10000) |
|
|
|
config.SetDefault("timeout_propose", 3000) |
|
|
|
config.SetDefault("timeout_propose_delta", 500) |
|
|
|
config.SetDefault("timeout_prevote", 1000) |
|
|
|
config.SetDefault("timeout_prevote_delta", 500) |
|
|
|
config.SetDefault("timeout_precommit", 1000) |
|
|
|
config.SetDefault("timeout_precommit_delta", 500) |
|
|
|
config.SetDefault("timeout_commit", 1000) |
|
|
|
config.SetDefault("consensus.timeout_handshake", 10000) |
|
|
|
config.SetDefault("consensus.timeout_propose", 3000) |
|
|
|
config.SetDefault("consensus.timeout_propose_delta", 500) |
|
|
|
config.SetDefault("consensus.timeout_prevote", 1000) |
|
|
|
config.SetDefault("consensus.timeout_prevote_delta", 500) |
|
|
|
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("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("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("tx_index", "kv") |
|
|
|
config.SetDefault("db.tx_index", "kv") |
|
|
|
|
|
|
|
return config |
|
|
|
} |
|
|
|