Documentation
¶
Index ¶
- Constants
- func WithAccumulatePool(wp *pool.WorkerPool) opt
- func WithCache(c Cache) opt
- func WithFetchPool(wp *pool.WorkerPool) opt
- func WithLogger(logger util.Logger) opt
- func WithMetrics(metrics util.Metrics) opt
- func WithWritePool(wp *pool.WorkerPool) opt
- type Cache
- type Config
- type Driver
- type Poller
Constants ¶
View Source
const ( // ModeReady means the poller is ready to have its mode reassessed based on chaintip position ModeReady = iota // ModeSleep means the poller is within reorg depth and is waiting to chaintip to progress before reassessing ModeSleep // ModePaused means the poller has been manually paused - it will stay in this state until manually resumed ModePaused // ModeBackfill means the poller is >= batchSize blocks from chaintip and will pull a batch of past blocks ModeBackfill // ModeChaintip means the poller is < batchSize blocks from chaintip and will pull one block at a time ModeChaintip )
Modes determine what the poller does on each iteration of its main routine's loop; these are determined by the distance of the cursor from chaintip and the success/failure state of the previous iteration
Variables ¶
This section is empty.
Functions ¶
func WithAccumulatePool ¶
func WithAccumulatePool(wp *pool.WorkerPool) opt
func WithFetchPool ¶
func WithFetchPool(wp *pool.WorkerPool) opt
func WithLogger ¶
func WithMetrics ¶
func WithWritePool ¶
func WithWritePool(wp *pool.WorkerPool) opt
Types ¶
type Config ¶
type Config struct {
Blockchain constants.Blockchain `env:"BLOCKCHAIN,required"`
BatchSize int `env:"BATCH_SIZE" envDefault:"100"`
ReorgDepth int `env:"REORG_DEPTH" envDefault:"8"`
HttpRetries int `env:"HTTP_RETRIES" envDefault:"10"`
SleepTime time.Duration `env:"POLLER_SLEEP_TIME" envDefault:"12s"`
Tick time.Duration `env:"POLLER_TICK_DURATION" envDefault:"1s"`
AutoStart bool `env:"POLLER_AUTO_START" envDefault:"false"`
CursorKey string `env:"CURSOR_KEY" envDefault:""`
}
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller is a chain-agnostic module for ETLing blockchain data, utilizing worker pools to optimize efficiency and speed
func New ¶
New constructs a new poller, given a config, a chain-specific driver, and a variadic array of options
Click to show internal directories.
Click to hide internal directories.