Documentation
¶
Index ¶
- Variables
- type Config
- type LimiterConfig
- type Manager
- func (s *Manager) GetHeadDistance(ctx context.Context, processor, network, mode string, executionHead *big.Int) (distance int64, headType string, err error)
- func (s *Manager) GetMinMaxStoredBlocks(ctx context.Context, network, processor string) (minBlock, maxBlock *big.Int, err error)
- func (s *Manager) IsBlockRecentlyProcessed(ctx context.Context, blockNumber uint64, network, processor string, ...) (bool, error)
- func (s *Manager) MarkBlockProcessed(ctx context.Context, blockNumber uint64, network, processor string) error
- func (s *Manager) NextBlock(ctx context.Context, processor, network, mode string, chainHead *big.Int) (*big.Int, error)
- func (s *Manager) SetNetwork(network string)
- func (s *Manager) Start(ctx context.Context) error
- func (s *Manager) Stop(ctx context.Context) error
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoMoreBlocks = errors.New("no more blocks to process")
)
Sentinel errors
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Storage StorageConfig `yaml:"storage"`
Limiter LimiterConfig `yaml:"limiter"`
}
type LimiterConfig ¶
type LimiterConfig struct {
Enabled bool `yaml:"enabled"`
clickhouse.Config `yaml:",inline"`
Table string `yaml:"table"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) GetHeadDistance ¶ added in v0.0.8
func (s *Manager) GetHeadDistance(ctx context.Context, processor, network, mode string, executionHead *big.Int) (distance int64, headType string, err error)
GetHeadDistance calculates the distance between current processing block and the relevant head
func (*Manager) GetMinMaxStoredBlocks ¶ added in v0.0.5
func (*Manager) IsBlockRecentlyProcessed ¶ added in v0.0.8
func (s *Manager) IsBlockRecentlyProcessed(ctx context.Context, blockNumber uint64, network, processor string, withinSeconds int) (bool, error)
IsBlockRecentlyProcessed checks if a block was processed within the specified number of seconds
func (*Manager) MarkBlockProcessed ¶
func (*Manager) SetNetwork ¶ added in v0.0.5
SetNetwork sets the network name for metrics labeling
type StorageConfig ¶
type StorageConfig struct {
clickhouse.Config `yaml:",inline"`
Table string `yaml:"table"`
}
Click to show internal directories.
Click to hide internal directories.