types

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeadBroadcaster

type HeadBroadcaster interface {
	service.Service
	HeadTrackable
	Subscribe(callback HeadTrackable) (unsubscribe func())
}

HeadBroadcaster is the external interface of headBroadcaster

type HeadBroadcasterRegistry

type HeadBroadcasterRegistry interface {
	Subscribe(callback HeadTrackable) (unsubscribe func())
}

type HeadTrackable

type HeadTrackable interface {
	Connect(head *models.Head) error
	OnNewLongestChain(ctx context.Context, head models.Head)
}

HeadTrackable represents any object that wishes to respond to ethereum events, after being subscribed to HeadBroadcaster

type HeadTrackableCallback

type HeadTrackableCallback struct {
	OnConnect func() error
}

HeadTrackableCallback is a simple wrapper around an On Connect callback

func (*HeadTrackableCallback) Connect

func (c *HeadTrackableCallback) Connect(*models.Head) error

func (*HeadTrackableCallback) OnNewLongestChain

func (c *HeadTrackableCallback) OnNewLongestChain(context.Context, models.Head)

type Tracker

type Tracker interface {
	HighestSeenHeadFromDB() (*models.Head, error)
	Start() error
	Stop() error
	SetLogger(logger *logger.Logger)
}

Jump to

Keyboard shortcuts

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