Documentation ¶
Overview ¶
Package listener is the listener used to pull in chain events
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoLatestBlockForChainID is returned when no block exists for the chain. ErrNoLatestBlockForChainID = db2.ErrNoLatestBlockForChainID )
Functions ¶
This section is empty.
Types ¶
type ContractListener ¶
type ContractListener interface { // Listen starts the listener and call HandleLog for each event Listen(ctx context.Context, handler HandleLog) error // LatestBlock gets the last recorded latest block from the rpc. // this is NOT last indexed. It is provided as a helper for checking confirmation count LatestBlock() uint64 // Address gets the address of the contract this listener is listening to Address() common.Address }
ContractListener listens for chain events and calls HandleLog.
func NewChainListener ¶
func NewChainListener(omnirpcClient client.EVM, store db2.ChainListenerDB, address common.Address, initialBlock uint64, handler metrics.Handler) (ContractListener, error)
NewChainListener creates a new chain listener.
Click to show internal directories.
Click to hide internal directories.