Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accepted ¶
type Accepted interface { validators.SetCallbackListener // SetLastAccepted updates the latest accepted block for [nodeID] to // [blockID]. If [nodeID] is not currently a validator, this is a noop. SetLastAccepted(nodeID ids.NodeID, blockID ids.ID) // LastAccepted returns the latest known accepted block of [nodeID]. If // [nodeID]'s last accepted block was never unknown, false will be returned. LastAccepted(nodeID ids.NodeID) (ids.ID, bool) }
func NewAccepted ¶
func NewAccepted() Accepted
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 // TotalWeight returns the total validator weight TotalWeight() uint64 // SampleValidator returns a randomly selected connected validator. If there // are no currently connected validators then it will return false. SampleValidator() (ids.NodeID, bool) // PreferredPeers returns the currently connected validators. If there are // no currently connected validators then it will return the currently // connected peers. PreferredPeers() set.Set[ids.NodeID] }
func NewMeteredPeers ¶
func NewMeteredPeers(namespace string, reg prometheus.Registerer) (Peers, error)
Click to show internal directories.
Click to hide internal directories.