validator

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// RoleActive is the role of the validator that is active
	RoleActive = "active"
	// RolePassive is the role of the validator that is passive
	RolePassive = "passive"
	// RoleUnknown is the role of the validator that is unknown
	RoleUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Cluster         string
	SyncConfig      config.Sync
	ValidatorConfig config.Validator
}

Options represents the options for creating a new Validator

type State

type State struct {
	Cluster           string
	VersionString     string
	HealthStatus      string
	IdentityPublicKey string
	Version           *version.Version
}

State represents the state of the validator

type Validator

type Validator struct {
	ActiveIdentityPublicKey  string
	PassiveIdentityPublicKey string
	State                    State
	// contains filtered or unexported fields
}

Validator represents the validator - its state can be refreshed with the RefreshState method

func New

func New(opts Options) (v *Validator, err error)

New creates a new Validator

func (*Validator) IsActive

func (v *Validator) IsActive() bool

IsActive checks if the validator is the active identity

func (*Validator) IsPassive

func (v *Validator) IsPassive() bool

IsPassive checks if the validator is the passive identity cover cases like testnet where a validator could be given the same active and passive identity in that case, we assume active

func (*Validator) IsRoleUnknown

func (v *Validator) IsRoleUnknown() bool

IsRoleUnknown checks if the validator is running with an identity that does not match active or passive identities

func (*Validator) Role

func (v *Validator) Role() string

Role gets the role of the validator

func (*Validator) SyncVersion

func (v *Validator) SyncVersion() (err error)

SyncVersion syncs the validator's version

Jump to

Keyboard shortcuts

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