Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type All ¶
type All struct {
BlockReader FullBlockReader
}
type BlockAndTxnReader ¶
type BlockAndTxnReader interface {
BlockReader
//HeaderReader
TxnReader
}
type BlockReader ¶
type BlockReader interface {
BlockByNumber(ctx context.Context, db kv.Tx, number uint64) (*types.Block, error)
BlockByHash(ctx context.Context, db kv.Tx, hash common.Hash) (*types.Block, error)
CurrentBlock(db kv.Tx) (*types.Block, error)
BlockWithSenders(ctx context.Context, tx kv.Getter, hash common.Hash, blockNum uint64) (block *types.Block, senders []common.Address, err error)
}
type BlockRetire ¶
type BlockRetire interface {
PruneAncientBlocks(tx kv.RwTx, limit int, includeBor bool) error
RetireBlocksInBackground(ctx context.Context, maxBlockNumInDB uint64, includeBor bool, lvl log.Lvl, seedNewSnapshots func(downloadRequest []DownloadRequest) error, onDelete func(l []string) error)
HasNewFrozenFiles() bool
BuildMissedIndicesIfNeed(ctx context.Context, logPrefix string, notifier DBEventNotifier, cc *chain.Config) error
}
BlockRetire - freezing blocks: moving old data from DB to snapshot files
type BlockSnapshots ¶
type BodyReader ¶
type BodyReader interface {
BodyWithTransactions(ctx context.Context, tx kv.Getter, hash common.Hash, blockNum uint64) (body *types.Body, err error)
BodyRlp(ctx context.Context, tx kv.Getter, hash common.Hash, blockNum uint64) (bodyRlp rlp.RawValue, err error)
Body(ctx context.Context, tx kv.Getter, hash common.Hash, blockNum uint64) (body *types.Body, txAmount uint32, err error)
HasSenders(ctx context.Context, tx kv.Getter, hash common.Hash, blockNum uint64) (bool, error)
}
type BorEventReader ¶
type BorSpanReader ¶
type CanonicalReader ¶
type DBEventNotifier ¶
type DBEventNotifier interface {
OnNewSnapshot()
}
type DownloadRequest ¶
func NewDownloadRequest ¶
func NewDownloadRequest(ranges *Range, path string, torrentHash string, bor bool) DownloadRequest
type FullBlockReader ¶
type FullBlockReader interface {
BlockReader
BodyReader
HeaderReader
BorEventReader
BorSpanReader
TxnReader
CanonicalReader
FrozenBlocks() uint64
FrozenBorBlocks() uint64
FrozenFiles() (list []string)
FreezingCfg() ethconfig.BlocksFreezing
CanPruneTo(currentBlockInDB uint64) (canPruneBlocksTo uint64)
Snapshots() BlockSnapshots
BorSnapshots() BlockSnapshots
}
type HeaderAndCanonicalReader ¶
type HeaderAndCanonicalReader interface {
HeaderReader
CanonicalReader
}
type HeaderReader ¶
type HeaderReader interface {
Header(ctx context.Context, tx kv.Getter, hash common.Hash, blockNum uint64) (*types.Header, error)
HeaderByNumber(ctx context.Context, tx kv.Getter, blockNum uint64) (*types.Header, error)
HeaderByHash(ctx context.Context, tx kv.Getter, hash common.Hash) (*types.Header, error)
ReadAncestor(db kv.Getter, hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64)
//TODO: change it to `iter`
HeadersRange(ctx context.Context, walker func(header *types.Header) error) error
}
type TxnReader ¶
type TxnReader interface {
TxnLookup(ctx context.Context, tx kv.Getter, txnHash common.Hash) (uint64, bool, error)
TxnByIdxInBlock(ctx context.Context, tx kv.Getter, blockNum uint64, i int) (txn types.Transaction, err error)
RawTransactions(ctx context.Context, tx kv.Getter, fromBlock, toBlock uint64) (txs [][]byte, err error)
}
Click to show internal directories.
Click to hide internal directories.