Documentation ¶
Index ¶
- type Blockchain
- type Indexer
- func (i *Indexer) Close(ctx context.Context) error
- func (i *Indexer) HandleBlock(ctx context.Context, blk *tmtypes.Block) error
- func (i *Indexer) HandleNewBlock(ctx context.Context, blk *tmtypes.Block) error
- func (i *Indexer) HandleTx(ctx context.Context, blockHeight, blockTimeUnix int, tmTx tmtypes.Tx) error
- func (i *Indexer) IndexBlocksFromTo(ctx context.Context, from, to int)
- func (i *Indexer) IndexOldBlocks(ctx context.Context)
- func (i *Indexer) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain interface { Close(ctx context.Context) error ChainID() string ChainHeader() (chainID string, height uint64, err error) SetChainHeader(*tmtypes.Block) DecodeTx(tx tmtypes.Tx) (sdktypes.Tx, error) SubscribeNewBlock(ctx context.Context) (<-chan *tmtypes.Block, error) Block(ctx context.Context, height int64) (blk *tmtypes.Block, minimumBlkHeight int, err error) CheckTx(ctx context.Context, tx tmtypes.Tx) error LightProvider() provtypes.Provider }
Blockchain is the expected blockchain interface the indexer needs to store data in the database.
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer struct responsible for calling blockchain rpc/websocket for data and storing that into the database.
func NewIndexer ¶
func NewIndexer(ctx context.Context, b Blockchain, logger zerolog.Logger, startBlockHeight int, ika *ika.Client) (*Indexer, error)
NewIndexer returns a new indexer struct with open connections.
func (*Indexer) HandleBlock ¶
HandleBlock handles the receive of a block from the chain.
func (*Indexer) HandleNewBlock ¶
HandleNewBlock handles the receive of new block from the chain.
func (*Indexer) HandleTx ¶
func (i *Indexer) HandleTx(ctx context.Context, blockHeight, blockTimeUnix int, tmTx tmtypes.Tx) error
HandleTx handles the receive of new Tx from the chain.
func (*Indexer) IndexBlocksFromTo ¶
IndexBlocksFromTo index blocks from specific heights.
func (*Indexer) IndexOldBlocks ¶
IndexOldBlocks checks if it is needed to index old blocks and index them as needed.
Click to show internal directories.
Click to hide internal directories.