Versions in this module Expand all Collapse all v1 v1.14.2 Aug 2, 2025 Changes in this version + type Config struct + AlphaConfidence int + AlphaPreference int + Type ThresholdType + type DynamicWaveThreshold struct + func NewDynamicWaveThreshold(alphaPreference, alphaConfidence int) *DynamicWaveThreshold + func (d *DynamicWaveThreshold) AddVote(nodeID ids.NodeID, choice ids.ID) bool + func (d *DynamicWaveThreshold) CheckConfidence() (ids.ID, bool) + func (d *DynamicWaveThreshold) CheckPreference() (ids.ID, bool) + func (d *DynamicWaveThreshold) GetLeader() (ids.ID, int) + func (d *DynamicWaveThreshold) GetThreshold() int + func (d *DynamicWaveThreshold) GetTotalVotes() int + func (d *DynamicWaveThreshold) GetVoteCount(choice ids.ID) int + func (d *DynamicWaveThreshold) Reset() + func (d *DynamicWaveThreshold) SetMode(preferenceMode bool) + type Factory struct + func NewFactory(alphaPreference, alphaConfidence int) *Factory + func (f *Factory) New(thresholdType ThresholdType) Threshold + func (f *Factory) NewDynamic() Threshold + func (f *Factory) NewStatic() Threshold + type StaticWaveThreshold struct + func NewStaticWaveThreshold(alpha int) *StaticWaveThreshold + func (s *StaticWaveThreshold) AddVote(nodeID ids.NodeID, choice ids.ID) bool + func (s *StaticWaveThreshold) GetLeader() (ids.ID, int) + func (s *StaticWaveThreshold) GetThreshold() int + func (s *StaticWaveThreshold) GetTotalVotes() int + func (s *StaticWaveThreshold) GetVoteCount(choice ids.ID) int + func (s *StaticWaveThreshold) GetWavePattern() *WavePattern + func (s *StaticWaveThreshold) Reset() + type Threshold interface + AddVote func(nodeID ids.NodeID, choice ids.ID) bool + GetLeader func() (ids.ID, int) + GetThreshold func() int + GetTotalVotes func() int + GetVoteCount func(choice ids.ID) int + Reset func() + func NewFromConfig(cfg Config) Threshold + type ThresholdType int + const Adaptive + const Dynamic + const Static + type WavePattern struct + Choices map[ids.ID]int + Threshold int + TotalVotes int + func (w *WavePattern) GetAmplitude(choice ids.ID) int + func (w *WavePattern) IsConstructive() bool Other modules containing this package github.com/luxfi/node/v2