systemcontractindex

package
v2.1.0-rc12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexerCommon

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

IndexerCommon is the common struct for all contract indexers It provides the basic functions, including

  1. kvstore
  2. put/get index height
  3. contract address

func NewIndexerCommon

func NewIndexerCommon(kvstore db.KVStore, ns string, key []byte, contractAddress string, startHeight uint64) *IndexerCommon

NewIndexerCommon creates a new IndexerCommon

func (*IndexerCommon) Commit

func (s *IndexerCommon) Commit(height uint64, delta batch.KVStoreBatch) error

Commit commits the height to the indexer

func (*IndexerCommon) ContractAddress

func (s *IndexerCommon) ContractAddress() string

ContractAddress returns the contract address

func (*IndexerCommon) ExpectedHeight

func (s *IndexerCommon) ExpectedHeight() uint64

ExpectedHeight returns the expected height

func (*IndexerCommon) Height

func (s *IndexerCommon) Height() uint64

Height returns the tip block height

func (*IndexerCommon) KVStore

func (s *IndexerCommon) KVStore() db.KVStore

KVStore returns the kvstore

func (*IndexerCommon) Start

func (s *IndexerCommon) Start(ctx context.Context) error

Start starts the indexer

func (*IndexerCommon) StartHeight

func (s *IndexerCommon) StartHeight() uint64

StartHeight returns the start height of the indexer

func (*IndexerCommon) Stop

func (s *IndexerCommon) Stop(ctx context.Context) error

Stop stops the indexer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL