monitor

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MonitorTick

func MonitorTick(ctx context.Context, cf context.CancelFunc, eth layer1.Client, allContracts layer1.AllSmartContracts, monitorState *objects.MonitorState, logger *logrus.Entry,
	eventMap *objects.EventMap, adminHandler interfaces.AdminHandler, batchSize uint64, filterContracts []common.Address,
) error

MonitorTick using existing monitorState and incrementally updates it based on current State of Ethereum endpoint.

func NewMonitor

func NewMonitor(cdb *db.Database,
	monDB *db.Database,
	adminHandler interfaces.AdminHandler,
	depositHandler interfaces.DepositHandler,
	eth layer1.Client,
	contracts layer1.AllSmartContracts,
	eventFilterAddresses []common.Address,
	tickInterval time.Duration,
	batchSize uint64,
	chainId uint32,
	taskHandler executor.TaskHandler,
) (*monitor, error)

NewMonitor creates a new Monitor.

func PersistSnapshot

func PersistSnapshot(eth layer1.Client, bh *objs.BlockHeader, numOfValidators int, validatorIndex int, taskHandler executor.TaskHandler, monDB *db.Database) error

PersistSnapshot should be registered as a callback and be kicked off automatically by badger when appropriate

func ProcessEvents

func ProcessEvents(eth layer1.Client, contracts layer1.AllSmartContracts, monitorState *objects.MonitorState, logs []types.Log, logger *logrus.Entry, currentBlock uint64, eventMap *objects.EventMap) (uint64, error)

ProcessEvents returned from layer1 chain.

Types

type Monitor

type Monitor interface {
	Start() error
	Close()
	GetStatus() <-chan string
}

Monitor describes required functionality to monitor Ethereum.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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