Documentation ¶
Index ¶
- Variables
- func BatchWrite(dbase Database, threshold, length int, ...) (count int, err error)
- func CopySlice(val []byte) []byte
- func GetNilError(db Database, key []byte) ([]byte, error)
- func NewCachedDB(db Database, cacheSize int) (*cachedDB, error)
- func PrefixKey(prefix []byte, key []byte) []byte
- func PrefixKey2(prefix1 []byte, prefix2 []byte, key []byte) []byte
- func ToBlockHashKey(height common.Height) []byte
- func ToBlockKey(hashOfHeader []byte) []byte
- func ToBlockNotVerified(height common.Height) []byte
- func ToBlockNumberKey(hashOfHeader []byte) []byte
- func ToBlockReceiptsKey(hashOfHeader []byte) []byte
- func ToBlockTXIndexKey(hashOfTransacion []byte) []byte
- func ToChainCommitteeKey(chainId common.ChainID, epochNum common.EpochNum) []byte
- func ToChainHeightHeaderKey(chainId common.ChainID, height common.Height) []byte
- func ToChainHeightProofKey(chainId common.ChainID, height common.Height) []byte
- func ToChainReportCursorKey(chainId common.ChainID) []byte
- func ToCurrentHeightKey() []byte
- func ToDFWaterlineSnapshotKey(hashOfWaterlines []byte) []byte
- func ToDeltaFromKey(fromID common.ChainID, height common.Height) []byte
- func ToDeltaFromMaxHeightKey(fromID common.ChainID) []byte
- func ToDeltaFromWaterlineKey(fromID common.ChainID) []byte
- func ToDeltaToBeSentKey() []byte
- func ToEpochCommKey(chainId common.ChainID, epoch common.EpochNum) []byte
- func ToFirstRewardCursorKey() []byte
- func ToRRKey(era common.EraNum) []byte
- func ToRewardBaseKey(chainId common.ChainID) []byte
- func ToStorageEntryKey(root []byte, num int) []byte
- type Batch
- type DataAdapter
- type Database
- type DummyAdapter
- type KeyBatch
- type KeyDatabase
- func (d *KeyDatabase) Batch(batch Batch) error
- func (d *KeyDatabase) Close() error
- func (d *KeyDatabase) Delete(key []byte) error
- func (d *KeyDatabase) Get(key []byte) ([]byte, error)
- func (d *KeyDatabase) Has(key []byte) (bool, error)
- func (d *KeyDatabase) NewBatch() Batch
- func (d *KeyDatabase) Put(key, value []byte) error
- type LDB
- type MemDB
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // prefix+hash -> Account Trie Node and Value KPAccountNode = []byte("aa") KPAccountValue = []byte("ab") // prefix+hash -> Code of Account KPCode = []byte("ac") // prefix+hash -> Account Storage Trie Node KPAccStorageNode = []byte("ad") // prefix+hash -> Account Long Storage Trie Node and Value (for system contract) KPAccLongNode = []byte("am") KPAccLongValue = []byte("an") // shard chain // prefix + hash -> AccountDelta Trie Node and Value KPDeltaNodeNode = []byte("ae") KPDeltaNodeValue = []byte("af") // prefix + header.BalanceDeltaRoot -> combined trie of AccountDelta Tries KPDeltaTrie = []byte("ag") // prefix + shard.ElectChainID.Formalize() + heightOfBlock.Bytes() -> hash root of Account KPDeltaFromTrie = []byte("ah") // prefix + DeltaFromKey{ShardID, Height} -> serialization of []*AccountDelta KPDeltaFroms = []byte("ai") KPDeltaFromMaxHeight = []byte("aj") KPDeltaFromWaterline = []byte("ak") KPDeltaToBeSent = []byte("ao") KPDFWaterlineSnapshot = []byte("ap") // prefix + HistoryTree.Node.Hash -> HistoryTree.Node.Children/Leafs KPHistoryNode = []byte("al") // prefix+hash -> Transaction Trie Node and Value KPTxNode = []byte("tk") KPTxValue = []byte("tv") // prefix+hash -> Transaction in block and index of the all transactions KPTxIndex = []byte("ti") // prefix + hash -> Verifiable Cash Check Trie Node and Value KPVccNode = []byte("va") KPVccValue = []byte("vb") // prefix + hash -> Cashed Verifiable Cash Check Trie Node and Value KPCVccNode = []byte("vc") KPCVccValue = []byte("vd") // prefix + Vcc.Hash -> cash the check Tx.Hash KPCVccTxIndex = []byte("ve") // prefix+hash(Header) -> block/Header height KPBlockNumByHash = []byte("bn") // prefix+height -> Header hash KPBlockHashByNum = []byte("bh") // // prefix+hash(header) -> Header encoded value // KPBlockHeader = []byte("bv") // prefix+hash(header) -> block encoded value KPBlock = []byte("bb") // prefix -> current Highest block height KPCurrentHeight = []byte("bc") // prefix+hash(Header) -> Receipts KPReceipts = []byte("br") // prefix+height -> received data block (not yet processed, just persisted in the database) KPBlockNotVerified = []byte("bv") // prefix+EpochNum -> election results of the EpochNum'th committee // key is the elected Epoch, not the Epoch at the time of the election, starting // from 0. If the election result fails, continue KPEpochComm = []byte("bec") // main chain // prefix + FormalizedChainID -> ChainInfos Trie Node and Value KPChainNode = []byte("cn") KPChainValue = []byte("ci") // prefix + ChainId + EpochNum -> Committee KPChainEpochCommittee = []byte("ce") // prefix + ChainId + Height -> Header KPChainHeightHeader = []byte("ch") // prefix + ChainId + Height -> BlockProof KPChainHeightProof = []byte("cp") // the earliest Cursor on the main chain received by the current node and has not yet // issued a reward, the reward can be issue from this height to process the Request KPRewardHeightCursor = []byte("cf") // prefix+ChainID -> the latest (block height + block Hash) has been reported KPChainReportCursor = []byte("cc") KPRewardBase = []byte("rb") KPRRNode = []byte("ra") // Required Reserve Trie Node Prefix KPRRValue = []byte("rc") // Required Reserve Trie Value Prefix KPRRCNode = []byte("rd") // Required Reserve Changing Trie Node Prefix KPRRCValue = []byte("re") // Required Reserve Changing Trie Value Prefix KPRRRoot = []byte("rf") // Required Reserve Trie Root Hash: prefix+EraNum -> RootOfRRTrie KPStorageEntry = []byte("se") ErrNotFound = errors.New("data not found") )
Functions ¶
func BatchWrite ¶
func NewCachedDB ¶
func ToBlockHashKey ¶
func ToBlockHashKey(height common.Height) []byte
func ToBlockKey ¶
func ToBlockNotVerified ¶
func ToBlockNotVerified(height common.Height) []byte
func ToBlockNumberKey ¶
func ToBlockReceiptsKey ¶
func ToBlockTXIndexKey ¶
func ToChainCommitteeKey ¶
func ToChainCommitteeKey(chainId common.ChainID, epochNum common.EpochNum) []byte
func ToChainHeightHeaderKey ¶
func ToChainHeightHeaderKey(chainId common.ChainID, height common.Height) []byte
func ToChainHeightProofKey ¶
func ToChainHeightProofKey(chainId common.ChainID, height common.Height) []byte
func ToChainReportCursorKey ¶
func ToChainReportCursorKey(chainId common.ChainID) []byte
func ToCurrentHeightKey ¶
func ToCurrentHeightKey() []byte
func ToDeltaFromKey ¶
func ToDeltaFromKey(fromID common.ChainID, height common.Height) []byte
func ToDeltaFromMaxHeightKey ¶
func ToDeltaFromMaxHeightKey(fromID common.ChainID) []byte
func ToDeltaFromWaterlineKey ¶
func ToDeltaFromWaterlineKey(fromID common.ChainID) []byte
func ToDeltaToBeSentKey ¶
func ToDeltaToBeSentKey() []byte
func ToEpochCommKey ¶
func ToEpochCommKey(chainId common.ChainID, epoch common.EpochNum) []byte
func ToFirstRewardCursorKey ¶
func ToFirstRewardCursorKey() []byte
func ToRewardBaseKey ¶
func ToRewardBaseKey(chainId common.ChainID) []byte
func ToStorageEntryKey ¶
Types ¶
type DataAdapter ¶
type DataAdapter interface { Load(key []byte) (value []byte, err error) Save(key []byte, value []byte) error }
func NewKeyPrefixedDataAdapter ¶
func NewKeyPrefixedDataAdapter(database Database, keyPrefix []byte) DataAdapter
func NewTransparentDataAdapter ¶
func NewTransparentDataAdapter() DataAdapter
type Database ¶
type DummyAdapter ¶
type DummyAdapter struct{}
type KeyDatabase ¶
type KeyDatabase struct {
// contains filtered or unexported fields
}
func (*KeyDatabase) Batch ¶
func (d *KeyDatabase) Batch(batch Batch) error
func (*KeyDatabase) Close ¶
func (d *KeyDatabase) Close() error
func (*KeyDatabase) Delete ¶
func (d *KeyDatabase) Delete(key []byte) error
func (*KeyDatabase) NewBatch ¶
func (d *KeyDatabase) NewBatch() Batch
func (*KeyDatabase) Put ¶
func (d *KeyDatabase) Put(key, value []byte) error
type LDB ¶
type LDB struct { common.AbstractService // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.