events

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 18 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(events *substrate.EventRecords)

type FileState

type FileState struct {
	// contains filtered or unexported fields
}

func (*FileState) Get

func (*FileState) Set

func (e *FileState) Set(num types.BlockNumber) error

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Events processor receives all events starting from the given state and for each set of events calls callback cb

func NewProcessor

func NewProcessor(sub substrate.Manager, cb Callback, state State) *Processor

func (*Processor) Start

func (e *Processor) Start(ctx context.Context)

type RedisConsumer

type RedisConsumer struct {
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(address, id string) (*RedisConsumer, error)

NewConsumer creates a new event consumer on given redis address, and consumer id, consumer id has to be unique

func (*RedisConsumer) ContractCancelled

func (r *RedisConsumer) ContractCancelled(ctx context.Context) (<-chan pkg.ContractCancelledEvent, error)

func (*RedisConsumer) ContractLocked

func (r *RedisConsumer) ContractLocked(ctx context.Context) (<-chan pkg.ContractLockedEvent, error)

func (*RedisConsumer) PowerTargetChange

func (r *RedisConsumer) PowerTargetChange(ctx context.Context) (<-chan pkg.PowerTargetChangeEvent, error)

func (*RedisConsumer) PublicConfig

func (r *RedisConsumer) PublicConfig(ctx context.Context) (<-chan pkg.PublicConfigEvent, error)

type RedisStream

type RedisStream struct {
	// contains filtered or unexported fields
}

func NewRedisStream

func NewRedisStream(sub substrate.Manager, address string, farm pkg.FarmID, node uint32, state string) (*RedisStream, error)

func (*RedisStream) Start

func (r *RedisStream) Start(ctx context.Context)

func (*RedisStream) UpdateSubstrateManager

func (r *RedisStream) UpdateSubstrateManager(sub substrate.Manager)

type State

type State interface {
	Set(num types.BlockNumber) error
	Get(cl *gsrpc.SubstrateAPI) (types.BlockNumber, error)
}

State is used to track the blocks already processed by the processor

func NewFileState

func NewFileState(path string) State

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL