config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 11 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// Name is the Solana cluster this validator is running on. One of mainnet-beta or testnet
	Name string `koanf:"name"`
}

Cluster represents the Solana cluster configuration

func (*Cluster) Validate

func (c *Cluster) Validate() error

Validate validates the cluster configuration

type Config

type Config struct {
	// Log configuration
	Log Log `koanf:"log"`
	// Validator is the local validator configuration
	Validator Validator `koanf:"validator"`
	// Cluster is the Solana cluster configuration
	Cluster Cluster `koanf:"cluster"`
	// Sync is the version sync configuration
	Sync Sync `koanf:"sync"`
	// File is the file that the config was loaded from
	File string `koanf:"-"`
	// contains filtered or unexported fields
}

Config represents the complete configuration

func New

func New() (config *Config, err error)

New creates a new Config

func NewFromConfigFile

func NewFromConfigFile(configFile string) (*Config, error)

NewFromConfigFile creates a new Config from a config file path

func (*Config) Initialize

func (c *Config) Initialize() error

Initialize processes and validates the loaded configuration

func (*Config) LoadFromFile

func (c *Config) LoadFromFile(filePath string) error

LoadFromFile loads configuration from file into the struct

type Identities

type Identities struct {
	// ActiveKeyPairFile is the legacy path to the active identity keyfile
	ActiveKeyPairFile string `koanf:"active"`
	// ActivePublicKey is the active validator identity public key
	ActivePublicKey string `koanf:"active_pubkey"`
	// PassiveKeyPairFile is the legacy path to the passive identity keyfile
	PassiveKeyPairFile string `koanf:"passive"`
	// PassivePublicKey is the passive validator identity public key
	PassivePublicKey string `koanf:"passive_pubkey"`
	// ActiveKeyPair is the loaded active keypair
	ActiveKeyPair solana.PrivateKey `koanf:"-"`
	// PassiveKeyPair is the loaded passive keypair
	PassiveKeyPair solana.PrivateKey `koanf:"-"`
}

Identities represents public-key and legacy keypair validator identity configuration.

func (*Identities) ActiveIdentityPublicKey added in v0.1.41

func (i *Identities) ActiveIdentityPublicKey() string

ActiveIdentityPublicKey returns the configured or loaded active identity public key.

func (*Identities) Load

func (i *Identities) Load() (err error)

Load loads the identity keypairs from files

func (*Identities) PassiveIdentityPublicKey added in v0.1.41

func (i *Identities) PassiveIdentityPublicKey() string

PassiveIdentityPublicKey returns the configured or loaded passive identity public key.

type Log

type Log struct {
	// Level is the log level - one of "debug", "info", "warn", "error", "fatal", defaults to "info", overwritable by --log-level command line flag
	Level string `koanf:"level"`
	// Format is the log format - one of "text" or "json" or "logfmt", defaults to text
	Format string `koanf:"format"`
	// ParsedLevel is the parsed log level
	ParsedLevel log.Level `koanf:"-"`
	// ParsedFormat is the parsed log format
	ParsedFormatter log.Formatter `koanf:"-"`
}

Log represents the logging configuration

func (*Log) ConfigureWithLevelString

func (l *Log) ConfigureWithLevelString(logLevel string)

ConfigureWithLevelString configures the logger with the supplied settings If logLevel is provided and different from the config level, it overrides the config

func (*Log) SetLevelString

func (l *Log) SetLevelString(logLevel string)

SetLevelString sets the log level from a string

func (*Log) Validate

func (l *Log) Validate() (err error)

Validate validates the log configuration

type Sync

type Sync struct {
	// EnabledWhenActive enables sync when the validator is active
	EnabledWhenActive bool `koanf:"enabled_when_active"`
	// EnabledWhenNoActiveLeaderInGossip enables sync when there is no active leader in gossip
	EnabledWhenNoActiveLeaderInGossip bool `koanf:"enabled_when_no_active_leader_in_gossip"`
	// EnableSFDPCompliance enables SFDP compliance checking
	EnableSFDPCompliance bool `koanf:"enable_sfdp_compliance"`
	// Commands are the commands to run when there is a version change
	Commands []sync_commands.Command `koanf:"commands"`
}

Sync represents the version sync configuration

func (*Sync) SetDefaults

func (s *Sync) SetDefaults()

SetDefaults sets default values for the sync configuration

func (*Sync) Validate

func (s *Sync) Validate() error

Validate validates the sync configuration

type Validator

type Validator struct {
	// Client is the solana validator client - one of: agave, jito-solana, rakurai-validator, firedancer, firebam
	// The legacy alias "rakurai" is also accepted and normalized to "rakurai-validator".
	Client string `koanf:"client"`
	// RPCURL is the URL of the validator's RPC endpoint
	RPCURL string `koanf:"rpc_url"`
	// VersionConstraint is the constraint for the client version
	VersionConstraint string `koanf:"version_constraint"`
	// VoteAccountPublicKey is the vote account used to discover the active validator identity
	VoteAccountPublicKey string `koanf:"vote_account_pubkey"`
	// Identities configures active and optional passive validator identities
	Identities Identities `koanf:"identities"`
}

Validator represents the validator configuration

func (*Validator) Validate

func (v *Validator) Validate() error

Validate validates the validator configuration

Jump to

Keyboard shortcuts

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