etl

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricsNamespace string = "op_indexer_etl"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	LoopIntervalMsec uint
	HeaderBufferSize uint

	// Applicable only to the L1 ETL (all L2 block are indexed)
	AllowedInactivityWindowSeconds uint

	StartHeight       *big.Int
	ConfirmationDepth *big.Int
}

type ETL

type ETL struct {
	EthClient node.EthClient
	// contains filtered or unexported fields
}

func (*ETL) Close added in v1.4.2

func (etl *ETL) Close() error

func (*ETL) Start

func (etl *ETL) Start() error

Start starts the ETL polling routine. The ETL work should be stopped with Close().

type ETLBatch

type ETLBatch struct {
	Logger log.Logger

	Headers   []types.Header
	HeaderMap map[common.Hash]*types.Header

	Logs           []types.Log
	HeadersWithLog map[common.Hash]bool
}

type L1ETL

type L1ETL struct {
	ETL
	// contains filtered or unexported fields
}

func NewL1ETL

func NewL1ETL(cfg Config, log log.Logger, db *database.DB, metrics Metricer, client node.EthClient,
	contracts config.L1Contracts, shutdown context.CancelCauseFunc) (*L1ETL, error)

NewL1ETL creates a new L1ETL instance that will start indexing from different starting points depending on the state of the database and the supplied start height.

func (*L1ETL) Close added in v1.4.2

func (l1Etl *L1ETL) Close() error

func (*L1ETL) Notify

func (l1Etl *L1ETL) Notify() <-chan *types.Header

Notify returns a channel that'll receive the latest header when new data has been persisted

func (*L1ETL) Start

func (l1Etl *L1ETL) Start() error

type L2ETL

type L2ETL struct {
	ETL
	// contains filtered or unexported fields
}

func NewL2ETL

func NewL2ETL(cfg Config, log log.Logger, db *database.DB, metrics Metricer, client node.EthClient,
	contracts config.L2Contracts, shutdown context.CancelCauseFunc) (*L2ETL, error)

func (*L2ETL) Close added in v1.4.2

func (l2Etl *L2ETL) Close() error

func (*L2ETL) Notify added in v1.4.2

func (l2Etl *L2ETL) Notify() <-chan *types.Header

Notify returns a channel that'll receive the latest header when new data has been persisted

func (*L2ETL) Start

func (l2Etl *L2ETL) Start() error

type Metricer

type Metricer interface {
	RecordInterval() (done func(err error))
	RecordLatestHeight(height *big.Int)

	RecordEtlLatestHeight(height *big.Int)
	RecordIndexedHeaders(size int)
	RecordIndexedLog(contractAddress common.Address)
}

func NewMetrics

func NewMetrics(registry *prometheus.Registry, subsystem string) Metricer

Jump to

Keyboard shortcuts

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