Documentation ¶
Index ¶
- Variables
- func IsSetUpGenesis() bool
- type BftChainState
- type CacheChainState
- func (chain *CacheChainState) CurrentBlock() model.AbstractBlock
- func (chain *CacheChainState) Genesis() model.AbstractBlock
- func (chain *CacheChainState) GetBlock(hash common.Hash, number uint64) model.AbstractBlock
- func (chain *CacheChainState) GetBlockByHash(hash common.Hash) model.AbstractBlock
- func (chain *CacheChainState) GetBlockNumber(hash common.Hash) *uint64
- func (chain *CacheChainState) GetBody(hash common.Hash) model.AbstractBody
- func (chain *CacheChainState) GetBodyRLP(hash common.Hash) rlp.RawValue
- func (chain *CacheChainState) GetHeader(hash common.Hash, number uint64) model.AbstractHeader
- func (chain *CacheChainState) GetSlot(block model.AbstractBlock) *uint64
- func (chain *CacheChainState) GetSlotByNum(num uint64) *uint64
- func (chain *CacheChainState) GetVerifiers(slot uint64) []common.Address
- func (chain *CacheChainState) HasBlock(hash common.Hash, number uint64) bool
- func (chain *CacheChainState) HasHeader(hash common.Hash, number uint64) bool
- func (chain *CacheChainState) Rollback(target uint64) error
- func (chain *CacheChainState) SaveBftBlock(block model.AbstractBlock, seenCommits []model.AbstractVerification) error
- type CacheDB
- type Chain
- type ChainHelper
- type CsChainService
- func (cs *CsChainService) CurrentBalance(address common.Address) *big.Int
- func (cs *CsChainService) GetSeenCommit(height uint64) []model.AbstractVerification
- func (cs *CsChainService) GetTransactionNonce(addr common.Address) (nonce uint64, err error)
- func (cs *CsChainService) InitService() error
- func (cs *CsChainService) SaveBlock(block model.AbstractBlock, seenCommits []model.AbstractVerification) error
- func (cs *CsChainService) Stop()
- type CsChainServiceConfig
- type StateHelper
- type StateReader
- type StateWriter
- type TxPool
- type VerifierHelper
Constants ¶
This section is empty.
Variables ¶
View Source
var (
GenesisSetUp bool
)
Functions ¶
func IsSetUpGenesis ¶
func IsSetUpGenesis() bool
Types ¶
type BftChainState ¶
type BftChainState interface { Chain SaveBftBlock(block model.AbstractBlock, seenCommits []model.AbstractVerification) error }
type CacheChainState ¶
type CacheChainState struct { *chain_state.ChainState // contains filtered or unexported fields }
func NewCacheChainState ¶
func NewCacheChainState(cs *chain_state.ChainState) (*CacheChainState, error)
func (*CacheChainState) CurrentBlock ¶
func (chain *CacheChainState) CurrentBlock() model.AbstractBlock
func (*CacheChainState) Genesis ¶
func (chain *CacheChainState) Genesis() model.AbstractBlock
func (*CacheChainState) GetBlock ¶
func (chain *CacheChainState) GetBlock(hash common.Hash, number uint64) model.AbstractBlock
func (*CacheChainState) GetBlockByHash ¶
func (chain *CacheChainState) GetBlockByHash(hash common.Hash) model.AbstractBlock
func (*CacheChainState) GetBlockNumber ¶
func (chain *CacheChainState) GetBlockNumber(hash common.Hash) *uint64
func (*CacheChainState) GetBody ¶
func (chain *CacheChainState) GetBody(hash common.Hash) model.AbstractBody
func (*CacheChainState) GetBodyRLP ¶
func (chain *CacheChainState) GetBodyRLP(hash common.Hash) rlp.RawValue
func (*CacheChainState) GetHeader ¶
func (chain *CacheChainState) GetHeader(hash common.Hash, number uint64) model.AbstractHeader
func (*CacheChainState) GetSlot ¶
func (chain *CacheChainState) GetSlot(block model.AbstractBlock) *uint64
func (*CacheChainState) GetSlotByNum ¶
func (chain *CacheChainState) GetSlotByNum(num uint64) *uint64
func (*CacheChainState) GetVerifiers ¶
func (chain *CacheChainState) GetVerifiers(slot uint64) []common.Address
func (*CacheChainState) HasBlock ¶
func (chain *CacheChainState) HasBlock(hash common.Hash, number uint64) bool
func (*CacheChainState) HasHeader ¶
func (chain *CacheChainState) HasHeader(hash common.Hash, number uint64) bool
func (*CacheChainState) Rollback ¶
func (chain *CacheChainState) Rollback(target uint64) error
func (*CacheChainState) SaveBftBlock ¶
func (chain *CacheChainState) SaveBftBlock(block model.AbstractBlock, seenCommits []model.AbstractVerification) error
type Chain ¶
type Chain interface { StateReader StateWriter VerifierHelper StateHelper ChainHelper }
type ChainHelper ¶
type CsChainService ¶
type CsChainService struct { *CsChainServiceConfig *CacheChainState FutureBlocks *lru.Cache Quit chan struct{} // contains filtered or unexported fields }
func NewCsChainService ¶
func NewCsChainService(config *CsChainServiceConfig, cs *chain_state.ChainState) *CsChainService
func (*CsChainService) CurrentBalance ¶
func (cs *CsChainService) CurrentBalance(address common.Address) *big.Int
func (*CsChainService) GetSeenCommit ¶
func (cs *CsChainService) GetSeenCommit(height uint64) []model.AbstractVerification
func (*CsChainService) GetTransactionNonce ¶
func (cs *CsChainService) GetTransactionNonce(addr common.Address) (nonce uint64, err error)
func (*CsChainService) InitService ¶
func (cs *CsChainService) InitService() error
func (*CsChainService) SaveBlock ¶
func (cs *CsChainService) SaveBlock(block model.AbstractBlock, seenCommits []model.AbstractVerification) error
func (*CsChainService) Stop ¶
func (cs *CsChainService) Stop()
type CsChainServiceConfig ¶
type StateHelper ¶
type StateHelper interface { GetStateStorage() state_processor.StateStorage CurrentState() (*state_processor.AccountStateDB, error) StateAtByBlockNumber(num uint64) (*state_processor.AccountStateDB, error) StateAtByStateRoot(root common.Hash) (*state_processor.AccountStateDB, error) BuildStateProcessor(preAccountStateRoot common.Hash) (*state_processor.AccountStateDB, error) }
type StateReader ¶
type StateReader interface { Genesis() model.AbstractBlock CurrentBlock() model.AbstractBlock CurrentHeader() model.AbstractHeader GetBlock(hash common.Hash, number uint64) model.AbstractBlock GetBlockByHash(hash common.Hash) model.AbstractBlock GetBlockByNumber(number uint64) model.AbstractBlock GetLatestNormalBlock() model.AbstractBlock HasBlock(hash common.Hash, number uint64) bool GetBody(hash common.Hash) model.AbstractBody GetBodyRLP(hash common.Hash) rlp.RawValue GetHeader(hash common.Hash, number uint64) model.AbstractHeader GetHeaderByHash(hash common.Hash) model.AbstractHeader GetHeaderByNumber(number uint64) model.AbstractHeader GetHeaderRLP(hash common.Hash) rlp.RawValue HasHeader(hash common.Hash, number uint64) bool GetBlockNumber(hash common.Hash) *uint64 GetTransaction(txHash common.Hash) (model.AbstractTransaction, common.Hash, uint64, uint64) BlockProcessor(root common.Hash) (*chain.BlockProcessor, error) BlockProcessorByNumber(num uint64) (*chain.BlockProcessor, error) }
type StateWriter ¶
type StateWriter interface { SaveBlock(block model.AbstractBlock) error Rollback(target uint64) error }
type VerifierHelper ¶
type VerifierHelper interface { CurrentSeed() (common.Hash, uint64) IsChangePoint(block model.AbstractBlock, isProcessPackageBlock bool) bool GetLastChangePoint(block model.AbstractBlock) *uint64 GetSlotByNum(num uint64) *uint64 GetSlot(block model.AbstractBlock) *uint64 GetCurrVerifiers() []common.Address GetVerifiers(round uint64) []common.Address GetNextVerifiers() []common.Address NumBeforeLastBySlot(slot uint64) *uint64 BuildRegisterProcessor(preRoot common.Hash) (*registerdb.RegisterDB, error) }
Click to show internal directories.
Click to hide internal directories.