Versions in this module Expand all Collapse all v0 v0.7.2 Apr 16, 2020 v0.7.1 Apr 9, 2020 Changes in this version + const BLOCK_CAHE_SIZE + const HEADER_INDEX_BATCH_SIZE + const STATE_CACHE_SIZE + const SYSTEM_VERSION + const TRANSACTION_CACHE_SIZE + var BOOKKEEPER = []byte("Bookkeeper") + var DBDirBlock = "block" + var DBDirEvent = "ledgerevent" + var DBDirState = "states" + var MerkleTreeStorePath = "merkle_tree.db" + func SaveNotify(eventStore scommon.EventStore, txHash common.Uint256, ...) error + type BlockCache struct + func NewBlockCache() (*BlockCache, error) + func (this *BlockCache) AddBlock(block *types.Block) + func (this *BlockCache) AddTransaction(tx *types.Transaction, height uint32) + func (this *BlockCache) ContainBlock(blockHash common.Uint256) bool + func (this *BlockCache) ContainTransaction(txHash common.Uint256) bool + func (this *BlockCache) GetBlock(blockHash common.Uint256) *types.Block + func (this *BlockCache) GetTransaction(txHash common.Uint256) (*types.Transaction, uint32) + type BlockStore struct + func NewBlockStore(dbDir string, enableCache bool) (*BlockStore, error) + func (this *BlockStore) ClearAll() error + func (this *BlockStore) Close() error + func (this *BlockStore) CommitTo() error + func (this *BlockStore) ContainBlock(blockHash common.Uint256) (bool, error) + func (this *BlockStore) ContainTransaction(txHash common.Uint256) (bool, error) + func (this *BlockStore) GetBlock(blockHash common.Uint256) (*types.Block, error) + func (this *BlockStore) GetBlockHash(height uint32) (common.Uint256, error) + func (this *BlockStore) GetCurrentBlock() (common.Uint256, uint32, error) + func (this *BlockStore) GetHeader(blockHash common.Uint256) (*types.Header, error) + func (this *BlockStore) GetHeaderIndexList() (map[uint32]common.Uint256, error) + func (this *BlockStore) GetRawHeader(blockHash common.Uint256) (*types.RawHeader, error) + func (this *BlockStore) GetSysFeeAmount(blockHash common.Uint256) (common.Fixed64, error) + func (this *BlockStore) GetTransaction(txHash common.Uint256) (*types.Transaction, uint32, error) + func (this *BlockStore) GetVersion() (byte, error) + func (this *BlockStore) NewBatch() + func (this *BlockStore) SaveBlock(block *types.Block) error + func (this *BlockStore) SaveBlockHash(height uint32, blockHash common.Uint256) + func (this *BlockStore) SaveCurrentBlock(height uint32, blockHash common.Uint256) error + func (this *BlockStore) SaveHeader(block *types.Block, sysFee common.Fixed64) error + func (this *BlockStore) SaveHeaderIndexList(startIndex uint32, indexList []common.Uint256) + func (this *BlockStore) SaveTransaction(tx *types.Transaction, height uint32) + func (this *BlockStore) SaveVersion(ver byte) error + type EventStore struct + func NewEventStore(dbDir string) (*EventStore, error) + func (this *EventStore) ClearAll() error + func (this *EventStore) Close() error + func (this *EventStore) CommitTo() error + func (this *EventStore) GetCurrentBlock() (common.Uint256, uint32, error) + func (this *EventStore) GetEventNotifyByBlock(height uint32) ([]*event.ExecuteNotify, error) + func (this *EventStore) GetEventNotifyByTx(txHash common.Uint256) (*event.ExecuteNotify, error) + func (this *EventStore) NewBatch() + func (this *EventStore) SaveCurrentBlock(height uint32, blockHash common.Uint256) + func (this *EventStore) SaveEventNotifyByBlock(height uint32, txHashs []common.Uint256) + func (this *EventStore) SaveEventNotifyByTx(txHash common.Uint256, notify *event.ExecuteNotify) error + type LedgerStoreImp struct + func NewLedgerStore(dataDir string, stateHashHeight uint32) (*LedgerStoreImp, error) + func (this *LedgerStoreImp) AddBlock(block *types.Block, stateMerkleRoot common.Uint256) error + func (this *LedgerStoreImp) AddHeader(header *types.Header) error + func (this *LedgerStoreImp) AddHeaders(headers []*types.Header) error + func (this *LedgerStoreImp) Close() error + func (this *LedgerStoreImp) ExecuteBlock(block *types.Block) (result store.ExecuteResult, err error) + func (this *LedgerStoreImp) GetBlockByHash(blockHash common.Uint256) (*types.Block, error) + func (this *LedgerStoreImp) GetBlockByHeight(height uint32) (*types.Block, error) + func (this *LedgerStoreImp) GetBlockHash(height uint32) common.Uint256 + func (this *LedgerStoreImp) GetBlockRootWithNewTxRoots(startHeight uint32, txRoots []common.Uint256) common.Uint256 + func (this *LedgerStoreImp) GetBookkeeperState() (*states.BookkeeperState, error) + func (this *LedgerStoreImp) GetContractState(contractHash common.Address) (*payload.DeployCode, error) + func (this *LedgerStoreImp) GetCurrentBlock() (uint32, common.Uint256) + func (this *LedgerStoreImp) GetCurrentBlockHash() common.Uint256 + func (this *LedgerStoreImp) GetCurrentBlockHeight() uint32 + func (this *LedgerStoreImp) GetCurrentHeaderHash() common.Uint256 + func (this *LedgerStoreImp) GetCurrentHeaderHeight() uint32 + func (this *LedgerStoreImp) GetEventNotifyByBlock(height uint32) ([]*event.ExecuteNotify, error) + func (this *LedgerStoreImp) GetEventNotifyByTx(tx common.Uint256) (*event.ExecuteNotify, error) + func (this *LedgerStoreImp) GetHeaderByHash(blockHash common.Uint256) (*types.Header, error) + func (this *LedgerStoreImp) GetHeaderByHeight(height uint32) (*types.Header, error) + func (this *LedgerStoreImp) GetMerkleProof(proofHeight, rootHeight uint32) ([]common.Uint256, error) + func (this *LedgerStoreImp) GetRawHeaderByHash(blockHash common.Uint256) (*types.RawHeader, error) + func (this *LedgerStoreImp) GetStateMerkleRoot(height uint32) (common.Uint256, error) + func (this *LedgerStoreImp) GetStorageItem(key *states.StorageKey) (*states.StorageItem, error) + func (this *LedgerStoreImp) GetSysFeeAmount(blockHash common.Uint256) (common.Fixed64, error) + func (this *LedgerStoreImp) GetTransaction(txHash common.Uint256) (*types.Transaction, uint32, error) + func (this *LedgerStoreImp) InitLedgerStoreWithGenesisBlock(genesisBlock *types.Block, defaultBookkeeper []keypair.PublicKey) error + func (this *LedgerStoreImp) IsContainBlock(blockHash common.Uint256) (bool, error) + func (this *LedgerStoreImp) IsContainTransaction(txHash common.Uint256) (bool, error) + func (this *LedgerStoreImp) PreExecuteContract(tx *types.Transaction) (*sstate.PreExecResult, error) + func (this *LedgerStoreImp) PreExecuteContractBatch(txes []*types.Transaction, atomic bool) ([]*sstate.PreExecResult, uint32, error) + func (this *LedgerStoreImp) SubmitBlock(block *types.Block, result store.ExecuteResult) error + type StateCache struct + func NewStateCache() (*StateCache, error) + func (this *StateCache) AddState(key []byte, state states.StateValue) + func (this *StateCache) DeleteState(key []byte) + func (this *StateCache) GetState(key []byte) states.StateValue + type StateStore struct + func NewMemStateStore(stateHashHeight uint32) *StateStore + func NewStateStore(dbDir, merklePath string, stateHashCheckHeight uint32) (*StateStore, error) + func (self *StateStore) AddBlockMerkleTreeRoot(txRoot common.Uint256) error + func (self *StateStore) AddStateMerkleTreeRoot(blockHeight uint32, writeSetHash common.Uint256) error + func (self *StateStore) BatchDeleteRawKey(key []byte) + func (self *StateStore) BatchPutRawKeyVal(key, val []byte) + func (self *StateStore) CheckStorage() error + func (self *StateStore) ClearAll() error + func (self *StateStore) Close() error + func (self *StateStore) CommitTo() error + func (self *StateStore) GetBlockMerkleTree() (uint32, []common.Uint256, error) + func (self *StateStore) GetBlockRootWithNewTxRoots(txRoots []common.Uint256) common.Uint256 + func (self *StateStore) GetBookkeeperState() (*states.BookkeeperState, error) + func (self *StateStore) GetContractState(contractHash common.Address) (*payload.DeployCode, error) + func (self *StateStore) GetCurrentBlock() (common.Uint256, uint32, error) + func (self *StateStore) GetMerkleProof(proofHeight, rootHeight uint32) ([]common.Uint256, error) + func (self *StateStore) GetStateMerkleRoot(height uint32) (result common.Uint256, err error) + func (self *StateStore) GetStateMerkleRootWithNewHash(writeSetHash common.Uint256) common.Uint256 + func (self *StateStore) GetStateMerkleTree() (uint32, []common.Uint256, error) + func (self *StateStore) GetStorageState(key *states.StorageKey) (*states.StorageItem, error) + func (self *StateStore) HandleDeployTransaction(store store.LedgerStore, overlay *overlaydb.OverlayDB, ...) error + func (self *StateStore) HandleInvokeTransaction(store store.LedgerStore, overlay *overlaydb.OverlayDB, ...) error + func (self *StateStore) NewBatch() + func (self *StateStore) NewOverlayDB() *overlaydb.OverlayDB + func (self *StateStore) SaveBookkeeperState(bookkeeperState *states.BookkeeperState) error + func (self *StateStore) SaveCurrentBlock(height uint32, blockHash common.Uint256) error + type TransactionCacheaValue struct + Height uint32 + Tx *types.Transaction