events

package
v0.0.0-...-663aea3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultHeadListenerSubscriptionError

func NewDefaultHeadListenerSubscriptionError(err error) error

NewDefaultHeadListenerSubscriptionError is raised when the DefaultHeadListener fails to subscribe to new head events via its client.BeaconAPI.

Types

type DefaultHeadListener

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

DefaultHeadListener is the implementation of the HeadListener for agate, using the client.BeaconAPI as a way to listen for new heads.

func NewDefaultHeadListener

func NewDefaultHeadListener() *DefaultHeadListener

NewDefaultHeadListener creates an empty and non-initialized DefaultHeadListener.

func (*DefaultHeadListener) Init

func (listener *DefaultHeadListener) Init(beaconAPIClient client.BeaconAPI)

Init initializes a new DefaultHeadListener using a client.BeaconAPI to listen to new head events.

func (*DefaultHeadListener) Listen

func (listener *DefaultHeadListener) Listen(
	ctx context.Context,
	headEvents chan<- *v1.HeadEvent,
) error

type HeadListener

type HeadListener interface {
	// Listen starts the listening process in the background and populates the headEvents channel
	// with new head events as they arrive.
	Listen(ctx context.Context, headEvents chan<- *v1.HeadEvent) error
}

HeadListener is used to listen to head events on the Ethereum beacon chain.

Jump to

Keyboard shortcuts

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