historydb

package
v0.0.0-...-46723fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompositeKeySep = []byte{0x00}

CompositeKeySep is a nil byte used as a separator between different components of a composite key

Functions

func ConstructCompositeHistoryKey

func ConstructCompositeHistoryKey(ns string, key string, blocknum uint64, trannum uint64) []byte

ConstructCompositeHistoryKey builds the History Key of namespace~key~blocknum~trannum using an order preserving encoding so that history query results are ordered by height

func ConstructPartialCompositeHistoryKey

func ConstructPartialCompositeHistoryKey(ns string, key string, endkey bool) []byte

ConstructPartialCompositeHistoryKey builds a partial History Key namespace~key~ for use in history key range queries

func SplitCompositeHistoryKey

func SplitCompositeHistoryKey(bytesToSplit []byte, separator []byte) ([]byte, []byte)

SplitCompositeHistoryKey splits the key bytes using a separator

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
	Name() string
}

HistoryDB - an interface that a history database should implement

type HistoryDBProvider

type HistoryDBProvider interface {
	// GetDBHandle returns a handle to a HistoryDB
	GetDBHandle(id string) (HistoryDB, error)
	// Close closes all the HistoryDB instances and releases any resources held by HistoryDBProvider
	Close()
}

HistoryDBProvider provides an instance of a history DB

Directories

Path Synopsis
fakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL