binance

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoBlockToParquet

func ProtoBlockToParquet(in *protos.Block) *model.ParquetBlock

ProtoBlockToParquet converts a block proto to parquet

func ProtoLogToParquet

func ProtoLogToParquet(in *protos.Log) *model.ParquetLog

ProtoLogToParquet converts a log proto to parquet

func ProtoTraceToParquet

func ProtoTraceToParquet(inTrace *protos.CallTrace, inTransaction *protos.Transaction, hash string, parentHash string, index int64) *model.ParquetTrace

ProtoTraceToParquet converts a trace proto to parquet, given a trace, a transaction, and other supplemental data

func ProtoTransactionToParquet

func ProtoTransactionToParquet(inTx *protos.Transaction, inReceipt *protos.TransactionReceipt) (*model.ParquetTransaction, error)

ProtoTransactionToParquet converts a transaction proto to parquet, given a transaction and receipt

Types

type Config

type Config struct {
	MaxRetries     int    `env:"HTTP_MAX_RETRIES" envDefault:"10"`
	DirectoryRange uint64 `env:"BUCKET_DIRECTORY_RANGE" envDefault:"10000"`
}

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, innerStore storage.Store, logger util.Logger) *Driver

NewDriver constructs a new Driver

func (*Driver) Accumulate

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

Accumulate combines a block, receipts, and traces from multiple protos into a single object, given a generic result from the "fetch" step

func (*Driver) Blockchain

func (d *Driver) Blockchain() string

Blockchain returns the name of the blockchain

func (*Driver) FetchSequence

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

FetchSequence defines the parallelizable steps in the fetch sequence

func (*Driver) GetChainTipNumber

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

GetChainTipNumber gets the block number of the chaintip

func (*Driver) IsValidBlock

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

IsValidBlock checks the given block's parent hash against the hash of the previous block

func (*Driver) Writers

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

Writers defines a set of parallelizable write steps for processing a block and its children

Jump to

Keyboard shortcuts

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