Documentation ¶
Index ¶
- type IndexerCommon
- func (s *IndexerCommon) Commit(height uint64, delta batch.KVStoreBatch) error
- func (s *IndexerCommon) ContractAddress() string
- func (s *IndexerCommon) ExpectedHeight() uint64
- func (s *IndexerCommon) Height() uint64
- func (s *IndexerCommon) KVStore() db.KVStore
- func (s *IndexerCommon) Start(ctx context.Context) error
- func (s *IndexerCommon) StartHeight() uint64
- func (s *IndexerCommon) Stop(ctx context.Context) error
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
- kvstore
- put/get index height
- 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
Click to show internal directories.
Click to hide internal directories.