Documentation ¶
Index ¶
- Variables
- type Account
- func (accountAccess *Account) GetAccountByAddress(address *types.Address) (*ledger.Account, error)
- func (accountAccess *Account) GetAddressById(accountId uint64) (*types.Address, error)
- func (accountAccess *Account) GetLastAccountId() (uint64, error)
- func (accountAccess *Account) IsAccountExisted(address *types.Address) (bool, error)
- func (accountAccess *Account) WriteAccount(batch *leveldb.Batch, account *ledger.Account) error
- func (accountAccess *Account) WriteAccountIndex(batch *leveldb.Batch, accountId uint64, accountAddress *types.Address)
- type AccountChain
- func (ac *AccountChain) Delete(batch *leveldb.Batch, deleteMap map[uint64]uint64) (map[uint64][]*ledger.AccountBlock, error)
- func (ac *AccountChain) DeleteBeSnapshot(batch *leveldb.Batch, blockHash *types.Hash)
- func (ac *AccountChain) DeleteBlock(batch *leveldb.Batch, accountId uint64, height uint64, hash *types.Hash)
- func (ac *AccountChain) DeleteBlockMeta(batch *leveldb.Batch, hash *types.Hash)
- func (ac *AccountChain) DeleteVmLogList(batch *leveldb.Batch, logListHash *types.Hash)
- func (ac *AccountChain) GetBeSnapshot(blockHash *types.Hash) (uint64, error)
- func (ac *AccountChain) GetBlock(blockHash *types.Hash) (*ledger.AccountBlock, error)
- func (ac *AccountChain) GetBlockByHeight(accountId uint64, height uint64) (*ledger.AccountBlock, error)
- func (ac *AccountChain) GetBlockListByAccountId(accountId, startHeight, endHeight uint64, forward bool) ([]*ledger.AccountBlock, error)
- func (ac *AccountChain) GetBlockMeta(blockHash *types.Hash) (*ledger.AccountBlockMeta, error)
- func (ac *AccountChain) GetConfirmAccountBlock(snapshotHeight uint64, accountId uint64) (*ledger.AccountBlock, error)
- func (ac *AccountChain) GetConfirmHeight(accountBlockHash *types.Hash) (uint64, error)
- func (ac *AccountChain) GetContractGid(accountId uint64) (*types.Gid, error)
- func (ac *AccountChain) GetContractGidFromSendCreateBlock(fromBlock *ledger.AccountBlock) (*types.Gid, error)
- func (ac *AccountChain) GetDeleteMapAndReopenList(planToDelete map[uint64]uint64, ...) (map[uint64]uint64, []*ledger.HashHeight, error)
- func (ac *AccountChain) GetFirstConfirmedBlockBeforeOrAtAbHeight(accountId, accountBlockHeight uint64) (*ledger.AccountBlock, error)
- func (ac *AccountChain) GetHashByHeight(accountId uint64, height uint64) (*types.Hash, error)
- func (ac *AccountChain) GetLatestBlock(accountId uint64) (*ledger.AccountBlock, error)
- func (ac *AccountChain) GetPlanToDelete(maxAccountId uint64, snapshotBlockHeight uint64) (map[uint64]uint64, error)
- func (ac *AccountChain) GetUnConfirmAccountBlocks(accountId uint64, beforeHeight uint64) ([]*ledger.AccountBlock, error)
- func (ac *AccountChain) GetUnConfirmedSubLedger(maxAccountId uint64) (map[uint64][]*ledger.AccountBlock, error)
- func (ac *AccountChain) GetUnConfirmedSubLedgerByAccounts(accountIds []uint64) (map[uint64][]*ledger.AccountBlock, error)
- func (ac *AccountChain) GetVmLogList(logListHash *types.Hash) (ledger.VmLogList, error)
- func (ac *AccountChain) IsBlockExisted(hash types.Hash) (bool, error)
- func (ac *AccountChain) ReopenSendBlocks(batch *leveldb.Batch, reopenList []*ledger.HashHeight, ...) error
- func (ac *AccountChain) WriteBeSnapshot(batch *leveldb.Batch, blockHash *types.Hash, snapshotBlockHeight uint64) error
- func (ac *AccountChain) WriteBlock(batch *leveldb.Batch, accountId uint64, block *ledger.AccountBlock) error
- func (ac *AccountChain) WriteBlockMeta(batch *leveldb.Batch, blockHash *types.Hash, ...) error
- func (ac *AccountChain) WriteVmLogList(batch *leveldb.Batch, logList ledger.VmLogList) error
- type BlockEvent
- func (be *BlockEvent) AddAccountBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
- func (be *BlockEvent) AddSnapshotBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
- func (be *BlockEvent) DeleteAccountBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
- func (be *BlockEvent) DeleteSnapshotBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
- func (be *BlockEvent) GetEvent(eventId uint64) (byte, []types.Hash, error)
- func (be *BlockEvent) LatestEventId() (uint64, error)
- type OnRoad
- type SnapshotChain
- func (sc *SnapshotChain) DeleteToHeight(batch *leveldb.Batch, toHeight uint64) ([]*ledger.SnapshotBlock, error)
- func (sc *SnapshotChain) GetLatestBlock() (*ledger.SnapshotBlock, error)
- func (sc *SnapshotChain) GetSnapshotBlock(height uint64, containsSnapshotContent bool) (*ledger.SnapshotBlock, error)
- func (sc *SnapshotChain) GetSnapshotBlockHeight(snapshotHash *types.Hash) (uint64, error)
- func (sc *SnapshotChain) GetSnapshotBlocks(height uint64, count uint64, forward, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error)
- func (sc *SnapshotChain) GetSnapshotContent(snapshotBlockHeight uint64) (ledger.SnapshotContent, error)
- func (sc *SnapshotChain) WriteSnapshotBlock(batch *leveldb.Batch, snapshotBlock *ledger.SnapshotBlock) error
- func (sc *SnapshotChain) WriteSnapshotContent(batch *leveldb.Batch, snapshotHeight uint64, ...) error
- func (sc *SnapshotChain) WriteSnapshotHash(batch *leveldb.Batch, hash *types.Hash, height uint64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AddAccountBlocksEvent = byte(1) DeleteAccountBlocksEvent = byte(2) AddSnapshotBlocksEvent = byte(3) DeleteSnapshotBlocksEvent = byte(4) )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccount ¶
func (*Account) GetAccountByAddress ¶
func (*Account) GetAddressById ¶
func (*Account) GetLastAccountId ¶
func (*Account) IsAccountExisted ¶ added in v1.3.0
func (*Account) WriteAccount ¶
type AccountChain ¶
type AccountChain struct {
// contains filtered or unexported fields
}
func NewAccountChain ¶
func NewAccountChain(db *leveldb.DB) *AccountChain
func (*AccountChain) Delete ¶
func (ac *AccountChain) Delete(batch *leveldb.Batch, deleteMap map[uint64]uint64) (map[uint64][]*ledger.AccountBlock, error)
func (*AccountChain) DeleteBeSnapshot ¶
func (ac *AccountChain) DeleteBeSnapshot(batch *leveldb.Batch, blockHash *types.Hash)
func (*AccountChain) DeleteBlock ¶
func (*AccountChain) DeleteBlockMeta ¶
func (ac *AccountChain) DeleteBlockMeta(batch *leveldb.Batch, hash *types.Hash)
func (*AccountChain) DeleteVmLogList ¶
func (ac *AccountChain) DeleteVmLogList(batch *leveldb.Batch, logListHash *types.Hash)
func (*AccountChain) GetBeSnapshot ¶
func (ac *AccountChain) GetBeSnapshot(blockHash *types.Hash) (uint64, error)
func (*AccountChain) GetBlock ¶
func (ac *AccountChain) GetBlock(blockHash *types.Hash) (*ledger.AccountBlock, error)
func (*AccountChain) GetBlockByHeight ¶
func (ac *AccountChain) GetBlockByHeight(accountId uint64, height uint64) (*ledger.AccountBlock, error)
func (*AccountChain) GetBlockListByAccountId ¶
func (ac *AccountChain) GetBlockListByAccountId(accountId, startHeight, endHeight uint64, forward bool) ([]*ledger.AccountBlock, error)
func (*AccountChain) GetBlockMeta ¶
func (ac *AccountChain) GetBlockMeta(blockHash *types.Hash) (*ledger.AccountBlockMeta, error)
func (*AccountChain) GetConfirmAccountBlock ¶
func (ac *AccountChain) GetConfirmAccountBlock(snapshotHeight uint64, accountId uint64) (*ledger.AccountBlock, error)
TODO Add cache, call frequently.
func (*AccountChain) GetConfirmHeight ¶
func (ac *AccountChain) GetConfirmHeight(accountBlockHash *types.Hash) (uint64, error)
func (*AccountChain) GetContractGid ¶
func (ac *AccountChain) GetContractGid(accountId uint64) (*types.Gid, error)
func (*AccountChain) GetContractGidFromSendCreateBlock ¶ added in v1.2.0
func (ac *AccountChain) GetContractGidFromSendCreateBlock(fromBlock *ledger.AccountBlock) (*types.Gid, error)
func (*AccountChain) GetDeleteMapAndReopenList ¶
func (*AccountChain) GetFirstConfirmedBlockBeforeOrAtAbHeight ¶
func (ac *AccountChain) GetFirstConfirmedBlockBeforeOrAtAbHeight(accountId, accountBlockHeight uint64) (*ledger.AccountBlock, error)
func (*AccountChain) GetHashByHeight ¶
func (*AccountChain) GetLatestBlock ¶
func (ac *AccountChain) GetLatestBlock(accountId uint64) (*ledger.AccountBlock, error)
func (*AccountChain) GetPlanToDelete ¶
func (ac *AccountChain) GetPlanToDelete(maxAccountId uint64, snapshotBlockHeight uint64) (map[uint64]uint64, error)
TODO: cache
func (*AccountChain) GetUnConfirmAccountBlocks ¶
func (ac *AccountChain) GetUnConfirmAccountBlocks(accountId uint64, beforeHeight uint64) ([]*ledger.AccountBlock, error)
func (*AccountChain) GetUnConfirmedSubLedger ¶
func (ac *AccountChain) GetUnConfirmedSubLedger(maxAccountId uint64) (map[uint64][]*ledger.AccountBlock, error)
func (*AccountChain) GetUnConfirmedSubLedgerByAccounts ¶ added in v1.2.0
func (ac *AccountChain) GetUnConfirmedSubLedgerByAccounts(accountIds []uint64) (map[uint64][]*ledger.AccountBlock, error)
func (*AccountChain) GetVmLogList ¶
func (*AccountChain) IsBlockExisted ¶ added in v1.2.0
func (ac *AccountChain) IsBlockExisted(hash types.Hash) (bool, error)
func (*AccountChain) ReopenSendBlocks ¶
func (ac *AccountChain) ReopenSendBlocks(batch *leveldb.Batch, reopenList []*ledger.HashHeight, deletedMap map[uint64]uint64) error
func (*AccountChain) WriteBeSnapshot ¶
func (*AccountChain) WriteBlock ¶
func (ac *AccountChain) WriteBlock(batch *leveldb.Batch, accountId uint64, block *ledger.AccountBlock) error
func (*AccountChain) WriteBlockMeta ¶
func (ac *AccountChain) WriteBlockMeta(batch *leveldb.Batch, blockHash *types.Hash, blockMeta *ledger.AccountBlockMeta) error
func (*AccountChain) WriteVmLogList ¶
type BlockEvent ¶
type BlockEvent struct {
// contains filtered or unexported fields
}
func NewBlockEvent ¶
func NewBlockEvent(db *leveldb.DB) *BlockEvent
func (*BlockEvent) AddAccountBlocks ¶
func (be *BlockEvent) AddAccountBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
func (*BlockEvent) AddSnapshotBlocks ¶
func (be *BlockEvent) AddSnapshotBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
func (*BlockEvent) DeleteAccountBlocks ¶
func (be *BlockEvent) DeleteAccountBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
func (*BlockEvent) DeleteSnapshotBlocks ¶
func (be *BlockEvent) DeleteSnapshotBlocks(batch *leveldb.Batch, blockHashList []types.Hash)
func (*BlockEvent) LatestEventId ¶
func (be *BlockEvent) LatestEventId() (uint64, error)
type SnapshotChain ¶
type SnapshotChain struct {
// contains filtered or unexported fields
}
func NewSnapshotChain ¶
func NewSnapshotChain(db *leveldb.DB) *SnapshotChain
func (*SnapshotChain) DeleteToHeight ¶
func (sc *SnapshotChain) DeleteToHeight(batch *leveldb.Batch, toHeight uint64) ([]*ledger.SnapshotBlock, error)
Delete list contains the to height
func (*SnapshotChain) GetLatestBlock ¶
func (sc *SnapshotChain) GetLatestBlock() (*ledger.SnapshotBlock, error)
func (*SnapshotChain) GetSnapshotBlock ¶
func (sc *SnapshotChain) GetSnapshotBlock(height uint64, containsSnapshotContent bool) (*ledger.SnapshotBlock, error)
func (*SnapshotChain) GetSnapshotBlockHeight ¶
func (sc *SnapshotChain) GetSnapshotBlockHeight(snapshotHash *types.Hash) (uint64, error)
func (*SnapshotChain) GetSnapshotBlocks ¶
func (sc *SnapshotChain) GetSnapshotBlocks(height uint64, count uint64, forward, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error)
func (*SnapshotChain) GetSnapshotContent ¶
func (sc *SnapshotChain) GetSnapshotContent(snapshotBlockHeight uint64) (ledger.SnapshotContent, error)
func (*SnapshotChain) WriteSnapshotBlock ¶
func (sc *SnapshotChain) WriteSnapshotBlock(batch *leveldb.Batch, snapshotBlock *ledger.SnapshotBlock) error
func (*SnapshotChain) WriteSnapshotContent ¶
func (sc *SnapshotChain) WriteSnapshotContent(batch *leveldb.Batch, snapshotHeight uint64, snapshotContent ledger.SnapshotContent) error
func (*SnapshotChain) WriteSnapshotHash ¶
Click to show internal directories.
Click to hide internal directories.