active

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func CheckIfNodeActive(node models.Node, repos *repositories.Repos) (bool, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL