Versions in this module Expand all Collapse all v1 v1.0.0 Jun 26, 2019 Changes in this version + const IdealBatchSize + const MinOpenFilesCacheCapacity + var BloomBitsIndexPrefix = []byte("iB") + var OpenFileLimit = 64 + func BloomBitsKey(bit uint, section uint64, hash common.Hash) []byte + func GetDefaultLevelDBOption() *opt.Options + func GetOpenFilesLimit() int + func IsPow2(num uint) bool + func NewBadgerDB(dbDir string) (*badgerDB, error) + func NewLevelDB(dbc *DBConfig, entryType DBEntryType) (*levelDB, error) + func NewLevelDBWithOption(dbPath string, ldbOption *opt.Options) (*levelDB, error) + func PutAndWriteBatchesOverThreshold(batch Batch, key, val []byte) error + func SenderTxHashToTxHashKey(senderTxHash common.Hash) []byte + func TxLookupKey(hash common.Hash) []byte + func WriteBatches(batches ...Batch) (int, error) + func WriteBatchesOverThreshold(batches ...Batch) (int, error) + type Batch interface + Reset func() + ValueSize func() int + Write func() error + type DBConfig struct + DBType DBType + Dir string + LevelDBBufferPool bool + LevelDBCacheSize int + LevelDBCompression LevelDBCompressionType + NumStateTriePartitions uint + OpenFilesLimit int + ParallelDBWrite bool + Partitioned bool + type DBEntryType uint8 + const BodyDB + const MiscDB + const ReceiptsDB + const StateTrieDB + const TxLookUpEntryDB + type DBManager interface + ClearBlockChainCache func() + ClearHeaderChainCache func() + Close func() + ConvertServiceChainBlockHashToMainChainTxHash func(scBlockHash common.Hash) common.Hash + DeleteBlock func(hash common.Hash, number uint64) + DeleteBody func(hash common.Hash, number uint64) + DeleteCanonicalHash func(number uint64) + DeleteHeader func(hash common.Hash, number uint64) + DeleteReceipts func(hash common.Hash, number uint64) + DeleteSectionHead func(encodedSection []byte) + DeleteTd func(hash common.Hash, number uint64) + DeleteTxLookupEntry func(hash common.Hash) + FindCommonAncestor func(a, b *types.Header) *types.Header + GetLastIndexedBlockNumber func() uint64 + GetMemDB func() *MemDB + HasBlock func(hash common.Hash, number uint64) bool + HasBody func(hash common.Hash, number uint64) bool + HasHeader func(hash common.Hash, number uint64) bool + HasStateTrieNode func(key []byte) (bool, error) + IsParallelDBWrite func() bool + NewBatch func(dbType DBEntryType) Batch + NewSenderTxHashToTxHashBatch func() Batch + PutBodyToBatch func(batch Batch, hash common.Hash, number uint64, body *types.Body) + PutReceiptsToBatch func(batch Batch, hash common.Hash, number uint64, receipts types.Receipts) + PutSenderTxHashToTxHashToBatch func(batch Batch, senderTxHash, txHash common.Hash) error + PutTxLookupEntriesToBatch func(batch Batch, block *types.Block) + ReadAnchoredBlockNumber func() uint64 + ReadBlock func(hash common.Hash, number uint64) *types.Block + ReadBlockByHash func(hash common.Hash) *types.Block + ReadBlockByNumber func(number uint64) *types.Block + ReadBlockReceiptsInCache func(blockHash common.Hash) types.Receipts + ReadBloomBits func(bloomBitsKey []byte) ([]byte, error) + ReadBody func(hash common.Hash, number uint64) *types.Body + ReadBodyInCache func(hash common.Hash) *types.Body + ReadBodyRLP func(hash common.Hash, number uint64) rlp.RawValue + ReadBodyRLPByHash func(hash common.Hash) rlp.RawValue + ReadCachedTrieNode func(hash common.Hash) ([]byte, error) + ReadCachedTrieNodePreimage func(secureKey []byte) ([]byte, error) + ReadCanonicalHash func(number uint64) common.Hash + ReadChainConfig func(hash common.Hash) *params.ChainConfig + ReadCliqueSnapshot func(snapshotBlockHash common.Hash) ([]byte, error) + ReadDatabaseVersion func() int + ReadFastTrieProgress func() uint64 + ReadGovernance func(num uint64) (map[string]interface{}, error) + ReadGovernanceAtNumber func(num uint64, epoch uint64) (uint64, map[string]interface{}, error) + ReadGovernanceState func() ([]byte, error) + ReadHandleTxHashFromRequestTxHash func(rTx common.Hash) common.Hash + ReadHeadBlockHash func() common.Hash + ReadHeadFastBlockHash func() common.Hash + ReadHeadHeaderHash func() common.Hash + ReadHeader func(hash common.Hash, number uint64) *types.Header + ReadHeaderNumber func(hash common.Hash) *uint64 + ReadHeaderRLP func(hash common.Hash, number uint64) rlp.RawValue + ReadIstanbulSnapshot func(hash common.Hash) ([]byte, error) + ReadPreimage func(hash common.Hash) []byte + ReadReceipt func(hash common.Hash) (*types.Receipt, common.Hash, uint64, uint64) + ReadReceiptFromParentChain func(blockHash common.Hash) *types.Receipt + ReadReceipts func(hash common.Hash, number uint64) types.Receipts + ReadReceiptsByBlockHash func(hash common.Hash) types.Receipts + ReadRecentGovernanceIdx func(count int) ([]uint64, error) + ReadSectionHead func(encodedSection []byte) ([]byte, error) + ReadStateTrieNode func(key []byte) ([]byte, error) + ReadTd func(hash common.Hash, number uint64) *big.Int + ReadTxAndLookupInfo func(hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64) + ReadTxAndLookupInfoInCache func(hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64) + ReadTxHashFromSenderTxHash func(senderTxHash common.Hash) common.Hash + ReadTxLookupEntry func(hash common.Hash) (common.Hash, uint64, uint64) + ReadTxReceiptInCache func(txHash common.Hash) *types.Receipt + ReadValidSections func() ([]byte, error) + WriteAnchoredBlockNumber func(blockNum uint64) + WriteAndCacheTxLookupEntries func(block *types.Block) error + WriteBlock func(block *types.Block) + WriteBloomBits func(bloomBitsKey []byte, bits []byte) error + WriteBody func(hash common.Hash, number uint64, body *types.Body) + WriteBodyRLP func(hash common.Hash, number uint64, rlp rlp.RawValue) + WriteCanonicalHash func(hash common.Hash, number uint64) + WriteChainConfig func(hash common.Hash, cfg *params.ChainConfig) + WriteChildChainTxHash func(ccBlockHash common.Hash, ccTxHash common.Hash) + WriteCliqueSnapshot func(snapshotBlockHash common.Hash, encodedSnapshot []byte) error + WriteDatabaseVersion func(version int) + WriteFastTrieProgress func(count uint64) + WriteGovernance func(data map[string]interface{}, num uint64) error + WriteGovernanceIdx func(num uint64) error + WriteGovernanceState func(b []byte) error + WriteHandleTxHashFromRequestTxHash func(rTx, hTx common.Hash) + WriteHeadBlockHash func(hash common.Hash) + WriteHeadFastBlockHash func(hash common.Hash) + WriteHeadHeaderHash func(hash common.Hash) + WriteHeader func(header *types.Header) + WriteIstanbulSnapshot func(hash common.Hash, blob []byte) error + WriteLastIndexedBlockNumber func(blockNum uint64) + WriteMerkleProof func(key, value []byte) + WritePreimages func(number uint64, preimages map[common.Hash][]byte) + WriteReceiptFromParentChain func(blockHash common.Hash, receipt *types.Receipt) + WriteReceipts func(hash common.Hash, number uint64, receipts types.Receipts) + WriteSectionHead func(encodedSection []byte, hash common.Hash) + WriteTd func(hash common.Hash, number uint64, td *big.Int) + WriteTxLookupEntries func(block *types.Block) + WriteValidSections func(encodedSections []byte) + func NewDBManager(dbc *DBConfig) DBManager + func NewLevelDBManagerForTest(dbc *DBConfig, levelDBOption *opt.Options) (DBManager, error) + func NewMemoryDBManager() DBManager + type DBType uint8 + const BadgerDB + const LevelDB + const MemoryDB + const PartitionedDB + func (dbType DBType) String() string + type Database interface + Close func() + Delete func(key []byte) error + Get func(key []byte) ([]byte, error) + Has func(key []byte) (bool, error) + Meter func(prefix string) + NewBatch func() Batch + Type func() DBType + type LevelDBCompressionType uint8 + const AllNoCompression + const AllSnappyCompression + const ReceiptOnlySnappyCompression + const StateTrieOnlyNoCompression + type MemDB struct + func NewMemDB() *MemDB + func NewMemDBWithCap(size int) *MemDB + func (db *MemDB) Close() + func (db *MemDB) Delete(key []byte) error + func (db *MemDB) Get(key []byte) ([]byte, error) + func (db *MemDB) Has(key []byte) (bool, error) + func (db *MemDB) Keys() [][]byte + func (db *MemDB) Len() int + func (db *MemDB) Meter(prefix string) + func (db *MemDB) NewBatch() Batch + func (db *MemDB) Put(key []byte, value []byte) error + func (db *MemDB) Type() DBType + type Putter interface + Put func(key []byte, value []byte) error + type TransactionLookup struct + Tx *types.Transaction + type TxLookupEntry struct + BlockHash common.Hash + BlockIndex uint64 + Index uint64