Documentation ¶
Index ¶
- Constants
- func GetChainConfig(store protocol.BlockchainStore) (*configPb.ChainConfig, error)
- func GetLatestEpochInfo(store protocol.BlockchainStore) (*syscontract.Epoch, error)
- func GetNodeIDsFromValidators(store protocol.BlockchainStore, validators []string) ([]string, error)
- func GetValidatorList(chainConfig *configPb.ChainConfig, store protocol.BlockchainStore) (validators []string, err error)
- func GetValidatorListFromLedger(store protocol.BlockchainStore) (validators []string, err error)
- func ValidatorsElection(infos []*pbdpos.CandidateInfo, n int, seed []byte, outSort bool) ([]*pbdpos.CandidateInfo, error)
- type CandidateInfos
- type DPoSImpl
- func (impl *DPoSImpl) CreateRWSet(preBlkHash []byte, proposedBlock *consensus.ProposalBlock) error
- func (impl *DPoSImpl) GetConsensusStateJSON() ([]byte, error)
- func (impl *DPoSImpl) GetLastHeight() uint64
- func (impl *DPoSImpl) GetValidators() ([]string, error)
- func (impl *DPoSImpl) SetConsensusEngine(engine protocol.ConsensusEngine)
- func (impl *DPoSImpl) Start() error
- func (impl *DPoSImpl) Stop() error
- func (impl *DPoSImpl) VerifyConsensusArgs(block *common.Block, blockTxRwSet map[string]*common.TxRWSet) (err error)
- type DPoSState
- type NodeInfo
Constants ¶
View Source
const DposOrgId = "dpos_org_id"
View Source
const ModuleName = "dpos_module"
Variables ¶
This section is empty.
Functions ¶
func GetChainConfig ¶
func GetChainConfig(store protocol.BlockchainStore) (*configPb.ChainConfig, error)
func GetLatestEpochInfo ¶
func GetLatestEpochInfo(store protocol.BlockchainStore) (*syscontract.Epoch, error)
func GetNodeIDsFromValidators ¶
func GetNodeIDsFromValidators(store protocol.BlockchainStore, validators []string) ([]string, error)
func GetValidatorList ¶
func GetValidatorList(chainConfig *configPb.ChainConfig, store protocol.BlockchainStore) (validators []string, err error)
func GetValidatorListFromLedger ¶
func GetValidatorListFromLedger(store protocol.BlockchainStore) (validators []string, err error)
func ValidatorsElection ¶
func ValidatorsElection( infos []*pbdpos.CandidateInfo, n int, seed []byte, outSort bool) ([]*pbdpos.CandidateInfo, error)
ValidatorsElection select validators from Candidates
Types ¶
type CandidateInfos ¶
type CandidateInfos []*pbdpos.CandidateInfo
CandidateInfos array for sort
func (CandidateInfos) Len ¶
func (s CandidateInfos) Len() int
func (CandidateInfos) Less ¶
func (s CandidateInfos) Less(i, j int) bool
func (CandidateInfos) Swap ¶
func (s CandidateInfos) Swap(i, j int)
type DPoSImpl ¶
type DPoSImpl struct { protocol.ConsensusEngine // contains filtered or unexported fields }
func NewDPoSImpl ¶
func NewDPoSImpl(config *consensusUtils.ConsensusImplConfig, baseConsensusEngine protocol.ConsensusExtendEngine) *DPoSImpl
NewDPoSImpl create dpos instance with config and base consensus engine
func (*DPoSImpl) CreateRWSet ¶
func (impl *DPoSImpl) CreateRWSet(preBlkHash []byte, proposedBlock *consensus.ProposalBlock) error
func (*DPoSImpl) GetConsensusStateJSON ¶
func (*DPoSImpl) GetLastHeight ¶
func (*DPoSImpl) GetValidators ¶
func (*DPoSImpl) SetConsensusEngine ¶
func (impl *DPoSImpl) SetConsensusEngine(engine protocol.ConsensusEngine)
Click to show internal directories.
Click to hide internal directories.