Documentation ¶
Index ¶
- func CalActiveBlock(endVotingBlock uint64) uint64
- func CalEndVotingBlock(blockNumber uint64, endVotingRounds uint64) uint64
- func CalEndVotingBlockForParamProposal(blockNumber uint64, endVotingEpochRounds uint64) uint64
- func CalcBlocksEachEpoch() uint64
- func CalcBlocksEachYear() uint64
- func CalcConsensusRounds(seconds uint64) uint64
- func CalcEpochDuration() uint64
- func CalcEpochRounds(seconds uint64) uint64
- func CalcVersion(programVersion uint32) uint32
- func CalculateEpoch(blockNumber uint64) uint64
- func CalculateLastYear(blockNumber uint64) uint32
- func CalculateRound(blockNumber uint64) uint64
- func CalculateYear(blockNumber uint64) uint32
- func ConsensusSize() uint64
- func EpochSize() uint64
- func EpochsPerYear() uint64
- func InHashList(hash common.Hash, hashList []common.Hash) bool
- func InNodeIDList(nodeID discover.NodeID, nodeIDList []discover.NodeID) bool
- func IsBeginOfConsensus(blockNumber uint64) bool
- func IsBeginOfEpoch(blockNumber uint64) bool
- func IsElection(blockNumber uint64) bool
- func IsEndOfConsensus(blockNumber uint64) bool
- func IsEndOfEpoch(blockNumber uint64) bool
- func IsSpecialBlock(blockNumber uint64) bool
- func IsWorker(extra []byte) bool
- func IsYearBegin(blockNumber uint64) bool
- func IsYearEnd(blockNumber uint64) bool
- func NodeId2Addr(nodeId discover.NodeID) (common.Address, error)
- func ProgramVersion2Str(programVersion uint32) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalActiveBlock ¶
active-block = the begin of a consensus period, so, it is possible that active-block also is the begin of a epoch.
func CalEndVotingBlock ¶
end-voting-block = the end block of a consensus period - electionDistance, end-voting-block must be a Consensus Election block
func CalEndVotingBlockForParamProposal ¶ added in v0.7.4
func CalcBlocksEachEpoch ¶
func CalcBlocksEachEpoch() uint64
CalcBlocksEachEpoch return how many blocks per epoch
func CalcBlocksEachYear ¶
func CalcBlocksEachYear() uint64
calculate returns how many blocks per year.
func CalcConsensusRounds ¶ added in v0.7.4
func CalcEpochDuration ¶ added in v0.7.4
func CalcEpochDuration() uint64
CalcBlocksEachEpoch returns the epoch duration in seconds
func CalcEpochRounds ¶ added in v0.7.4
func CalcVersion ¶
The ProgramVersion: Major.Minor.Patch eg. 1.1.0 Calculate the LargeVersion eg: 1.1.x ==> 1.1.0
func CalculateEpoch ¶
calculate the Epoch number by blockNumber
func CalculateLastYear ¶
func CalculateRound ¶
calculate the Consensus number by blockNumber
func CalculateYear ¶
calculate the year by blockNumber. (V.0.1) If blockNumber eqs 0, year eqs 0 too, else rounded up the result of the blockNumber divided by the expected number of blocks per year
func ConsensusSize ¶
func ConsensusSize() uint64
ConsensusSize returns how many blocks per consensus round.
func IsBeginOfConsensus ¶ added in v0.7.3
IsBeginOfConsensus returns true if current block is the first block of a Consensus Cycle
func IsBeginOfEpoch ¶ added in v0.7.3
IsBeginOfEpoch returns true if current block is the first block of a Epoch
func IsElection ¶
func IsEndOfConsensus ¶ added in v0.7.3
func IsEndOfEpoch ¶ added in v0.7.3
func IsSpecialBlock ¶
func IsYearBegin ¶ added in v0.7.3
Types ¶
This section is empty.