mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-30 22:51:19 +00:00
add config option for tx indexing and disable it by default
This commit is contained in:
parent
d62e85757f
commit
b08f29cb71
@ -101,6 +101,8 @@ func GetConfig(rootDir string) cfg.Config {
|
|||||||
mapConfig.SetDefault("mempool_broadcast", true)
|
mapConfig.SetDefault("mempool_broadcast", true)
|
||||||
mapConfig.SetDefault("mempool_wal_dir", rootDir+"/data/mempool.wal")
|
mapConfig.SetDefault("mempool_wal_dir", rootDir+"/data/mempool.wal")
|
||||||
|
|
||||||
|
mapConfig.SetDefault("tx_indexer", "none")
|
||||||
|
|
||||||
return mapConfig
|
return mapConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +107,8 @@ func ResetConfig(localPath string) cfg.Config {
|
|||||||
mapConfig.SetDefault("mempool_broadcast", true)
|
mapConfig.SetDefault("mempool_broadcast", true)
|
||||||
mapConfig.SetDefault("mempool_wal_dir", "")
|
mapConfig.SetDefault("mempool_wal_dir", "")
|
||||||
|
|
||||||
|
mapConfig.SetDefault("tx_indexer", "none")
|
||||||
|
|
||||||
logger.SetLogLevel(mapConfig.GetString("log_level"))
|
logger.SetLogLevel(mapConfig.GetString("log_level"))
|
||||||
|
|
||||||
return mapConfig
|
return mapConfig
|
||||||
|
@ -44,6 +44,7 @@ type State struct {
|
|||||||
TxIndexer tx.Indexer `json:"-"` // Transaction indexer.
|
TxIndexer tx.Indexer `json:"-"` // Transaction indexer.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used in tests.
|
||||||
func LoadState(db dbm.DB) *State {
|
func LoadState(db dbm.DB) *State {
|
||||||
return loadState(db, stateKey)
|
return loadState(db, stateKey)
|
||||||
}
|
}
|
||||||
@ -132,8 +133,13 @@ func GetState(config cfg.Config, stateDB dbm.DB) *State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Transaction indexing
|
// Transaction indexing
|
||||||
store := dbm.NewDB("tx_indexer", config.GetString("db_backend"), config.GetString("db_dir"))
|
switch config.GetString("tx_indexer") {
|
||||||
state.TxIndexer = txindexer.NewKV(store)
|
case "kv":
|
||||||
|
store := dbm.NewDB("tx_indexer", config.GetString("db_backend"), config.GetString("db_dir"))
|
||||||
|
state.TxIndexer = txindexer.NewKV(store)
|
||||||
|
default:
|
||||||
|
state.TxIndexer = &txindexer.Null{}
|
||||||
|
}
|
||||||
|
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user