validator

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 10 Imported by: 0

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