Rename Tag(s) to Event(s) (#4046)

* Rename Tag(s) to Event(s)

- tag was replaced with event, but in some places it still mentions tag, would be easier to understand if we tried to replace it with event to not confuse people.

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* more  changes from tag -> event

* rename events to compositeKeys and keys

* Apply suggestions from code review

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* add minor documentation on how composite keys are constructed

* rename eventkey to compositekey

Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>

* add changelog entry & add info to regenerate confid to changelog entry
This commit is contained in:
Marko
2019-12-04 12:37:48 +01:00
committed by GitHub
parent 1c46145be7
commit 92d18d7fcd
21 changed files with 157 additions and 129 deletions

View File

@@ -883,9 +883,15 @@ func (cfg *ConsensusConfig) ValidateBasic() error {
//-----------------------------------------------------------------------------
// TxIndexConfig
// Remember that Event has the following structure:
// type: [
// key: value,
// ...
// ]
//
// CompositeKeys are constructed by `type.key`
// TxIndexConfig defines the configuration for the transaction indexer,
// including tags to index.
// including composite keys to index.
type TxIndexConfig struct {
// What indexer to use for transactions
//
@@ -895,30 +901,30 @@ type TxIndexConfig struct {
// 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 compositeKeys to index (by default the only key is "tx.hash")
//
// You can also index transactions by height by adding "tx.height" tag here.
// You can also index transactions by height by adding "tx.height" key here.
//
// It's recommended to index only a subset of tags due to possible memory
// It's recommended to index only a subset of keys 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"`
IndexKeys string `mapstructure:"index_keys"`
// When set to true, tells indexer to index all tags (predefined tags:
// "tx.hash", "tx.height" and all tags from DeliverTx responses).
// When set to true, tells indexer to index all compositeKeys (predefined keys:
// "tx.hash", "tx.height" and all keys 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
// Note this may be not desirable (see the comment above). IndexKeys has a
// precedence over IndexAllKeys (i.e. when given both, IndexKeys will be
// indexed).
IndexAllTags bool `mapstructure:"index_all_tags"`
IndexAllKeys bool `mapstructure:"index_all_keys"`
}
// DefaultTxIndexConfig returns a default configuration for the transaction indexer.
func DefaultTxIndexConfig() *TxIndexConfig {
return &TxIndexConfig{
Indexer: "kv",
IndexTags: "",
IndexAllTags: false,
IndexKeys: "",
IndexAllKeys: false,
}
}