Help us shape the future of Go! Take the 2026 Go Developer Survey

storage

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DataVersionCurrent is the current data version
	DataVersionCurrent = 1
)
View Source
const SqliteBoolFalse = 0
View Source
const SqliteBoolTrue = 1

Variables

This section is empty.

Functions

func NewBlockRowFromEthLog

func NewBlockRowFromEthLog(log types.Log, isFinal bool) *blockRow

func NewBlockRowsFromAggkitBlock

func NewBlockRowsFromAggkitBlock(blockHeaders aggkittypes.ListBlockHeaders, isFinal bool) map[uint64]*blockRow

func NewBlockRowsFromLogs

func NewBlockRowsFromLogs(logs []types.Log, isFinal bool) map[uint64]*blockRow

func NewLogRowFromEthLog

func NewLogRowFromEthLog(log types.Log) *logRow

func NewLogRowsFromEthLogs

func NewLogRowsFromEthLogs(logs []types.Log) []*logRow

Types

type Blocks

type Blocks struct {
	Headers  map[uint64]*aggkittypes.BlockHeader
	AreFinal map[uint64]bool
}

func NewBlocks

func NewBlocks() Blocks

func (*Blocks) Add

func (b *Blocks) Add(header *aggkittypes.BlockHeader, isFinal bool)

func (*Blocks) Get

func (b *Blocks) Get(number uint64) (*aggkittypes.BlockHeader, bool, error)

func (*Blocks) IsEmpty

func (b *Blocks) IsEmpty() bool

func (*Blocks) Len added in v0.10.0

func (b *Blocks) Len() int

func (*Blocks) ListHeaders

func (b *Blocks) ListHeaders() aggkittypes.ListBlockHeaders

type DBRuntimeData

type DBRuntimeData struct {
	NetworkID   uint64
	DataVersion int
}

func (DBRuntimeData) IsCompatible

func (r DBRuntimeData) IsCompatible(storage DBRuntimeData) (*DBRuntimeData, error)

func (DBRuntimeData) String

func (r DBRuntimeData) String() string

type MultidownloaderStorage

type MultidownloaderStorage struct {
	dbtypes.KeyValueStorager
	// contains filtered or unexported fields
}

func (*MultidownloaderStorage) GetBlockHeaderByNumber

func (a *MultidownloaderStorage) GetBlockHeaderByNumber(tx dbtypes.Querier,
	blockNumber uint64) (*aggkittypes.BlockHeader, mdtypes.FinalizedType, error)

func (*MultidownloaderStorage) GetBlockHeadersNotFinalized added in v0.10.0

func (a *MultidownloaderStorage) GetBlockHeadersNotFinalized(tx dbtypes.Querier,
	maxBlock *uint64) (aggkittypes.ListBlockHeaders, error)

GetBlockHeadersNotFinalized retrieves all block headers that are not finalized <= maxBlock if maxBlock is 0, retrieves all not finalized blocks

func (*MultidownloaderStorage) GetBlockReorgedReorgID added in v0.10.0

func (a *MultidownloaderStorage) GetBlockReorgedReorgID(tx dbtypes.Querier,
	blockNumber uint64, blockHash common.Hash) (uint64, bool, error)

func (*MultidownloaderStorage) GetEthLogs

func (a *MultidownloaderStorage) GetEthLogs(tx dbtypes.Querier, query mdrtypes.LogQuery) ([]types.Log, error)

func (*MultidownloaderStorage) GetHighestBlockNumber added in v0.10.0

func (a *MultidownloaderStorage) GetHighestBlockNumber(tx dbtypes.Querier) (uint64, error)

func (*MultidownloaderStorage) GetRangeBlockHeader added in v0.10.0

GetRangeBlockHeader retrieves the lowest and highest block headers stored in the database for the specified finality type. Returns lowest and highest block headers.

func (*MultidownloaderStorage) GetReorgedDataByReorgID added in v0.10.0

func (a *MultidownloaderStorage) GetReorgedDataByReorgID(tx dbtypes.Querier,
	reorgID uint64) (*mdrtypes.ReorgData, error)

func (*MultidownloaderStorage) GetSyncedBlockRangePerContract

func (a *MultidownloaderStorage) GetSyncedBlockRangePerContract(tx dbtypes.Querier) (mdrtypes.SetSyncSegment, error)

func (*MultidownloaderStorage) InsertReorgAndMoveReorgedBlocksAndLogs added in v0.10.0

func (a *MultidownloaderStorage) InsertReorgAndMoveReorgedBlocksAndLogs(tx dbtypes.Querier,
	reorgData mdrtypes.ReorgData) (uint64, error)

returns ReorgID of the inserted reorg

func (*MultidownloaderStorage) LogQuery added in v0.10.0

func (*MultidownloaderStorage) NewTx

func (*MultidownloaderStorage) SaveEthLogs

func (a *MultidownloaderStorage) SaveEthLogs(tx dbtypes.Querier, logs []types.Log, isFinal bool) error

tx dbtypes.Txer

func (*MultidownloaderStorage) SaveEthLogsWithHeaders

func (a *MultidownloaderStorage) SaveEthLogsWithHeaders(tx dbtypes.Querier,
	blockHeaders aggkittypes.ListBlockHeaders, logs []types.Log, isFinal bool) error

func (*MultidownloaderStorage) UpdateBlockToFinalized added in v0.10.0

func (a *MultidownloaderStorage) UpdateBlockToFinalized(tx dbtypes.Querier, blockNumbers []uint64) error

func (*MultidownloaderStorage) UpdateSyncedStatus

func (a *MultidownloaderStorage) UpdateSyncedStatus(tx dbtypes.Querier,
	segments []mdrtypes.SyncSegment) error

func (*MultidownloaderStorage) UpsertSyncerConfigs

func (a *MultidownloaderStorage) UpsertSyncerConfigs(tx dbtypes.Querier, configs []mdrtypes.ContractConfig) error

type MultidownloaderStorageConfig

type MultidownloaderStorageConfig struct {
	DBPath string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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