syncer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	logger logging.Logger,
	ev BlockHeightContractFilterer,
	blockTime uint64,
	shutdowner Shutdowner,
) *service

Types

type BlockHeightContractFilterer

type BlockHeightContractFilterer interface {
	bind.ContractFilterer
	BlockNumber(context.Context) (uint64, error)
}

type EventUpdater

type EventUpdater interface {
	ProcessEvent(e types.Log) error
	UpdateBlockNumber(blockNumber uint64) error
	TransactionStart() error
	TransactionEnd() error
}

type Service

type Service interface {
	AddSync(sync *Sync)
	Worker() <-chan struct{}
}

type Shutdowner

type Shutdowner interface {
	Shutdown(context.Context) error
}

type Sync

type Sync struct {
	From       uint64
	Updater    EventUpdater
	FilterLogs func(from, to *big.Int) ethereum.FilterQuery
}

Jump to

Keyboard shortcuts

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