Documentation
¶
Index ¶
- Constants
- Variables
- func NewNominateValue() nominateValue
- func NewRevokeValue() revokeValue
- func NewSchedule(xconfig *tdposConfig, log logs.Logger, ledger cctx.LedgerRely, ...) *tdposSchedule
- func NewTdposConsensus(cCtx cctx.ConsensusCtx, cCfg def.ConsensusConfig) consensus.ConsensusImplInterface
- func NewvoteValue() voteValue
- func ParseConsensusStorage(block cctx.BlockInterface) (interface{}, error)
- type TdposStatus
- type ValidatorsInfo
Constants ¶
View Source
const ( MAXSLEEPTIME = 1000 MAXMAPSIZE = 1000 MAXHISPROPOSERSSIZE = 100 NOMINATETYPE = "nominate" VOTETYPE = "vote" )
Variables ¶
View Source
var ( ErrInvalidProposer = errors.New("invalid proposer") ErrTimeoutBlock = errors.New("new block is out of date") ErrHeightTooLow = errors.New("target height is lower than 4") ErrNominateAddr = errors.New("addr in nominate candidate tx can not be empty") ErrVoteNominate = errors.New("addr in vote candidate hasn't been nominated") ErrAmount = errors.New("amount in contract can not be empty") ErrAuth = errors.New("candidate has not authenticated your submission") ErrRepeatNominate = errors.New("candidate had been nominate") ErrEmptyNominateKey = errors.New("no valid candidate key when revoke") ErrValueNotFound = errors.New("value not found, please check your input parameters") ErrSchedule = errors.New("minerScheduling overflow") ErrNotFound = errors.New("Key not found") )
Functions ¶
func NewNominateValue ¶
func NewNominateValue() nominateValue
func NewRevokeValue ¶
func NewRevokeValue() revokeValue
func NewSchedule ¶
func NewSchedule(xconfig *tdposConfig, log logs.Logger, ledger cctx.LedgerRely, startHeight int64) *tdposSchedule
NewSchedule 新建schedule实例
func NewTdposConsensus ¶
func NewTdposConsensus(cCtx cctx.ConsensusCtx, cCfg def.ConsensusConfig) consensus.ConsensusImplInterface
func NewvoteValue ¶
func NewvoteValue() voteValue
func ParseConsensusStorage ¶
func ParseConsensusStorage(block cctx.BlockInterface) (interface{}, error)
Types ¶
type TdposStatus ¶
type TdposStatus struct { Name string Version int64 `json:"version"` StartHeight int64 `json:"startHeight"` Index int `json:"index"` // contains filtered or unexported fields }
tdposStatus 实现了ConsensusStatus接口
func (*TdposStatus) GetConsensusBeginInfo ¶
func (t *TdposStatus) GetConsensusBeginInfo() int64
func (*TdposStatus) GetCurrentValidatorsInfo ¶
func (t *TdposStatus) GetCurrentValidatorsInfo() []byte
获取当前矿工信息
func (*TdposStatus) GetStepConsensusIndex ¶
func (t *TdposStatus) GetStepConsensusIndex() int
获取共识item所在consensus slice中的index
Click to show internal directories.
Click to hide internal directories.