events

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

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)

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