synchronizer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSynchronizer

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

BatchSynchronizer watches for batch events, checks if they are "locally" stored, then retrieves and stores missing data

func NewBatchSynchronizer

func NewBatchSynchronizer(
	cfg config.L1Config,
	self common.Address,
	db *db.DB,
	reorgs <-chan BlockReorg,
	ethClient *etherman.Etherman,
) (*BatchSynchronizer, error)

NewBatchSynchronizer creates the BatchSynchronizer

func (*BatchSynchronizer) Start

func (bs *BatchSynchronizer) Start()

Start starts the synchronizer

func (*BatchSynchronizer) Stop

func (bs *BatchSynchronizer) Stop()

Stop stops the synchronizer

type BlockReorg

type BlockReorg struct {
	Number uint64
	Hash   ethgo.Hash
}

BlockReorg is emitted to subscribers when a reorg is detected. Number is the block to which the chain rewound.

type ReorgDetector

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

ReorgDetector watches for block reorganizations on chain, and sends messages to subscribing components when a reorg is detected.

func NewReorgDetector

func NewReorgDetector(rpcUrl string, pollingPeriod time.Duration) (*ReorgDetector, error)

NewReorgDetector creates a new ReorgDetector

func (*ReorgDetector) Start

func (rd *ReorgDetector) Start() error

Start starts the ReorgDetector tracking for reorg events

func (*ReorgDetector) Stop

func (rd *ReorgDetector) Stop()

Stop stops the chain reorganization detector loop

func (*ReorgDetector) Subscribe

func (rd *ReorgDetector) Subscribe() <-chan BlockReorg

Subscribe returns a channel on which the caller can receive reorg messages

type SequencerTracker

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

SequencerTracker watches the contract for relevant changes to the sequencer

func NewSequencerTracker

func NewSequencerTracker(cfg config.L1Config, ethClient *etherman.Etherman) (*SequencerTracker, error)

NewSequencerTracker creates a new SequencerTracker

func (*SequencerTracker) GetAddr

func (st *SequencerTracker) GetAddr() common.Address

GetAddr returns the last known address of the Sequencer

func (*SequencerTracker) Start

func (st *SequencerTracker) Start()

Start starts the SequencerTracker

func (*SequencerTracker) Stop

func (st *SequencerTracker) Stop()

Stop stops the SequencerTracker

Jump to

Keyboard shortcuts

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