Documentation ¶
Index ¶
- type Chain
- type EventListener
- type FlushingBatch
- type LogItem
- type Redo
- func (redo *Redo) AddLog(addr types.Address, log LogItem)
- func (redo *Redo) Close() error
- func (redo *Redo) HasRedo(snapshotHeight uint64) (bool, error)
- func (redo *Redo) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock)
- func (redo *Redo) QueryLog(snapshotHeight uint64) (SnapshotLog, bool, error)
- func (redo *Redo) Rollback(chunks []*ledger.SnapshotChunk)
- func (redo *Redo) SetCurrentSnapshot(snapshotHeight uint64, logMap SnapshotLog)
- type RedoCache
- func (redoCache *RedoCache) AddLog(addr types.Address, log LogItem)
- func (redoCache *RedoCache) Current() SnapshotLog
- func (redoCache *RedoCache) Delete(snapshotHeight uint64)
- func (redoCache *RedoCache) Get(snapshotHeight uint64) (SnapshotLog, bool)
- func (redoCache *RedoCache) Init(currentHeight uint64)
- func (redoCache *RedoCache) Set(snapshotHeight uint64, snapshotLog SnapshotLog)
- func (redoCache *RedoCache) SetCurrent(snapshotHeight uint64, snapshotLog SnapshotLog)
- type SnapshotLog
- type StateDB
- func (sDB *StateDB) Close() error
- func (sDB *StateDB) GetBalance(addr types.Address, tokenTypeId types.TokenTypeId) (*big.Int, error)
- func (sDB *StateDB) GetBalanceMap(addr types.Address) (map[types.TokenTypeId]*big.Int, error)
- func (sDB *StateDB) GetCallDepth(sendBlockHash *types.Hash) (uint16, error)
- func (sDB *StateDB) GetCode(addr types.Address) ([]byte, error)
- func (sDB *StateDB) GetContractList(gid *types.Gid) ([]types.Address, error)
- func (sDB *StateDB) GetContractMeta(addr types.Address) (*ledger.ContractMeta, error)
- func (sDB *StateDB) GetSnapshotBalanceList(snapshotBlockHash types.Hash, addrList []types.Address, ...) (map[types.Address]*big.Int, error)
- func (sDB *StateDB) GetSnapshotValue(snapshotBlockHeight uint64, addr types.Address, key []byte) ([]byte, error)
- func (sDB *StateDB) GetStatus() []interfaces.DBStatus
- func (sDB *StateDB) GetStorageValue(addr *types.Address, key []byte) ([]byte, error)
- func (sDB *StateDB) GetVmLogList(logHash *types.Hash) (ledger.VmLogList, error)
- func (sDB *StateDB) HasContractMeta(addr types.Address) (bool, error)
- func (sDB *StateDB) Init() error
- func (sDB *StateDB) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock) error
- func (sDB *StateDB) IterateContracts(...)
- func (sDB *StateDB) NewSnapshotStorageIterator(snapshotHash types.Hash, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)
- func (sDB *StateDB) NewSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr *types.Address, prefix []byte) (interfaces.StorageIterator, error)
- func (sDB *StateDB) NewStorageDatabase(snapshotHash types.Hash, addr types.Address) (*StorageDatabase, error)
- func (sDB *StateDB) NewStorageIterator(addr *types.Address, prefix []byte) interfaces.StorageIterator
- func (sDB *StateDB) RedoStore() *chain_db.Store
- func (sDB *StateDB) RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error
- func (sDB *StateDB) RollbackSnapshotBlocks(deletedSnapshotSegments []*ledger.SnapshotChunk, ...) error
- func (sDB *StateDB) StorageRedo() *Redo
- func (sDB *StateDB) Store() *chain_db.Store
- func (sDB *StateDB) Write(block *vm_db.VmAccountBlock) error
- func (sDB *StateDB) WriteByRedo(blockHash types.Hash, addr types.Address, redoLog LogItem)
- type StorageDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain interface { QueryLatestSnapshotBlock() (*ledger.SnapshotBlock, error) GetLatestSnapshotBlock() *ledger.SnapshotBlock GetSnapshotHeightByHash(hash types.Hash) (uint64, error) GetUnconfirmedBlocks(addr types.Address) []*ledger.AccountBlock GetAccountBlockByHash(blockHash types.Hash) (*ledger.AccountBlock, error) }
type EventListener ¶
type EventListener interface { PrepareInsertAccountBlocks(blocks []*vm_db.VmAccountBlock) error InsertAccountBlocks(blocks []*vm_db.VmAccountBlock) error PrepareInsertSnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) error InsertSnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) error PrepareDeleteAccountBlocks(blocks []*ledger.AccountBlock) error DeleteAccountBlocks(blocks []*ledger.AccountBlock) error PrepareDeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error DeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error }
type LogItem ¶
type Redo ¶
type Redo struct {
// contains filtered or unexported fields
}
func NewStorageRedoWithStore ¶
func (*Redo) InsertSnapshotBlock ¶
func (redo *Redo) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock)
func (*Redo) QueryLog ¶
func (redo *Redo) QueryLog(snapshotHeight uint64) (SnapshotLog, bool, error)
func (*Redo) Rollback ¶
func (redo *Redo) Rollback(chunks []*ledger.SnapshotChunk)
func (*Redo) SetCurrentSnapshot ¶
func (redo *Redo) SetCurrentSnapshot(snapshotHeight uint64, logMap SnapshotLog)
type RedoCache ¶
type RedoCache struct {
// contains filtered or unexported fields
}
func (*RedoCache) Current ¶
func (redoCache *RedoCache) Current() SnapshotLog
func (*RedoCache) Get ¶
func (redoCache *RedoCache) Get(snapshotHeight uint64) (SnapshotLog, bool)
func (*RedoCache) Set ¶
func (redoCache *RedoCache) Set(snapshotHeight uint64, snapshotLog SnapshotLog)
func (*RedoCache) SetCurrent ¶
func (redoCache *RedoCache) SetCurrent(snapshotHeight uint64, snapshotLog SnapshotLog)
type SnapshotLog ¶
func (*SnapshotLog) Deserialize ¶
func (sl *SnapshotLog) Deserialize(buf []byte) error
func (*SnapshotLog) Serialize ¶
func (sl *SnapshotLog) Serialize() ([]byte, error)
type StateDB ¶
type StateDB struct {
// contains filtered or unexported fields
}
func NewStateDB ¶
func NewStateDBWithStore ¶
func (*StateDB) GetBalance ¶
func (*StateDB) GetBalanceMap ¶
func (*StateDB) GetCallDepth ¶
func (*StateDB) GetContractList ¶
func (*StateDB) GetContractMeta ¶
func (*StateDB) GetSnapshotBalanceList ¶
func (*StateDB) GetSnapshotValue ¶
func (*StateDB) GetStatus ¶
func (sDB *StateDB) GetStatus() []interfaces.DBStatus
func (*StateDB) GetStorageValue ¶
func (*StateDB) GetVmLogList ¶
func (*StateDB) HasContractMeta ¶
func (*StateDB) InsertSnapshotBlock ¶
func (sDB *StateDB) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock) error
func (*StateDB) IterateContracts ¶
func (*StateDB) NewSnapshotStorageIterator ¶
func (sDB *StateDB) NewSnapshotStorageIterator(snapshotHash types.Hash, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)
func (*StateDB) NewSnapshotStorageIteratorByHeight ¶
func (sDB *StateDB) NewSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr *types.Address, prefix []byte) (interfaces.StorageIterator, error)
func (*StateDB) NewStorageDatabase ¶
func (*StateDB) NewStorageIterator ¶
func (sDB *StateDB) NewStorageIterator(addr *types.Address, prefix []byte) interfaces.StorageIterator
func (*StateDB) RollbackAccountBlocks ¶
func (sDB *StateDB) RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error
func (*StateDB) RollbackSnapshotBlocks ¶
func (sDB *StateDB) RollbackSnapshotBlocks(deletedSnapshotSegments []*ledger.SnapshotChunk, newUnconfirmedBlocks []*ledger.AccountBlock) error
func (*StateDB) Write ¶
func (sDB *StateDB) Write(block *vm_db.VmAccountBlock) error
type StorageDatabase ¶
type StorageDatabase struct {
// contains filtered or unexported fields
}
func NewStorageDatabase ¶
func NewStorageDatabase(stateDb *StateDB, snapshotHeight uint64, addr types.Address) *StorageDatabase
func (*StorageDatabase) Address ¶
func (sd *StorageDatabase) Address() *types.Address
func (*StorageDatabase) GetValue ¶
func (sd *StorageDatabase) GetValue(key []byte) ([]byte, error)
func (*StorageDatabase) NewStorageIterator ¶
func (sd *StorageDatabase) NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error)
Click to show internal directories.
Click to hide internal directories.