ethereum

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxRetries int                  `env:"HTTP_MAX_RETRIES" envDefault:"5"`
	Blockchain constants.Blockchain `env:"BLOCKCHAIN,required"`
}

Config stores configurable properties of the driver

func MustParseConfig

func MustParseConfig(logger util.Logger) *Config

MustParseConfig uses env.Parse to initialize config with environment variables

type Driver

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

Driver is the container for all ETL business logic

func NewDriver

func NewDriver(cfg *Config, nodeClient nodeClient.Client, logger util.Logger, metrics util.Metrics, cursor uint64) (*Driver, error)

NewDriver constructs a new Driver

func (*Driver) Accumulate

func (d *Driver) Accumulate(res interface{}) pool.Runner

Accumulate combines ABI and metadata to form complete contracts and fragments using result from the "fetch" step

func (*Driver) Blockchain

func (d *Driver) Blockchain() string

Blockchain returns the name of the blockchain

func (*Driver) Delete

func (d *Driver) Delete(object interface{}, model interface{}) error

func (*Driver) FetchABI

func (d *Driver) FetchABI(ctx context.Context, deployments []string) (map[string]*models.Contract, error)

func (*Driver) FetchMetadata

func (d *Driver) FetchMetadata(ctx context.Context, deployments []string, blockNumber uint64) (map[string]*models.Contract, error)

func (*Driver) FetchSequence

func (d *Driver) FetchSequence(blockHeight uint64) map[string]pool.Runner

FetchSequence defines the parallelizable steps in the fetch sequence

func (*Driver) Fetchers

func (d *Driver) Fetchers() map[string]pool.FeedTransformer

func (*Driver) Find

func (d *Driver) Find(object interface{}, model interface{}) ([]interface{}, error)

func (*Driver) GetChainTipNumber

func (d *Driver) GetChainTipNumber(ctx context.Context) (uint64, error)

GetChainTipNumber gets the block number of the chaintip

func (*Driver) Upsert

func (d *Driver) Upsert(object interface{}, model interface{}) error

func (*Driver) UpsertBatch

func (d *Driver) UpsertBatch(objects []interface{}, model interface{}) error

func (*Driver) Writers

func (d *Driver) Writers() []pool.FeedTransformer

Writers defines a set of parallelizable write steps for processing contracts, method fragments, event fragments

Jump to

Keyboard shortcuts

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