Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type DataEntryPrefix ¶
type DataEntryPrefix byte
DataEntryPrefix
const ( // DATA DATA_BLOCK_HASH DataEntryPrefix = 0x00 //Block height => block hash key prefix DATA_HEADER = 0x01 //Block hash => block header+txhashes key prefix DATA_TRANSACTION = 0x02 //Transction hash => transaction key prefix DATA_STATE_MERKLE_ROOT = 0x21 // block height => write set hash + state merkle root // Transaction ST_BOOKKEEPER DataEntryPrefix = 0x03 //BookKeeper state key prefix ST_CONTRACT DataEntryPrefix = 0x04 //Smart contract deploy code key prefix ST_STORAGE DataEntryPrefix = 0x05 //Smart contract storage key prefix ST_DESTROYED DataEntryPrefix = 0x06 // record destroyed smart contract: prefix+address -> height // eth state ST_ETH_CODE DataEntryPrefix = 0x30 // eth contract code:hash -> bytes ST_ETH_ACCOUNT DataEntryPrefix = 0x31 // eth account: address -> [nonce, codeHash] IX_HEADER_HASH_LIST DataEntryPrefix = 0x09 //Block height => block hash key prefix //SYSTEM SYS_CURRENT_BLOCK DataEntryPrefix = 0x10 //Current block key prefix SYS_VERSION DataEntryPrefix = 0x11 //Store version key prefix SYS_CURRENT_CROSS_STATES DataEntryPrefix = 0x12 //Block cross states SYS_BLOCK_MERKLE_TREE DataEntryPrefix = 0x13 // Block merkle tree root key prefix SYS_STATE_MERKLE_TREE DataEntryPrefix = 0x20 // state merkle tree root key prefix SYS_CROSS_CHAIN_MSG DataEntryPrefix = 0x22 // state merkle tree root key prefix EVENT_NOTIFY DataEntryPrefix = 0x14 //Event notify key prefix DATA_BLOCK_PRUNE_HEIGHT DataEntryPrefix = 0x80 // last pruned block height, genesis block can not be pruned )
type EventStore ¶
type EventStore interface { //SaveEventNotifyByTx save event notify gen by smart contract execution SaveEventNotifyByTx(txHash common.Uint256, notify *event.ExecuteNotify) error //Save transaction hashes which have event notify gen SaveEventNotifyByBlock(height uint32, txHashs []common.Uint256) //GetEventNotifyByTx return event notify by transaction hash GetEventNotifyByTx(txHash common.Uint256) (*event.ExecuteNotify, error) //Commit event notify to store CommitTo() error }
EventStore save event notify
type PersistStore ¶
type PersistStore interface { Put(key []byte, value []byte) error //Put the key-value pair to store Get(key []byte) ([]byte, error) //Get the value if key in store Has(key []byte) (bool, error) //Whether the key is exist in store Delete(key []byte) error //Delete the key in store NewBatch() //Start commit batch BatchPut(key []byte, value []byte) //Put a key-value pair to batch BatchDelete(key []byte) //Delete the key in batch BatchCommit() error //Commit batch to store Close() error //Close store NewIterator(prefix []byte) StoreIterator //Return the iterator of store }
PersistStore of ledger
type StoreIterator ¶
type StoreIterator interface { Next() bool //Next item. If item available return true, otherwise return false //Prev() bool //previous item. If item available return true, otherwise return false First() bool //First item. If item available return true, otherwise return false //Last() bool //Last item. If item available return true, otherwise return false //Seek(key []byte) bool //Seek key. If item available return true, otherwise return false Key() []byte //Return the current item key Value() []byte //Return the current item value Release() //Close iterator Error() error // Error returns any accumulated error. }
Store iterator for iterate store
Click to show internal directories.
Click to hide internal directories.