Documentation ¶
Index ¶
- func AppendReceipts(tx ethdb.DbWithPendingMutations, blockNumber uint64, receipts types.Receipts) error
- func DeleteAccount(db DatabaseDeleter, addrHash common.Hash) error
- func DeleteBadBlocks(db ethdb.Database)
- func DeleteBlock(db ethdb.Database, hash common.Hash, number uint64) error
- func DeleteBlockWithoutNumber(db ethdb.Database, hash common.Hash, number uint64) error
- func DeleteBody(db DatabaseDeleter, hash common.Hash, number uint64)
- func DeleteCanonicalHash(db DatabaseDeleter, number uint64) error
- func DeleteHeader(db DatabaseDeleter, hash common.Hash, number uint64)
- func DeleteHeaderNumber(db DatabaseDeleter, hash common.Hash)
- func DeleteNewerReceipts(db ethdb.Database, number uint64) error
- func DeleteReceipts(db ethdb.Database, number uint64) error
- func DeleteTd(db DatabaseDeleter, hash common.Hash, number uint64) error
- func DeleteTxLookupEntry(db DatabaseDeleter, hash common.Hash) error
- func FindCommonAncestor(db databaseReader, a, b *types.Header) *types.Header
- func HasBody(db databaseReader, hash common.Hash, number uint64) bool
- func HasHeader(db databaseReader, hash common.Hash, number uint64) bool
- func HasReceipts(db databaseReader, hash common.Hash, number uint64) bool
- func PlainDeleteAccount(db DatabaseDeleter, address common.Address) error
- func PlainReadAccount(db databaseReader, address common.Address, acc *accounts.Account) (bool, error)
- func PlainWriteAccount(db DatabaseWriter, address common.Address, acc accounts.Account) error
- func PopUncleanShutdownMarker(db ethdb.Database)
- func PushUncleanShutdownMarker(db ethdb.Database) ([]uint64, uint64, error)
- func ReadAccount(db databaseReader, addrHash common.Hash, acc *accounts.Account) (bool, error)
- func ReadAllBadBlocks(db ethdb.Database) []*types.Block
- func ReadAllHashes(db databaseReader, number uint64) []common.Hash
- func ReadBadBlock(db ethdb.Database, hash common.Hash) *types.Block
- func ReadBlock(db ethdb.Database, hash common.Hash, number uint64) *types.Block
- func ReadBlockByHash(db ethdb.Database, hash common.Hash) (*types.Block, error)
- func ReadBlockByNumber(db ethdb.Database, number uint64) (*types.Block, error)
- func ReadBloomBits(db databaseReader, bit uint, section uint64, head common.Hash) ([]byte, error)
- func ReadBody(db ethdb.Database, hash common.Hash, number uint64) *types.Body
- func ReadBodyRLP(db ethdb.Database, hash common.Hash, number uint64) rlp.RawValue
- func ReadCanonicalHash(db databaseReader, number uint64) (common.Hash, error)
- func ReadChainConfig(db databaseReader, hash common.Hash) (*params.ChainConfig, error)
- func ReadDatabaseVersion(db databaseReader) *uint64
- func ReadFastTrieProgress(db databaseReader) uint64
- func ReadHeadBlockHash(db databaseReader) common.Hash
- func ReadHeadFastBlockHash(db databaseReader) common.Hash
- func ReadHeadHeaderHash(db databaseReader) common.Hash
- func ReadHeader(db databaseReader, hash common.Hash, number uint64) *types.Header
- func ReadHeaderByHash(db databaseReader, hash common.Hash) (*types.Header, error)
- func ReadHeaderByNumber(db databaseReader, number uint64) *types.Header
- func ReadHeaderNumber(db databaseReader, hash common.Hash) *uint64
- func ReadHeaderRLP(db databaseReader, hash common.Hash, number uint64) rlp.RawValue
- func ReadRawReceipts(db ethdb.Database, hash common.Hash, number uint64) types.Receipts
- func ReadReceipt(db ethdb.Database, hash common.Hash) (*types.Receipt, common.Hash, uint64, uint64)
- func ReadReceipts(db ethdb.Database, hash common.Hash, number uint64) types.Receipts
- func ReadSenders(db databaseReader, hash common.Hash, number uint64) ([]common.Address, error)
- func ReadStorageBodyRLP(db ethdb.Database, hash common.Hash, number uint64) rlp.RawValue
- func ReadTd(db databaseReader, hash common.Hash, number uint64) (*big.Int, error)
- func ReadTdRLP(db databaseReader, hash common.Hash, number uint64) rlp.RawValue
- func ReadTransaction(db ethdb.Database, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64)
- func ReadTransactions(db ethdb.Database, baseTxId uint64, amount uint32) ([]*types.Transaction, error)
- func ReadTxLookupEntry(db databaseReader, hash common.Hash) *uint64
- func WriteAccount(db DatabaseWriter, addrHash common.Hash, acc accounts.Account) error
- func WriteAncientBlock(db DatabaseWriter, block *types.Block, receipts types.Receipts, td *big.Int) int
- func WriteBadBlock(db ethdb.Database, block *types.Block)
- func WriteBlock(ctx context.Context, db ethdb.Database, block *types.Block) error
- func WriteBloomBits(db DatabaseWriter, bit uint, section uint64, head common.Hash, bits []byte)
- func WriteBody(db ethdb.Database, hash common.Hash, number uint64, body *types.Body) error
- func WriteBodyRLP(db DatabaseWriter, hash common.Hash, number uint64, rlp rlp.RawValue)
- func WriteCanonicalHash(db DatabaseWriter, hash common.Hash, number uint64) error
- func WriteChainConfig(db DatabaseWriter, hash common.Hash, cfg *params.ChainConfig) error
- func WriteDatabaseVersion(db DatabaseWriter, version uint64) error
- func WriteFastTrieProgress(db DatabaseWriter, count uint64)
- func WriteHeadBlockHash(db DatabaseWriter, hash common.Hash)
- func WriteHeadFastBlockHash(db DatabaseWriter, hash common.Hash)
- func WriteHeadHeaderHash(db DatabaseWriter, hash common.Hash) error
- func WriteHeader(ctx context.Context, db DatabaseWriter, header *types.Header)
- func WriteHeaderNumber(db DatabaseWriter, hash common.Hash, number uint64)
- func WriteReceipts(tx DatabaseWriter, number uint64, receipts types.Receipts) error
- func WriteSenders(ctx context.Context, db DatabaseWriter, hash common.Hash, number uint64, ...) error
- func WriteTd(db DatabaseWriter, hash common.Hash, number uint64, td *big.Int) error
- func WriteTransactions(db ethdb.Database, txs []*types.Transaction, baseTxId uint64) error
- func WriteTxLookupEntries(db DatabaseWriter, block *types.Block)
- type DatabaseDeleter
- type DatabaseWriter
- type TxLookupEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendReceipts ¶
func AppendReceipts(tx ethdb.DbWithPendingMutations, blockNumber uint64, receipts types.Receipts) error
WriteReceipts stores all the transaction receipts belonging to a block.
func DeleteAccount ¶
func DeleteAccount(db DatabaseDeleter, addrHash common.Hash) error
func DeleteBadBlocks ¶
DeleteBadBlocks deletes all the bad blocks from the database
func DeleteBlock ¶
DeleteBlock removes all block data associated with a hash.
func DeleteBlockWithoutNumber ¶
DeleteBlockWithoutNumber removes all block data associated with a hash, except the hash to number mapping.
func DeleteBody ¶
func DeleteBody(db DatabaseDeleter, hash common.Hash, number uint64)
DeleteBody removes all block body data associated with a hash.
func DeleteCanonicalHash ¶
func DeleteCanonicalHash(db DatabaseDeleter, number uint64) error
DeleteCanonicalHash removes the number to hash canonical mapping.
func DeleteHeader ¶
func DeleteHeader(db DatabaseDeleter, hash common.Hash, number uint64)
DeleteHeader removes all block header data associated with a hash.
func DeleteHeaderNumber ¶
func DeleteHeaderNumber(db DatabaseDeleter, hash common.Hash)
DeleteHeaderNumber removes hash->number mapping.
func DeleteNewerReceipts ¶
DeleteNewerReceipts removes all receipt for given block number or newer
func DeleteReceipts ¶
DeleteReceipts removes all receipt data associated with a block hash.
func DeleteTd ¶
func DeleteTd(db DatabaseDeleter, hash common.Hash, number uint64) error
DeleteTd removes all block total difficulty data associated with a hash.
func DeleteTxLookupEntry ¶
func DeleteTxLookupEntry(db DatabaseDeleter, hash common.Hash) error
DeleteTxLookupEntry removes all transaction data associated with a hash.
func FindCommonAncestor ¶
FindCommonAncestor returns the last common ancestor of two block headers
func HasReceipts ¶
HasReceipts verifies the existence of all the transaction receipts belonging to a block.
func PlainDeleteAccount ¶
func PlainDeleteAccount(db DatabaseDeleter, address common.Address) error
func PlainReadAccount ¶
func PlainWriteAccount ¶
func PopUncleanShutdownMarker ¶
PopUncleanShutdownMarker removes the last unclean shutdown marker
func PushUncleanShutdownMarker ¶
PushUncleanShutdownMarker appends a new unclean shutdown marker and returns the previous data - a list of timestamps - a count of how many old unclean-shutdowns have been discarded
func ReadAccount ¶
ReadAccount reading account object from multiple buckets of db
func ReadAllBadBlocks ¶
ReadAllBadBlocks retrieves all the bad blocks in the database. All returned blocks are sorted in reverse order by number.
func ReadAllHashes ¶
ReadAllHashes retrieves all the hashes assigned to blocks at a certain heights, both canonical and reorged forks included.
func ReadBadBlock ¶
ReadBadBlock retrieves the bad block with the corresponding block hash.
func ReadBlock ¶
ReadBlock retrieves an entire block corresponding to the hash, assembling it back from the stored header and body. If either the header or body could not be retrieved nil is returned.
Note, due to concurrent download of header and block body the header and thus canonical hash can be stored in the database but the body data not (yet).
func ReadBlockByHash ¶
func ReadBlockByNumber ¶
func ReadBloomBits ¶
ReadBloomBits retrieves the compressed bloom bit vector belonging to the given section and bit index from the.
func ReadBodyRLP ¶
ReadBodyRLP retrieves the block body (transactions and uncles) in RLP encoding.
func ReadCanonicalHash ¶
ReadCanonicalHash retrieves the hash assigned to a canonical block number.
func ReadChainConfig ¶
func ReadChainConfig(db databaseReader, hash common.Hash) (*params.ChainConfig, error)
ReadChainConfig retrieves the consensus settings based on the given genesis hash.
func ReadDatabaseVersion ¶
func ReadDatabaseVersion(db databaseReader) *uint64
ReadDatabaseVersion retrieves the version number of the database.
func ReadFastTrieProgress ¶
func ReadFastTrieProgress(db databaseReader) uint64
ReadFastTrieProgress retrieves the number of tries nodes fast synced to allow reporting correct numbers across restarts.
func ReadHeadBlockHash ¶
ReadHeadBlockHash retrieves the hash of the current canonical head block.
func ReadHeadFastBlockHash ¶
ReadHeadFastBlockHash retrieves the hash of the current fast-sync head block.
func ReadHeadHeaderHash ¶
ReadHeadHeaderHash retrieves the hash of the current canonical head header.
func ReadHeader ¶
ReadHeader retrieves the block header corresponding to the hash.
func ReadHeaderByHash ¶
func ReadHeaderByNumber ¶
func ReadHeaderNumber ¶
ReadHeaderNumber returns the header number assigned to a hash.
func ReadHeaderRLP ¶
ReadHeaderRLP retrieves a block header in its raw RLP database encoding.
func ReadRawReceipts ¶
ReadRawReceipts retrieves all the transaction receipts belonging to a block. The receipt metadata fields are not guaranteed to be populated, so they should not be used. Use ReadReceipts instead if the metadata is needed.
func ReadReceipt ¶
ReadReceipt retrieves a specific transaction receipt from the database, along with its added positional metadata.
func ReadReceipts ¶
ReadReceipts retrieves all the transaction receipts belonging to a block, including its correspoinding metadata fields. If it is unable to populate these metadata fields then nil is returned.
The current implementation populates these metadata fields by reading the receipts' corresponding block body, so if the block body is not found it will return nil even if the receipt itself is stored.
func ReadSenders ¶
func ReadStorageBodyRLP ¶
func ReadTdRLP ¶
ReadTdRLP retrieves a block's total difficulty corresponding to the hash in RLP encoding.
func ReadTransaction ¶
func ReadTransaction(db ethdb.Database, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64)
ReadTransaction retrieves a specific transaction from the database, along with its added positional metadata.
func ReadTransactions ¶
func ReadTxLookupEntry ¶
ReadTxLookupEntry retrieves the positional metadata associated with a transaction hash to allow retrieving the transaction or receipt by hash.
func WriteAccount ¶
func WriteAncientBlock ¶
func WriteAncientBlock(db DatabaseWriter, block *types.Block, receipts types.Receipts, td *big.Int) int
FIXME: implement in Turbo-Geth WriteAncientBlock writes entire block data into ancient store and returns the total written size.
func WriteBadBlock ¶
WriteBadBlock serializes the bad block into the database. If the cumulated bad blocks exceeds the limitation, the oldest will be dropped.
func WriteBlock ¶
WriteBlock serializes a block into the database, header and body separately.
func WriteBloomBits ¶
WriteBloomBits stores the compressed bloom bits vector belonging to the given section and bit index.
func WriteBody ¶
WriteBody - writes body in Network format, later staged sync will convert it into Storage format
func WriteBodyRLP ¶
WriteBodyRLP stores an RLP encoded block body into the database.
func WriteCanonicalHash ¶
func WriteCanonicalHash(db DatabaseWriter, hash common.Hash, number uint64) error
WriteCanonicalHash stores the hash assigned to a canonical block number.
func WriteChainConfig ¶
func WriteChainConfig(db DatabaseWriter, hash common.Hash, cfg *params.ChainConfig) error
WriteChainConfig writes the chain config settings to the database.
func WriteDatabaseVersion ¶
func WriteDatabaseVersion(db DatabaseWriter, version uint64) error
WriteDatabaseVersion stores the version number of the database
func WriteFastTrieProgress ¶
func WriteFastTrieProgress(db DatabaseWriter, count uint64)
WriteFastTrieProgress stores the fast sync trie process counter to support retrieving it across restarts.
func WriteHeadBlockHash ¶
func WriteHeadBlockHash(db DatabaseWriter, hash common.Hash)
WriteHeadBlockHash stores the head block's hash.
func WriteHeadFastBlockHash ¶
func WriteHeadFastBlockHash(db DatabaseWriter, hash common.Hash)
WriteHeadFastBlockHash stores the hash of the current fast-sync head block.
func WriteHeadHeaderHash ¶
func WriteHeadHeaderHash(db DatabaseWriter, hash common.Hash) error
WriteHeadHeaderHash stores the hash of the current canonical head header.
func WriteHeader ¶
func WriteHeader(ctx context.Context, db DatabaseWriter, header *types.Header)
WriteHeader stores a block header into the database and also stores the hash- to-number mapping.
func WriteHeaderNumber ¶
func WriteHeaderNumber(db DatabaseWriter, hash common.Hash, number uint64)
WriteHeaderNumber stores the hash->number mapping.
func WriteReceipts ¶
func WriteReceipts(tx DatabaseWriter, number uint64, receipts types.Receipts) error
WriteReceipts stores all the transaction receipts belonging to a block.
func WriteSenders ¶
func WriteTransactions ¶
func WriteTxLookupEntries ¶
func WriteTxLookupEntries(db DatabaseWriter, block *types.Block)
WriteTxLookupEntries stores a positional metadata for every transaction from a block, enabling hash based transaction and receipt lookups.
Types ¶
type DatabaseDeleter ¶
DatabaseDeleter wraps the Delete method of a backing data store.
type DatabaseWriter ¶
DatabaseWriter wraps the Put method of a backing data store.