Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")
)
Functions ¶
Types ¶
type Config ¶
type Config struct { // address configs SrcBridgeAddress common.Address SrcSignalServiceAddress common.Address SrcTaikoAddress common.Address DestBridgeAddress common.Address // db configs DatabaseUsername string DatabasePassword string DatabaseName string DatabaseHost string DatabaseMaxIdleConns uint64 DatabaseMaxOpenConns uint64 DatabaseMaxConnLifetime uint64 // queue configs QueueUsername string QueuePassword string QueueHost string QueuePort uint64 // rpc configs SrcRPCUrl string DestRPCUrl string ETHClientTimeout uint64 BlockBatchSize uint64 NumGoroutines uint64 SubscriptionBackoff uint64 SyncMode SyncMode WatchMode WatchMode NumLatestBlocksEndWhenCrawling uint64 NumLatestBlocksStartWhenCrawling uint64 EventName string TargetBlockNumber *uint64 BackOffRetryInterval time.Duration BackOffMaxRetries uint64 MinFeeToIndex uint64 OpenQueueFunc func() (queue.Queue, error) OpenDBFunc func() (db.DB, error) ConfirmationTimeout time.Duration }
Config is a struct which should be created from the cli or environment variables, populated, and used to create a new Indexer.
func NewConfigFromCliContext ¶
NewConfigFromCliContext creates a new config instance from command line flags.
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer is the main struct of this package, containing all dependencies necessary for indexing relayer-related chain data. All database repositories, contract implementations, and configurations will be injected here. An indexer should be configured and deployed for all possible combinations of bridging. IE: an indexer for L1-L2, and another for L2-L1. an L1-L2 indexer will have the L1 configurations as its source, and vice versa for the L2-L1 indexer. They will add messages to a queue specifically for a processor of the same configuration.
func (*Indexer) Close ¶
Close waits for the wait groups internally to be stopped ,which will be done when the context is stopped externally by cmd/main.go shutdown.
func (*Indexer) InitFromCli ¶
InitFromCli inits a new Indexer from command line or environment variables.
type SyncMode ¶
type SyncMode string
SyncMode is a type which determines how the indexer will start indexing.
type WatchMode ¶
type WatchMode string
WatchMode is a type that determines how the indexer will operate.
var ( // Filter will filter past blocks, but when catches up to latest block, // will stop. Filter WatchMode = "filter" // Subscribe ignores all past blocks, only subscibes to new events from latest block. Subscribe WatchMode = "subscribe" // FilterAndSubscribe filters up til latest block, then subscribes to new events. This is the // default mode. FilterAndSubscribe WatchMode = "filter-and-subscribe" // CrawlPastBlocks filters through the past N blocks on a loop, when it reaches `latestBlock - N`, // it will recursively start the loop again, filtering for missed events, or ones the // processor failed to process. CrawlPastBlocks WatchMode = "crawl-past-blocks" WatchModes = []WatchMode{Filter, Subscribe, FilterAndSubscribe, CrawlPastBlocks} )