Documentation ¶
Overview ¶
Package listener provides the event listener service for the RFQ relayer. This package implements a service that listens for events on the FastBridge contract (for one chain). Functionality includes: - Listening for BridgeRequested and BridgeRelayed events - Dynamically ranging over both blocks in and out of the confirmation range - Caching already seen events in a LRU cache - Sending new unconfirmed events to the RFQ relayer quote freezing service - Storing new confirmed events to the RFQ relayer event processing service
Index ¶
Constants ¶
const (
// DefaultCacheSize is the default size of the LRU cache.
DefaultCacheSize = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainListenerConfig ¶
type ChainListenerConfig struct { ChainID uint32 StartBlock uint64 BridgeAddress common.Address Client client.EVM PollInterval int MaxGetLogsRange uint64 Confirmations uint64 ABI abi.ABI }
ChainListenerConfig is a config struct for a ChainListener.
type IChainListener ¶
type IChainListener interface { // ABI returns the ABI of the bridge contract. ABI() abi.ABI // ChainID returns the chain ID of the chain the listener is listening on. ChainID() uint32 // StartListening starts listening for events. StartListening(ctx context.Context) error // IterateThroughLogs iterates through logs and sends them to their respective channels. IterateThroughLogs(ctx context.Context, logs []types.Log, lastUnconfirmedBlock uint64) error }
IChainListener is the interface for a ChainListener.
func NewChainListener ¶
func NewChainListener(config *ChainListenerConfig, db db.DB, eventChan chan relayerTypes.WrappedLog, seenChan chan relayerTypes.WrappedLog) (IChainListener, error)
NewChainListener creates a new chain listener.