Documentation
¶
Index ¶
- func ConvertVoteToAddress(votes []*Vote) []types.Address
- func NewAlgo(info *GroupInfo) *algo
- type Algo
- type ByBalance
- type ConsensusReader
- type Detail
- type GroupInfo
- func (self *GroupInfo) GenETime(index uint64) time.Time
- func (self *GroupInfo) GenPlan(index uint64, members []*Vote) []*MemberPlan
- func (self *GroupInfo) GenPlanByAddress(index uint64, members []types.Address) []*MemberPlan
- func (self *GroupInfo) GenSTime(index uint64) time.Time
- func (self *GroupInfo) GenVoteTime(index uint64) time.Time
- func (self *GroupInfo) String() string
- func (self *GroupInfo) Time2Index(t time.Time) uint64
- type MemberPlan
- type PeriodDetails
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertVoteToAddress ¶
Types ¶
type Algo ¶
type Algo interface {
ShuffleVotes(votes []*Vote, hashH *ledger.HashHeight) []*Vote
FilterVotes(votes []*Vote, hashH *ledger.HashHeight) []*Vote
FilterSimple(votes []*Vote) []*Vote
}
type ConsensusReader ¶
type ConsensusReader interface {
PeriodTime() (uint64, error)
TimeToIndex(time time.Time) (uint64, error)
// return
VoteDetails(startIndex, endIndex uint64, register *types.Registration, r stateCh) (*Detail, error)
}
func NewReader ¶
func NewReader(genesisTime time.Time, info *types.ConsensusGroupInfo) ConsensusReader
type Detail ¶
type Detail struct {
PlanNum uint64 // member plan cnt
ActualNum uint64 // member actual cnt
//top100, index: nodeName: balance
PeriodM map[uint64]*PeriodDetails
}
type GroupInfo ¶
type GroupInfo struct {
types.ConsensusGroupInfo
PlanInterval uint64
// contains filtered or unexported fields
}
func NewGroupInfo ¶
func NewGroupInfo(genesisTime time.Time, info types.ConsensusGroupInfo) *GroupInfo
func (*GroupInfo) GenPlan ¶
func (self *GroupInfo) GenPlan(index uint64, members []*Vote) []*MemberPlan
func (*GroupInfo) GenPlanByAddress ¶
func (self *GroupInfo) GenPlanByAddress(index uint64, members []types.Address) []*MemberPlan
type MemberPlan ¶
type PeriodDetails ¶
Click to show internal directories.
Click to hide internal directories.