Documentation
¶
Index ¶
- func ProtoBlockToParquet(in *protos.Block) *model.ParquetBlock
- func ProtoLogToParquet(in *protos.Log) *model.ParquetLog
- func ProtoTraceToParquet(inTrace *protos.CallTrace, inTransaction *protos.Transaction, hash string, ...) *model.ParquetTrace
- func ProtoTransactionToParquet(inTx *protos.Transaction, inReceipt *protos.TransactionReceipt) (*model.ParquetTransaction, error)
- type Config
- type OptimismDriver
- func (d *OptimismDriver) Accumulate(res interface{}) pool.Runner
- func (d *OptimismDriver) Blockchain() string
- func (d *OptimismDriver) FetchSequence(blockHeight uint64) map[string]pool.Runner
- func (d *OptimismDriver) GetChainTipNumber(ctx context.Context) (uint64, error)
- func (d *OptimismDriver) IsValidBlock(ctx context.Context, index uint64) error
- func (d *OptimismDriver) Writers() []pool.FeedTransformer
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 ¶
MustParseConfig uses env.Parse to initialize config with environment variables
type OptimismDriver ¶
type OptimismDriver struct {
// contains filtered or unexported fields
}
OptimismDriver is the container for all ETL business logic
func New ¶
func New(cfg *Config, nodeClient nodeClient.Client, innerStore storage.Store, logger util.Logger) *OptimismDriver
New constructs a new OptimismDriver
func (*OptimismDriver) Accumulate ¶
func (d *OptimismDriver) 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 (*OptimismDriver) Blockchain ¶
func (d *OptimismDriver) Blockchain() string
Blockchain returns the name of the blockchain
func (*OptimismDriver) FetchSequence ¶
func (d *OptimismDriver) FetchSequence(blockHeight uint64) map[string]pool.Runner
FetchSequence defines the parallelizable steps in the fetch sequence
func (*OptimismDriver) GetChainTipNumber ¶
func (d *OptimismDriver) GetChainTipNumber(ctx context.Context) (uint64, error)
GetChainTipNumber gets the block number of the chaintip
func (*OptimismDriver) IsValidBlock ¶
func (d *OptimismDriver) IsValidBlock(ctx context.Context, index uint64) error
IsValidBlock checks the given block's parent hash against the hash of the previous block
func (*OptimismDriver) Writers ¶
func (d *OptimismDriver) Writers() []pool.FeedTransformer
Writers defines a set of parallelizable write steps for processing a block and its children