Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peers ¶
type Peers interface {
validators.SetCallbackListener
validators.Connector
// ConnectedWeight returns the currently connected stake weight
ConnectedWeight() uint64
// ConnectedPercent returns the currently connected stake percentage [0, 1]
ConnectedPercent() float64
// SampleValidator returns a randomly selected connected validator. If there
// are no currently connected validators then it will return false.
SampleValidator() (ids.NodeID, bool)
// GetValidators returns the set of all validators
// known to this peer manager
GetValidators() set.Set[ids.NodeID]
// ConnectedValidators returns the set of all validators
// that are currently connected
ConnectedValidators() set.Set[ids.NodeID]
}
func NewMeteredPeers ¶
func NewMeteredPeers(reg prometheus.Registerer) (Peers, error)
Click to show internal directories.
Click to hide internal directories.