diff --git a/config/config.go b/config/config.go index facb415f3..ef53c21ca 100644 --- a/config/config.go +++ b/config/config.go @@ -575,8 +575,8 @@ func (cfg *ConsensusConfig) SetWalFile(walFile string) { //----------------------------------------------------------------------------- // TxIndexConfig -// TxIndexConfig defines the configuration for the transaction -// indexer, including tags to index. +// TxIndexConfig defines the configuration for the transaction indexer, +// including tags to index. type TxIndexConfig struct { // What indexer to use for transactions // @@ -585,16 +585,21 @@ type TxIndexConfig struct { // 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). Indexer string `mapstructure:"indexer"` - // Comma-separated list of tags to index (by default the only tag is tx hash) + // Comma-separated list of tags to index (by default the only tag is "tx.hash") // + // You can also index transactions by height by adding "tx.height" tag here. + // // It's recommended to index only a subset of tags due to possible memory // bloat. This is, of course, depends on the indexer's DB and the volume of // transactions. IndexTags string `mapstructure:"index_tags"` - // When set to true, tells indexer to index all tags. Note this may be not - // desirable (see the comment above). IndexTags has a precedence over - // IndexAllTags (i.e. when given both, IndexTags will be indexed). + // When set to true, tells indexer to index all tags (predefined tags: + // "tx.hash", "tx.height" and all tags from DeliverTx responses). + // + // Note this may be not desirable (see the comment above). IndexTags has a + // precedence over IndexAllTags (i.e. when given both, IndexTags will be + // indexed). IndexAllTags bool `mapstructure:"index_all_tags"` } diff --git a/config/toml.go b/config/toml.go index 184ce87bd..3f85eaad1 100644 --- a/config/toml.go +++ b/config/toml.go @@ -247,16 +247,21 @@ peer_query_maj23_sleep_duration = {{ .Consensus.PeerQueryMaj23SleepDuration }} # 2) "kv" - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "{{ .TxIndex.Indexer }}" -# Comma-separated list of tags to index (by default the only tag is tx hash) +# Comma-separated list of tags to index (by default the only tag is "tx.hash") +# +# You can also index transactions by height by adding "tx.height" tag here. # # It's recommended to index only a subset of tags due to possible memory # bloat. This is, of course, depends on the indexer's DB and the volume of # transactions. index_tags = "{{ .TxIndex.IndexTags }}" -# When set to true, tells indexer to index all tags. Note this may be not -# desirable (see the comment above). IndexTags has a precedence over -# IndexAllTags (i.e. when given both, IndexTags will be indexed). +# When set to true, tells indexer to index all tags (predefined tags: +# "tx.hash", "tx.height" and all tags from DeliverTx responses). +# +# Note this may be not desirable (see the comment above). IndexTags has a +# precedence over IndexAllTags (i.e. when given both, IndexTags will be +# indexed). index_all_tags = {{ .TxIndex.IndexAllTags }} ##### instrumentation configuration options ##### diff --git a/docs/app-dev/indexing-transactions.md b/docs/app-dev/indexing-transactions.md index 3bca10959..3ba097c4c 100644 --- a/docs/app-dev/indexing-transactions.md +++ b/docs/app-dev/indexing-transactions.md @@ -16,16 +16,21 @@ Let's take a look at the `[tx_index]` config section: # 2) "kv" - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "kv" -# Comma-separated list of tags to index (by default the only tag is tx hash) +# Comma-separated list of tags to index (by default the only tag is "tx.hash") +# +# You can also index transactions by height by adding "tx.height" tag here. # # It's recommended to index only a subset of tags due to possible memory # bloat. This is, of course, depends on the indexer's DB and the volume of # transactions. index_tags = "" -# When set to true, tells indexer to index all tags. Note this may be not -# desirable (see the comment above). IndexTags has a precedence over -# IndexAllTags (i.e. when given both, IndexTags will be indexed). +# When set to true, tells indexer to index all tags (predefined tags: +# "tx.hash", "tx.height" and all tags from DeliverTx responses). +# +# Note this may be not desirable (see the comment above). IndexTags has a +# precedence over IndexAllTags (i.e. when given both, IndexTags will be +# indexed). index_all_tags = false ``` @@ -59,7 +64,6 @@ all tags, set `index_all_tags=true` Note, there are a few predefined tags: -- `tm.event` (event type) - `tx.hash` (transaction's hash) - `tx.height` (height of the block transaction was committed in) diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index 13ea76da2..7e20277f4 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -194,16 +194,21 @@ peer_query_maj23_sleep_duration = 2000 # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "kv" -# Comma-separated list of tags to index (by default the only tag is tx hash) +# Comma-separated list of tags to index (by default the only tag is "tx.hash") # +# You can also index transactions by height by adding "tx.height" tag here. +# # It's recommended to index only a subset of tags due to possible memory # bloat. This is, of course, depends on the indexer's DB and the volume of # transactions. index_tags = "" -# When set to true, tells indexer to index all tags. Note this may be not -# desirable (see the comment above). IndexTags has a precedence over -# IndexAllTags (i.e. when given both, IndexTags will be indexed). +# When set to true, tells indexer to index all tags (predefined tags: +# "tx.hash", "tx.height" and all tags from DeliverTx responses). +# +# Note this may be not desirable (see the comment above). IndexTags has a +# precedence over IndexAllTags (i.e. when given both, IndexTags will be +# indexed). index_all_tags = false ##### instrumentation configuration options #####