Documentation
¶
Index ¶
- Variables
- type Config
- type JSONInt
- type JSONInt64
- type JSONUint64
- 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 ¶
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 JSONInt ¶ added in v0.1.1
type JSONInt int
JSONInt handles JSON numbers that might be strings or numbers.
func (JSONInt) MarshalJSON ¶ added in v0.1.1
MarshalJSON implements json.Marshaler.
func (*JSONInt) UnmarshalJSON ¶ added in v0.1.1
UnmarshalJSON implements json.Unmarshaler.
type JSONInt64 ¶ added in v0.1.1
type JSONInt64 int64
JSONInt64 handles JSON numbers that might be strings or numbers.
func (JSONInt64) MarshalJSON ¶ added in v0.1.1
MarshalJSON implements json.Marshaler.
func (*JSONInt64) UnmarshalJSON ¶ added in v0.1.1
UnmarshalJSON implements json.Unmarshaler.
type JSONUint64 ¶ added in v0.1.1
type JSONUint64 uint64
JSONUint64 handles JSON numbers that might be strings or numbers (unsigned).
func (JSONUint64) MarshalJSON ¶ added in v0.1.1
func (j JSONUint64) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (JSONUint64) Uint64 ¶ added in v0.1.1
func (j JSONUint64) Uint64() uint64
Uint64 returns the value as uint64.
func (*JSONUint64) UnmarshalJSON ¶ added in v0.1.1
func (j *JSONUint64) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
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.4
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"`
}