Documentation
¶
Index ¶
- Constants
- func ActivateNodeIfReady(nodeID string, repos repositories.Repos) error
- func CheckIfMetricsValid(nodeID string, repos *repositories.Repos) (bool, error)
- func CheckIfNodeActive(node models.Node, repos *repositories.Repos) (bool, error)
- func CheckIfPingActive(nodeID string, repos *repositories.Repos) (bool, error)
Constants ¶
View Source
const ( IntervalFromLastPing = 10 * time.Second AllowedBlocksBehind = 10 TargetBlockBuffer = 10 )
Variables ¶
This section is empty.
Functions ¶
func ActivateNodeIfReady ¶
func ActivateNodeIfReady(nodeID string, repos repositories.Repos) error
ActivateNodeIfReady adds node to active nodes if latest metrics are valid and node is not penalized
func CheckIfMetricsValid ¶
func CheckIfMetricsValid(nodeID string, repos *repositories.Repos) (bool, error)
CheckIfMetricsValid checks if nodes last recorded BestBlockHeight and FinalizedBlockHeight are lagging more than AllowedBlocksBehind blocks
func CheckIfNodeActive ¶
CheckIfNodeActive checks if nodes last recorded ping is in last IntervalFromLastPing and if nodes last recorded BestBlockHeight and FinalizedBlockHeight are lagging more than AllowedBlocksBehind blocks
func CheckIfPingActive ¶
func CheckIfPingActive(nodeID string, repos *repositories.Repos) (bool, error)
CheckIfPingActive checks if nodes last recorded ping is in last IntervalFromLastPing
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.