Documentation ¶
Index ¶
- Constants
- func ConvertVoteToAddress(votes []*Vote) []types.Address
- func NewAlgo(info *GroupInfo) *algo
- type Algo
- type BaseStats
- type BigInt
- type ByBalance
- type BySuccessRate
- type DayStats
- type GroupInfo
- type HourStats
- type MemberPlan
- type PeriodStats
- type SBPStatReader
- type SbpStats
- type SeedInfo
- type SuccessRateVote
- type TimeIndex
- type Vote
- type VoteAlgoContext
- type VoteType
Constants ¶
View Source
const ( NORMAL = VoteType(0) SUCCESS_RATE_PROMOTION = VoteType(1) SUCCESS_RATE_DEMOTION = VoteType(2) RANDOM_PROMOTION = VoteType(3) )
View Source
const (
Line = 800000
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Algo ¶
type Algo interface { ShuffleVotes(votes []*Vote, hashH *ledger.HashHeight, info *SeedInfo) []*Vote FilterVotes(context *VoteAlgoContext) []*Vote FilterSimple(votes []*Vote) ([]*Vote, []*Vote) }
type BaseStats ¶
type BigInt ¶
type BySuccessRate ¶
type BySuccessRate []*SuccessRateVote
func (BySuccessRate) Len ¶
func (a BySuccessRate) Len() int
func (BySuccessRate) Less ¶
func (a BySuccessRate) Less(i, j int) bool
func (BySuccessRate) Swap ¶
func (a BySuccessRate) Swap(i, j int)
type DayStats ¶
type GroupInfo ¶
type GroupInfo struct { TimeIndex types.ConsensusGroupInfo GenesisTime time.Time 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
type MemberPlan ¶
type SBPStatReader ¶
type SBPStatReader interface { DayStats(startIndex uint64, endIndex uint64) ([]*DayStats, error) GetDayTimeIndex() TimeIndex HourStats(startIndex uint64, endIndex uint64) ([]*HourStats, error) GetHourTimeIndex() TimeIndex PeriodStats(startIndex uint64, endIndex uint64) ([]*PeriodStats, error) GetPeriodTimeIndex() TimeIndex GetSuccessRateByHour(index uint64) (map[types.Address]int32, error) GetNodeCount() int }
type SbpStats ¶
type SeedInfo ¶
type SeedInfo struct {
// contains filtered or unexported fields
}
type TimeIndex ¶
type Vote ¶
type VoteAlgoContext ¶
type VoteAlgoContext struct {
// contains filtered or unexported fields
}
func NewVoteAlgoContext ¶
func NewVoteAlgoContext(votes []*Vote, hashH *ledger.HashHeight, successRate map[types.Address]int32, seeds *SeedInfo) *VoteAlgoContext
Click to show internal directories.
Click to hide internal directories.