Documentation ¶
Index ¶
- Variables
- func ConstructCompositeHistoryKey(ns string, key string, blocknum uint64, trannum uint64) []byte
- func ConstructPartialCompositeHistoryKey(ns string, key string, endkey bool) []byte
- func SplitCompositeHistoryKey(bytesToSplit []byte, separator []byte) ([]byte, []byte)
- type HistoryDB
- type HistoryDBProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var CompositeKeySep = []byte{0x00}
compositekeysep是一个零字节,用作复合键不同组件之间的分隔符。
Functions ¶
func ConstructCompositeHistoryKey ¶
constructcompositehistorykey生成命名空间~key~blocknum~trannum的历史键 使用保留顺序的编码,以便按高度排序历史查询结果
func ConstructPartialCompositeHistoryKey ¶
constructPartialCompositeHistoryKey生成部分历史键命名空间~key~ 用于历史键范围查询
Types ¶
type HistoryDB ¶
type HistoryDB interface { NewHistoryQueryExecutor(blockStore blkstorage.BlockStore) (ledger.HistoryQueryExecutor, error) Commit(block *common.Block) error GetLastSavepoint() (*version.Height, error) ShouldRecover(lastAvailableBlock uint64) (bool, uint64, error) CommitLostBlock(blockAndPvtdata *ledger.BlockAndPvtData) error }
HistoryDB-历史数据库应该实现的接口
type HistoryDBProvider ¶
type HistoryDBProvider interface { //GetDBHandle返回HistoryDB的句柄 GetDBHandle(id string) (HistoryDB, error) //关闭关闭所有HistoryDB实例并释放HistoryDBProvider持有的任何资源 Close() }
HistoryDBProvider提供历史数据库的实例
Click to show internal directories.
Click to hide internal directories.