Versions in this module Expand all Collapse all v2 v2.1.0 Dec 22, 2021 Changes in this version + const BlockHeaderPrefix + const BlockHeightPrefix + const ChainConfigPrefix + const LastCommittedBlockHeaderPrefix + const LastCommittedBlockHeightPrefix + const TxExtraDataPrefix + const TxHashPrefix + const TxHeightPrefix + const TxPrefix + const TxTotalNumPrefix + type KvStateDB struct + func NewKvStateDB(storeConfig *conf.StoreConfig, log *zap.SugaredLogger) *KvStateDB + func (db *KvStateDB) Close() + func (db *KvStateDB) CommitBlockDataAndTxData(chainId string, height uint64, blockData *storage.BlockData, ...) error + func (db *KvStateDB) GetBlockHeaderAndHeightByHash(chainId string, blockHash []byte) ([]byte, uint64, bool) + func (db *KvStateDB) GetBlockHeaderByHeight(chainId string, height uint64) ([]byte, bool) + func (db *KvStateDB) GetChainConfig(chainId string) ([]byte, bool) + func (db *KvStateDB) GetLastCommittedBlockHeaderAndHeight(chainId string) ([]byte, uint64, bool) + func (db *KvStateDB) GetTransactionByTxKey(chainId string, txKey string) ([]byte, bool) + func (db *KvStateDB) GetTransactionHashAndHeightByTxKey(chainId string, txKey string) ([]byte, uint64, bool) + func (db *KvStateDB) GetTransactionTotalNum(chainId string) (uint64, bool) + func (db *KvStateDB) GetTxExtraDataByTxKey(chainId string, txKey string) ([]byte, bool) + func (db *KvStateDB) WriteChainConfig(chainId string, chainConfig []byte) error + type LevelDBProvider struct + func NewLevelDBProvider(ldbConfig *conf.LevelDBConfig) *LevelDBProvider + func (l *LevelDBProvider) Close() + func (l *LevelDBProvider) Delete(key string) error + func (l *LevelDBProvider) Get(key string) ([]byte, bool) + func (l *LevelDBProvider) Has(key string) (bool, error) + func (l *LevelDBProvider) Put(key string, value []byte) error + func (l *LevelDBProvider) WriteBatch(batch *kvdb.Batcher) error