tendermint: github.com/tendermint/tendermint/state/txindex/kv Index | Files

package kv

import "github.com/tendermint/tendermint/state/txindex/kv"

Index

Package Files

codec.go kv.go

func IndexAllTags Uses

func IndexAllTags() func(*TxIndex)

IndexAllTags is an option for indexing all tags.

func IndexTags Uses

func IndexTags(tags []string) func(*TxIndex)

IndexTags is an option for setting which tags to index.

type TxIndex Uses

type TxIndex struct {
    // contains filtered or unexported fields
}

TxIndex is the simplest possible indexer, backed by key-value storage (levelDB).

func NewTxIndex Uses

func NewTxIndex(store dbm.DB, options ...func(*TxIndex)) *TxIndex

NewTxIndex creates new KV indexer.

func (*TxIndex) AddBatch Uses

func (txi *TxIndex) AddBatch(b *txindex.Batch) error

AddBatch indexes a batch of transactions using the given list of events. Each key that indexed from the tx's events is a composite of the event type and the respective attribute's key delimited by a "." (eg. "account.number"). Any event with an empty type is not indexed.

func (*TxIndex) Get Uses

func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error)

Get gets transaction from the TxIndex storage and returns it or nil if the transaction is not found.

func (*TxIndex) Index Uses

func (txi *TxIndex) Index(result *types.TxResult) error

Index indexes a single transaction using the given list of events. Each key that indexed from the tx's events is a composite of the event type and the respective attribute's key delimited by a "." (eg. "account.number"). Any event with an empty type is not indexed.

func (*TxIndex) Search Uses

func (txi *TxIndex) Search(q *query.Query) ([]*types.TxResult, error)

Search performs a search using the given query. It breaks the query into conditions (like "tx.height > 5"). For each condition, it queries the DB index. One special use cases here: (1) if "tx.hash" is found, it returns tx result for it (2) for range queries it is better for the client to provide both lower and upper bounds, so we are not performing a full scan. Results from querying indexes are then intersected and returned to the caller.

Package kv imports 14 packages (graph) and is imported by 6 packages. Updated 2019-09-14. Refresh now. Tools for package owners.