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.
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 WriteOption ¶
type WriteOption struct {
RetryInterval time.Duration `default:"3s"`
Health health.TimedCounterConfig
}
Click to show internal directories.
Click to hide internal directories.