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

package txindex

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

Index

Package Files

indexer.go indexer_service.go

Variables

var ErrorEmptyHash = errors.New("Transaction hash cannot be empty")

ErrorEmptyHash indicates empty hash

type Batch Uses

type Batch struct {
    Ops []*types.TxResult
}

Batch groups together multiple Index operations to be performed at the same time. NOTE: Batch is NOT thread-safe and must not be modified after starting its execution.

func NewBatch Uses

func NewBatch(n int64) *Batch

NewBatch creates a new Batch.

func (*Batch) Add Uses

func (b *Batch) Add(result *types.TxResult) error

Add or update an entry for the given result.Index.

func (*Batch) Size Uses

func (b *Batch) Size() int

Size returns the total number of operations inside the batch.

type IndexerService Uses

type IndexerService struct {
    cmn.BaseService
    // contains filtered or unexported fields
}

IndexerService connects event bus and transaction indexer together in order to index transactions coming from event bus.

func NewIndexerService Uses

func NewIndexerService(idr TxIndexer, eventBus *types.EventBus) *IndexerService

NewIndexerService returns a new service instance.

func (*IndexerService) OnStart Uses

func (is *IndexerService) OnStart() error

OnStart implements cmn.Service by subscribing for all transactions and indexing them by tags.

func (*IndexerService) OnStop Uses

func (is *IndexerService) OnStop()

OnStop implements cmn.Service by unsubscribing from all transactions.

type TxIndexer Uses

type TxIndexer interface {

    // AddBatch analyzes, indexes and stores a batch of transactions.
    AddBatch(b *Batch) error

    // Index analyzes, indexes and stores a single transaction.
    Index(result *types.TxResult) error

    // Get returns the transaction specified by hash or nil if the transaction is not indexed
    // or stored.
    Get(hash []byte) (*types.TxResult, error)

    // Search allows you to query for transactions.
    Search(q *query.Query) ([]*types.TxResult, error)
}

TxIndexer interface defines methods to index and search transactions.

Directories

PathSynopsis
kv
null

Package txindex imports 5 packages (graph) and is imported by 24 packages. Updated 2019-09-12. Refresh now. Tools for package owners.