Documentation ¶
Index ¶
- Constants
- Variables
- type BlockMapQueryParam
- type Chain
- type DeleteProcessorFunc
- type DeleteProcessorFuncSuccess
- type InsertProcessorFunc
- type InsertProcessorFuncSuccess
- type NeedSnapshotCache
- func (cache *NeedSnapshotCache) Add(addr *types.Address, accountBlock *ledger.AccountBlock)
- func (cache *NeedSnapshotCache) Get(addr *types.Address) []*ledger.AccountBlock
- func (cache *NeedSnapshotCache) GetBlockByHashHeight(addr *types.Address, hashHeight *ledger.HashHeight) *ledger.AccountBlock
- func (cache *NeedSnapshotCache) GetSnapshotContent() ledger.SnapshotContent
- func (cache *NeedSnapshotCache) HasSnapshot(addr *types.Address, height uint64)
- func (cache *NeedSnapshotCache) Remove(addr *types.Address, height uint64)
- type StateTriePool
Constants ¶
View Source
const ( InsertAccountBlocksEvent = uint8(1) InsertAccountBlocksSuccessEvent = uint8(2) DeleteAccountBlocksEvent = uint8(3) DeleteAccountBlocksSuccessEvent = uint8(4) )
Variables ¶
View Source
var GenesisConsensusGroupBlock ledger.AccountBlock
View Source
var GenesisConsensusGroupBlockVC vmctxt_interface.VmDatabase
View Source
var GenesisMintageBlock ledger.AccountBlock
View Source
var GenesisMintageBlockVC vmctxt_interface.VmDatabase
View Source
var GenesisMintageSendBlock ledger.AccountBlock
View Source
var GenesisMintageSendBlockVC vmctxt_interface.VmDatabase
View Source
var GenesisRegisterBlock ledger.AccountBlock
View Source
var GenesisRegisterBlockVC vmctxt_interface.VmDatabase
View Source
var GenesisSnapshotBlock ledger.SnapshotBlock
View Source
var SecondSnapshotBlock ledger.SnapshotBlock
Functions ¶
This section is empty.
Types ¶
type BlockMapQueryParam ¶
type Chain ¶
type Chain interface { InsertAccountBlocks(vmAccountBlocks []*vm_context.VmAccountBlock) error GetAccountBlocksByHash(addr types.Address, origin *types.Hash, count uint64, forward bool) ([]*ledger.AccountBlock, error) GetAccountBlocksByHeight(addr types.Address, start uint64, count uint64, forward bool) ([]*ledger.AccountBlock, error) GetAccountBlockMap(queryParams map[types.Address]*BlockMapQueryParam) map[types.Address][]*ledger.AccountBlock GetLatestAccountBlock(addr *types.Address) (*ledger.AccountBlock, error) GetAccountBalance(addr *types.Address) (map[types.TokenTypeId]*big.Int, error) GetAccountBalanceByTokenId(addr *types.Address, tokenId *types.TokenTypeId) (*big.Int, error) GetAccountBlockHashByHeight(addr *types.Address, height uint64) (*types.Hash, error) GetAccountBlockByHeight(addr *types.Address, height uint64) (*ledger.AccountBlock, error) GetAccountBlockByHash(blockHash *types.Hash) (*ledger.AccountBlock, error) GetAccountBlocksByAddress(addr *types.Address, index int, num int, count int) ([]*ledger.AccountBlock, error) GetFirstConfirmedAccountBlockBySbHeight(snapshotBlockHeight uint64, addr *types.Address) (*ledger.AccountBlock, error) GetUnConfirmAccountBlocks(addr *types.Address) []*ledger.AccountBlock DeleteAccountBlocks(addr *types.Address, toHeight uint64) (map[types.Address][]*ledger.AccountBlock, error) Init() Compressor() *compress.Compressor ChainDb() *chain_db.ChainDb Start() Destroy() Stop() GenStateTrie(prevStateHash types.Hash, snapshotContent ledger.SnapshotContent) (*trie.Trie, error) GetNeedSnapshotContent() ledger.SnapshotContent InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock) error GetSnapshotBlocksByHash(originBlockHash *types.Hash, count uint64, forward bool, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error) GetSnapshotBlocksByHeight(height uint64, count uint64, forward bool, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetSnapshotBlockByHash(hash *types.Hash) (*ledger.SnapshotBlock, error) GetLatestSnapshotBlock() *ledger.SnapshotBlock GetGenesisSnapshotBlock() *ledger.SnapshotBlock GetConfirmBlock(accountBlockHash *types.Hash) (*ledger.SnapshotBlock, error) GetConfirmTimes(accountBlockHash *types.Hash) (uint64, error) GetSnapshotBlockBeforeTime(blockCreatedTime *time.Time) (*ledger.SnapshotBlock, error) GetConfirmAccountBlock(snapshotHeight uint64, address *types.Address) (*ledger.AccountBlock, error) DeleteSnapshotBlocksToHeight(toHeight uint64) ([]*ledger.SnapshotBlock, map[types.Address][]*ledger.AccountBlock, error) GetContractGidByAccountBlock(block *ledger.AccountBlock) (*types.Gid, error) GetContractGid(addr *types.Address) (*types.Gid, error) GetRegisterList(snapshotHash types.Hash, gid types.Gid) []*contracts.Registration GetVoteMap(snapshotHash types.Hash, gid types.Gid) []*contracts.VoteInfo // Pledge amount GetPledgeAmount(snapshotHash types.Hash, beneficial types.Address) *big.Int // Pledge quota GetPledgeQuota(snapshotHash types.Hash, beneficial types.Address) uint64 GetPledgeQuotas(snapshotHash types.Hash, beneficialList []types.Address) map[types.Address]uint64 GetConsensusGroupList(snapshotHash types.Hash) []*contracts.ConsensusGroupInfo GetBalanceList(snapshotHash types.Hash, tokenTypeId types.TokenTypeId, addressList []types.Address) map[types.Address]*big.Int GetTokenInfoById(tokenId *types.TokenTypeId) *contracts.TokenInfo AccountType(address *types.Address) (uint64, error) GetAccount(address *types.Address) (*ledger.Account, error) GetSubLedgerByHeight(startHeight uint64, count uint64, forward bool) ([]*ledger.CompressedFileMeta, [][2]uint64) GetSubLedgerByHash(startBlockHash *types.Hash, count uint64, forward bool) ([]*ledger.CompressedFileMeta, [][2]uint64, error) GetConfirmSubLedger(fromHeight uint64, toHeight uint64) ([]*ledger.SnapshotBlock, map[types.Address][]*ledger.AccountBlock, error) GetVmLogList(logListHash *types.Hash) (ledger.VmLogList, error) UnRegister(listenerId uint64) RegisterInsertAccountBlocks(processor InsertProcessorFunc) uint64 RegisterInsertAccountBlocksSuccess(processor InsertProcessorFuncSuccess) uint64 RegisterDeleteAccountBlocks(processor DeleteProcessorFunc) uint64 RegisterDeleteAccountBlocksSuccess(processor DeleteProcessorFuncSuccess) uint64 GetStateTrie(stateHash *types.Hash) *trie.Trie NewStateTrie() *trie.Trie // Be GetLatestBlockEventId() (uint64, error) GetEvent(eventId uint64) (byte, []types.Hash, error) }
type DeleteProcessorFunc ¶
type DeleteProcessorFuncSuccess ¶
type DeleteProcessorFuncSuccess func(subLedger map[types.Address][]*ledger.AccountBlock)
type InsertProcessorFunc ¶
type InsertProcessorFunc func(batch *leveldb.Batch, blocks []*vm_context.VmAccountBlock) error
type InsertProcessorFuncSuccess ¶
type InsertProcessorFuncSuccess func(blocks []*vm_context.VmAccountBlock)
type NeedSnapshotCache ¶
type NeedSnapshotCache struct {
// contains filtered or unexported fields
}
func NewNeedSnapshotContent ¶
func NewNeedSnapshotContent(chain *chain, unconfirmedSubLedger map[types.Address][]*ledger.AccountBlock) *NeedSnapshotCache
func (*NeedSnapshotCache) Add ¶
func (cache *NeedSnapshotCache) Add(addr *types.Address, accountBlock *ledger.AccountBlock)
func (*NeedSnapshotCache) Get ¶
func (cache *NeedSnapshotCache) Get(addr *types.Address) []*ledger.AccountBlock
func (*NeedSnapshotCache) GetBlockByHashHeight ¶
func (cache *NeedSnapshotCache) GetBlockByHashHeight(addr *types.Address, hashHeight *ledger.HashHeight) *ledger.AccountBlock
func (*NeedSnapshotCache) GetSnapshotContent ¶
func (cache *NeedSnapshotCache) GetSnapshotContent() ledger.SnapshotContent
func (*NeedSnapshotCache) HasSnapshot ¶
func (cache *NeedSnapshotCache) HasSnapshot(addr *types.Address, height uint64)
type StateTriePool ¶
type StateTriePool struct {
// contains filtered or unexported fields
}
func NewStateTriePool ¶
func NewStateTriePool(chain *chain) *StateTriePool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.