store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchWriteOption

type BatchWriteOption struct {
	WriteOption `mapstructure:",squash"`

	BatchSize    int           `default:"100"`
	BatchTimeout time.Duration `default:"3s"`
}

type BatchWriter

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

BatchWriter is used in poll-and-process model.

func NewBatchWriter

func NewBatchWriter(store Writable, option BatchWriteOption) *BatchWriter

func (*BatchWriter) OnCatchedUp

func (writer *BatchWriter) OnCatchedUp(ctx context.Context)

Process implements process.CatchUpProcessor[evm.BlockData] interface.

func (*BatchWriter) Process

func (writer *BatchWriter) Process(ctx context.Context, data evm.BlockData)

Process implements process.CatchUpProcessor[evm.BlockData] interface.

type Readable

type Readable interface {
	// block
	GetBlockNumber(bhon types.BlockHashOrNumber) (uint64, bool, error)
	GetBlock(bhon types.BlockHashOrNumber, isFull bool) (types.Lazy[*ethTypes.Block], error)
	GetBlockTransactionCount(bhon types.BlockHashOrNumber) (int64, error)

	// transaction
	GetTransactionByHash(txHash common.Hash) (*ethTypes.TransactionDetail, error)
	GetTransactionByIndex(bhon types.BlockHashOrNumber, txIndex uint32) (*ethTypes.TransactionDetail, error)

	// receipt
	GetTransactionReceipt(txHash common.Hash) (*ethTypes.Receipt, error)
	GetBlockReceipts(bhon types.BlockHashOrNumber) (types.Lazy[[]ethTypes.Receipt], error)

	// trace
	GetTrace(txHash common.Hash, index uint) (*ethTypes.LocalizedTrace, error)
	GetTransactionTraces(txHash common.Hash) ([]ethTypes.LocalizedTrace, error)
	GetBlockTraces(bhon types.BlockHashOrNumber) (types.Lazy[[]ethTypes.LocalizedTrace], error)
}

type Store

type Store interface {
	Writable
	Readable

	Close() error
}

type Writable

type Writable interface {
	NextBlockNumber() uint64
	Write(...evm.BlockData) error
}

type WriteOption

type WriteOption struct {
	RetryInterval time.Duration `default:"3s"`

	Health health.TimedCounterConfig
}

type Writer

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

Writer is used in poll-and-process model.

func NewWriter

func NewWriter(store Writable, option WriteOption) *Writer

func (*Writer) Process

func (writer *Writer) Process(ctx context.Context, data evm.BlockData)

Process implements process.Processor[evm.BlockData] interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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