Documentation
¶
Index ¶
- Constants
- Variables
- func NewBlackBlock(chain *chain, isOpen bool) *blackBlock
- type BlockMapQueryParam
- type Chain
- type ConditionRegisterData
- type ConsensusGroupInfo
- type DeleteProcessorFunc
- type DeleteProcessorFuncSuccess
- type DeleteSnapshotBlocksSuccess
- type GenesisConfig
- type InsertProcessorFunc
- type InsertProcessorFuncSuccess
- type InsertSnapshotBlocksSuccess
- type NeedSnapshotCache
- func (cache *NeedSnapshotCache) BeSnapshot(subLedger ledger.SnapshotContent)
- func (cache *NeedSnapshotCache) Get(addr *types.Address) *ledger.AccountBlock
- func (cache *NeedSnapshotCache) GetBlockByHash(addr *types.Address, hash types.Hash) *ledger.AccountBlock
- func (cache *NeedSnapshotCache) GetSnapshotContent() ledger.SnapshotContent
- func (cache *NeedSnapshotCache) Rebuild()
- func (cache *NeedSnapshotCache) Remove(addrList []types.Address)
- func (cache *NeedSnapshotCache) Set(subLedger map[types.Address]*ledger.AccountBlock)
- type StateTriePool
- type VoteConditionData
Constants ¶
View Source
const ( InsertAccountBlocksEvent = uint8(1) InsertAccountBlocksSuccessEvent = uint8(2) DeleteAccountBlocksEvent = uint8(3) DeleteAccountBlocksSuccessEvent = uint8(4) InsertSnapshotBlocksSuccessEvent = uint8(6) DeleteSnapshotBlocksSuccessEvent = uint8(8) )
View Source
const ( SAVE_TRIE_STATUS_STOPPED = 1 SAVE_TRIE_STATUS_STARTED = 2 )
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 ¶
func NewBlackBlock ¶
func NewBlackBlock(chain *chain, isOpen bool) *blackBlock
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)
GetAllLatestAccountBlock() ([]*ledger.AccountBlock, 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
TrieGc() trie_gc.Collector
StopSaveTrie()
StartSaveTrie()
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
GetAccountBlockMetaByHash(hash *types.Hash) (*ledger.AccountBlockMeta, 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)
GetSnapshotBlockHeadByHeight(height uint64) (*ledger.SnapshotBlock, error)
GetSnapshotBlockByHash(hash *types.Hash) (*ledger.SnapshotBlock, error)
GetSnapshotBlockHeadByHash(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) ([]*types.Registration, error)
GetVoteMap(snapshotHash types.Hash, gid types.Gid) ([]*types.VoteInfo, error)
KafkaSender() *sender.KafkaSender
// Pledge amount
GetPledgeAmount(snapshotHash types.Hash, beneficial types.Address) (*big.Int, error)
// Pledge quota
GetPledgeQuota(snapshotHash types.Hash, beneficial types.Address) (uint64, error)
GetPledgeQuotas(snapshotHash types.Hash, beneficialList []types.Address) (map[types.Address]uint64, error)
GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error)
GetBalanceList(snapshotHash types.Hash, tokenTypeId types.TokenTypeId, addressList []types.Address) (map[types.Address]*big.Int, error)
GetTokenInfoById(tokenId *types.TokenTypeId) (*types.TokenInfo, error)
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)
TrieDb() *leveldb.DB
CleanTrieNodePool()
RegisterInsertAccountBlocks(processor InsertProcessorFunc) uint64
RegisterInsertAccountBlocksSuccess(processor InsertProcessorFuncSuccess) uint64
RegisterDeleteAccountBlocks(processor DeleteProcessorFunc) uint64
RegisterDeleteAccountBlocksSuccess(processor DeleteProcessorFuncSuccess) uint64
RegisterInsertSnapshotBlocksSuccess(processor InsertSnapshotBlocksSuccess) uint64
RegisterDeleteSnapshotBlocksSuccess(processor DeleteSnapshotBlocksSuccess) uint64
GetConfirmSubLedgerBySnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) (map[types.Address][]*ledger.AccountBlock, error)
GetStateTrie(stateHash *types.Hash) *trie.Trie
NewStateTrie() *trie.Trie
IsGenesisSnapshotBlock(block *ledger.SnapshotBlock) bool
// Be
GetLatestBlockEventId() (uint64, error)
GetEvent(eventId uint64) (byte, []types.Hash, error)
// onroad
IsSuccessReceived(addr *types.Address, hash *types.Hash) bool
// contains filtered or unexported methods
}
type ConditionRegisterData ¶
type ConditionRegisterData struct {
PledgeAmount *big.Int
PledgeToken types.TokenTypeId
PledgeHeight uint64
}
type ConsensusGroupInfo ¶
type ConsensusGroupInfo struct {
NodeCount uint8
Interval int64
PerCount int64
RandCount uint8
RandRank uint8
CountingTokenId types.TokenTypeId
RegisterConditionId uint8
RegisterConditionParam ConditionRegisterData
VoteConditionId uint8
VoteConditionParam VoteConditionData
Owner types.Address
PledgeAmount *big.Int
WithdrawHeight uint64
}
type DeleteProcessorFunc ¶
type DeleteProcessorFuncSuccess ¶
type DeleteProcessorFuncSuccess func(subLedger map[types.Address][]*ledger.AccountBlock)
type DeleteSnapshotBlocksSuccess ¶
type DeleteSnapshotBlocksSuccess func([]*ledger.SnapshotBlock)
type GenesisConfig ¶
type GenesisConfig struct {
GenesisAccountAddress types.Address
BlockProducers []types.Address
SnapshotConsensusGroup *ConsensusGroupInfo
CommonConsensusGroup *ConsensusGroupInfo
}
type InsertProcessorFunc ¶
type InsertProcessorFunc func(batch *leveldb.Batch, blocks []*vm_context.VmAccountBlock) error
type InsertProcessorFuncSuccess ¶
type InsertProcessorFuncSuccess func(blocks []*vm_context.VmAccountBlock)
type InsertSnapshotBlocksSuccess ¶
type InsertSnapshotBlocksSuccess func([]*ledger.SnapshotBlock)
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) BeSnapshot ¶
func (cache *NeedSnapshotCache) BeSnapshot(subLedger ledger.SnapshotContent)
func (*NeedSnapshotCache) Get ¶
func (cache *NeedSnapshotCache) Get(addr *types.Address) *ledger.AccountBlock
func (*NeedSnapshotCache) GetBlockByHash ¶
func (cache *NeedSnapshotCache) GetBlockByHash(addr *types.Address, hash types.Hash) *ledger.AccountBlock
func (*NeedSnapshotCache) GetSnapshotContent ¶
func (cache *NeedSnapshotCache) GetSnapshotContent() ledger.SnapshotContent
func (*NeedSnapshotCache) Rebuild ¶
func (cache *NeedSnapshotCache) Rebuild()
func (*NeedSnapshotCache) Remove ¶
func (cache *NeedSnapshotCache) Remove(addrList []types.Address)
func (*NeedSnapshotCache) Set ¶
func (cache *NeedSnapshotCache) Set(subLedger map[types.Address]*ledger.AccountBlock)
type StateTriePool ¶
type StateTriePool struct {
// contains filtered or unexported fields
}
func NewStateTriePool ¶
func NewStateTriePool(chain *chain) *StateTriePool
func (*StateTriePool) Delete ¶
func (pool *StateTriePool) Delete(addrList []types.Address)
type VoteConditionData ¶
type VoteConditionData struct {
Amount *big.Int
TokenId types.TokenTypeId
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.