Help us shape the future of Go! Take the 2026 Go Developer Survey

blocknotifier

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AutomaticBlockInterval = time.Second * 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockNotifierManager

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

BlockNotifierManager manages multiple BlockNotifiers for different finality types. implements BlockNotifierGetter interface.

func (*BlockNotifierManager) GetBlockNotifier

TODO: You must only have real blockNotifiers for latest, safe, finalized... the rest (that are offsets) must use the principal ones to reduce the numbers of RPC requests and goroutines

func (*BlockNotifierManager) GetCurrentBlockNumber

func (bnm *BlockNotifierManager) GetCurrentBlockNumber(ctx context.Context,
	blockFinality aggkittypes.BlockNumberFinality) (uint64, error)

type BlockNotifierPolling

type BlockNotifierPolling struct {
	aggkitcommon.PubSub[ethmantypes.EventNewBlock]
	// contains filtered or unexported fields
}

func NewBlockNotifierPolling

NewBlockNotifierPolling creates a new BlockNotifierPolling. if param `subscriber` is nil a new GenericSubscriber[types.EventNewBlock] will be created. To use this class you need to subscribe and each time that a new block appear the subscriber will be notified through the channel. (check unit tests TestExploratoryBlockNotifierPolling for more information)

func (*BlockNotifierPolling) GetCurrentBlockNumber

func (b *BlockNotifierPolling) GetCurrentBlockNumber() uint64

func (*BlockNotifierPolling) Initialize

func (b *BlockNotifierPolling) Initialize(ctx context.Context) error

func (*BlockNotifierPolling) Start

func (b *BlockNotifierPolling) Start(ctx context.Context)

Start starts the BlockNotifierPolling blocking the current goroutine

func (*BlockNotifierPolling) String

func (b *BlockNotifierPolling) String() string

type ConfigBlockNotifierPolling

type ConfigBlockNotifierPolling struct {
	// BlockFinalityType is the finality of the block to be notified
	BlockFinalityType aggkittypes.BlockNumberFinality
	// CheckNewBlockInterval is the interval at which the AggSender will check for new blocks
	// if is 0 it will be calculated automatically
	CheckNewBlockInterval time.Duration
}

Jump to

Keyboard shortcuts

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