Documentation ¶
Index ¶
- func CalActiveBlock(endVotingBlock uint64) uint64
- func CalEndVotingBlock(blockNumber uint64, endVotingRounds uint64) uint64
- func CalcBlocksEachEpoch() uint64
- func CalcBlocksEachYear() uint64
- func CalcVersion(programVersion uint32) uint32
- func CalculateEpoch(blockNumber uint64) uint64
- func CalculateRound(blockNumber uint64) uint64
- func ConsensusSize() uint64
- func EpochSize() uint64
- func EpochsPerYear() uint64
- func EstimateConsensusRoundsForGov(seconds uint64) uint64
- func EstimateEndVotingBlockForParaProposal(blockNumber uint64, seconds uint64) 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 IsEndOfEpoch(blockNumber uint64) bool
- func IsWorker(extra []byte) bool
- func NodeId2Addr(nodeId discover.NodeID) (common.NodeAddress, 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 CalcBlocksEachEpoch ¶
func CalcBlocksEachEpoch() uint64
CalcBlocksEachEpoch return how many blocks per epoch
func CalcBlocksEachYear ¶
func CalcBlocksEachYear() uint64
calculate returns how many blocks per year.
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 CalculateRound ¶
calculate the Consensus number by blockNumber
func ConsensusSize ¶
func ConsensusSize() uint64
ConsensusSize returns how many blocks per consensus round.
func IsBeginOfConsensus ¶
IsBeginOfConsensus returns true if current block is the first block of a Consensus Cycle
func IsBeginOfEpoch ¶
IsBeginOfEpoch returns true if current block is the first block of a Epoch
func IsElection ¶
func IsEndOfEpoch ¶
func NodeId2Addr ¶
func NodeId2Addr(nodeId discover.NodeID) (common.NodeAddress, error)
Types ¶
This section is empty.