config

package
v0.2.5-dev Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Param IDs
	BesuJvmHeapSizeID   string = "jvmHeapSize"
	BesuMaxPeersID      string = "maxPeers"
	BesuMaxBackLayersID string = "maxBackLayers"
)

Constants

View Source
const (
	BitflySecretID      string = "bitflySecret"
	BitflyEndpointID    string = "bitflyEndpoint"
	BitflyMachineNameID string = "bitflyMachineName"
)

Defaults

View Source
const (
	// Param IDs
	UseFallbackClientsID string = "useFallbackClients"
	EcHttpUrl            string = "ecHttpUrl"
	BnHttpUrl            string = "bnHttpUrl"
)
View Source
const (
	// Param IDs
	DebugModeID          string = "debugMode"
	NetworkID            string = "network"
	ClientModeID         string = "clientMode"
	UserDataPathID       string = "hdUserDataDir"
	ProjectNameID        string = "projectName"
	AutoTxMaxFeeID       string = "autoTxMaxFee"
	MaxPriorityFeeID     string = "maxPriorityFee"
	AutoTxGasThresholdID string = "autoTxGasThreshold"
)
View Source
const (
	// Param IDs
	EcWebsocketPortID string = "wsPort"
	EcEnginePortID    string = "enginePort"
	EcOpenApiPortsID  string = "openApiPorts"
)
View Source
const (
	// Param IDs
	MetricsEnableID       string = "enableMetrics"
	MetricsEnableBitflyID string = "enableBitflyNodeMetrics"
	MetricsEcPortID       string = "ecMetricsPort"
	MetricsBnPortID       string = "bnMetricsPort"
	MetricsDaemonPortID   string = "daemonMetricsPort"
	MetricsExporterPortID string = "exporterMetricsPort"
)

Constants

View Source
const (
	ModulesName         string = "modules"
	ValidatorsDirectory string = "validators"
)
View Source
const (
	// Param IDs
	NethermindCacheSizeID         string = "cacheSize"
	NethermindPruneMemSizeID      string = "pruneMemSize"
	NethermindAdditionalModulesID string = "additionalModules"
	NethermindAdditionalUrlsID    string = "additionalUrls"
)

Constants

View Source
const (
	// Param IDs
	PrysmRpcPortID     string = "rpcPort"
	PrysmOpenRpcPortID string = "openRpcPort"
)
View Source
const (
	EventLogInterval         int    = 1000
	DockerApiVersion         string = "1.40"
	HyperdriveDaemonRoute    string = "hyperdrive"
	HyperdriveSocketFilename string = HyperdriveDaemonRoute + ".sock"
	ConfigFilename           string = "user-settings.yml"

	// Wallet
	UserAddressFilename    string = "address"
	UserWalletDataFilename string = "wallet"
	UserPasswordFilename   string = "password"

	// Scripts
	EcStartScript string = "start-ec.sh"
	BnStartScript string = "start-bn.sh"
	VcStartScript string = "start-vc.sh"

	// HTTP
	ClientTimeout time.Duration = 8 * time.Second

	// Volumes
	ExecutionClientDataVolume string = "ecdata"
	BeaconNodeDataVolume      string = "bndata"
)
View Source
const (
	// Param IDs
	TekuJvmHeapSizeID string = "jvmHeapSize"
	TekuArchiveModeID string = "archiveMode"
)
View Source
const (
	// Param IDs
	BnCheckpointSyncUrlID string = "checkpointSyncUrl"
)
View Source
const (
	// Param IDs
	ExporterEnableRootFsID string = "enableRootFs"
)
View Source
const (
	// Param IDs
	GethEnablePbssID string = "enablePbss"
)

Constants

View Source
const (
	// Param IDs
	LhQuicPortID string = "p2pQuicPort"
)
View Source
const (
	// Param IDs
	NimbusPruningModeID string = "pruningMode"
)
View Source
const (
	// Param IDs
	PrysmRpcUrlID string = "prysmRpcUrl"
)
View Source
const (
	// Param IDs
	WebsocketUrlID string = "wsUrl"
)

Variables

This section is empty.

Functions

func ApplyDefaults added in v0.2.3

func ApplyDefaults(cfg IConfigSection, network Network)

Apply the default settings for each parameter and subparameter

func ChangeNetwork added in v0.2.3

func ChangeNetwork(cfg IConfigSection, oldNetwork Network, newNetwork Network)

Change the active network for an entire configuration

func Clone added in v0.2.3

func Clone(source IConfigSection, target IConfigSection, network Network)

Copy a section's settings into the corresponding section of a new config

func Deserialize added in v0.2.3

func Deserialize(cfg IConfigSection, serializedParams map[string]any, network Network) error

Deserialize a config section

func GetAffectedContainers added in v0.2.3

func GetAffectedContainers(section *ChangedSection, containers map[ContainerID]bool)

Get a list of containers that will be need to be restarted after this change is applied

func Serialize added in v0.2.3

func Serialize(cfg IConfigSection) map[string]any

Serialize a config section into a map

func UpdateDefaults added in v0.2.3

func UpdateDefaults(cfg IConfigSection, newNetwork Network)

Update the default settings after a network change

Types

type BeaconNode added in v0.2.3

type BeaconNode string

A Beacon Node (Beacon Node)

const (
	// Unknown
	BeaconNode_Unknown BeaconNode = ""

	// Lighthouse
	BeaconNode_Lighthouse BeaconNode = "lighthouse"

	// Lodestar
	BeaconNode_Lodestar BeaconNode = "lodestar"

	// Nimbus
	BeaconNode_Nimbus BeaconNode = "nimbus"

	// Prysm
	BeaconNode_Prysm BeaconNode = "prysm"

	// Teku
	BeaconNode_Teku BeaconNode = "teku"
)

Enum to describe the Beacon Nodes

type BesuConfig

type BesuConfig struct {
	// Max number of P2P peers to connect to
	JvmHeapSize Parameter[uint64]

	// Max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// Historical state block regeneration limit
	MaxBackLayers Parameter[uint64]

	// The Docker Hub tag for Besu
	ContainerTag Parameter[string]

	// Custom command line flags
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Besu

func NewBesuConfig

func NewBesuConfig(parent *LocalExecutionConfig) *BesuConfig

Generates a new Besu configuration

func (*BesuConfig) GetParameters

func (cfg *BesuConfig) GetParameters() []IParameter

Get the parameters for this config

func (*BesuConfig) GetSubconfigs

func (cfg *BesuConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*BesuConfig) GetTitle

func (cfg *BesuConfig) GetTitle() string

The title for the config

type BitflyNodeMetricsConfig

type BitflyNodeMetricsConfig struct {
	Secret Parameter[string]

	Endpoint Parameter[string]

	MachineName Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Bitfly Node Metrics

func NewBitflyNodeMetricsConfig

func NewBitflyNodeMetricsConfig(parent *MetricsConfig) *BitflyNodeMetricsConfig

Generates a new Bitfly Node Metrics config

func (*BitflyNodeMetricsConfig) GetParameters

func (cfg *BitflyNodeMetricsConfig) GetParameters() []IParameter

Get the parameters for this config

func (*BitflyNodeMetricsConfig) GetSubconfigs

func (cfg *BitflyNodeMetricsConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*BitflyNodeMetricsConfig) GetTitle

func (cfg *BitflyNodeMetricsConfig) GetTitle() string

The title for the config

type ChangedSection added in v0.2.3

type ChangedSection struct {
	// The name of the section
	Name string

	// The list of parameters within this section that have changed
	Settings []*ChangedSetting

	// The list of subsections that may or may not have changes
	Subsections []*ChangedSection
}

A configuration section with one or more changes

func GetChangedSettings added in v0.2.3

func GetChangedSettings(old IConfigSection, new IConfigSection) (*ChangedSection, int)

Get all of the settings that have changed between the given config sections Assumes the config sections represent the same element, just different instances

type ChangedSetting added in v0.2.3

type ChangedSetting struct {
	// The setting name
	Name string

	// The current (old) value of the parameter
	OldValue string

	// The new (pending) value of the parameter
	NewValue string

	// A list of containers affected by this change, which will require restarting them
	AffectedContainers []ContainerID
}

A configuration setting that has been changed

type ClientMode added in v0.2.3

type ClientMode string

A client ownership mode

const (
	// Unknown
	ClientMode_Unknown ClientMode = ""

	// Locally-owned clients (managed by Hyperdrive)
	ClientMode_Local ClientMode = "local"

	// Externally-managed clients (managed by the user)
	ClientMode_External ClientMode = "external"
)

Enum to describe client modes

type ContainerID added in v0.2.3

type ContainerID string

A Docker container name

const (
	// Unknown
	ContainerID_Unknown ContainerID = ""

	// The daemon
	ContainerID_Daemon ContainerID = "daemon"

	// The Execution client
	ContainerID_ExecutionClient ContainerID = "ec"

	// The Beacon node (Beacon Node)
	ContainerID_BeaconNode ContainerID = "bn"

	// The Validator clients owned by Hyperdrive
	ContainerID_ValidatorClients ContainerID = "vcs"

	// MEV-Boost
	ContainerID_MevBoost ContainerID = "mev-boost"

	// The Node Exporter
	ContainerID_Exporter ContainerID = "exporter"

	// Prometheus
	ContainerID_Prometheus ContainerID = "prometheus"

	// Grafana
	ContainerID_Grafana ContainerID = "grafana"
)

Enum to describe the names of Hyperdrive containers

type ExecutionClient added in v0.2.3

type ExecutionClient string

An Execution client

const (
	// Unknown
	ExecutionClient_Unknown ExecutionClient = ""

	// Geth
	ExecutionClient_Geth ExecutionClient = "geth"

	// Nethermind
	ExecutionClient_Nethermind ExecutionClient = "nethermind"

	// Besu
	ExecutionClient_Besu ExecutionClient = "besu"
)

Enum to describe the Execution clients

type ExporterConfig

type ExporterConfig struct {
	// Toggle for enabling access to the root filesystem (for multiple disk usage metrics)
	RootFs Parameter[bool]

	// The Docker Hub tag for the Exporter
	ContainerTag Parameter[string]

	// Custom command line flags
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Exporter

func NewExporterConfig

func NewExporterConfig(parent *MetricsConfig) *ExporterConfig

Generates a new Exporter config

func (*ExporterConfig) GetParameters

func (cfg *ExporterConfig) GetParameters() []IParameter

Get the parameters for this config

func (*ExporterConfig) GetSubconfigs

func (cfg *ExporterConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*ExporterConfig) GetTitle

func (cfg *ExporterConfig) GetTitle() string

The title for the config

type ExternalBeaconConfig

type ExternalBeaconConfig struct {
	// The selected BN
	BeaconNode Parameter[BeaconNode]

	// The URL of the HTTP endpoint
	HttpUrl Parameter[string]

	// The URL of the Prysm gRPC endpoint (only needed if using Prysm VCs)
	PrysmRpcUrl Parameter[string]
	// contains filtered or unexported fields
}

Configuration for external Beacon Nodes

func NewExternalBeaconConfig

func NewExternalBeaconConfig(parent *HyperdriveConfig) *ExternalBeaconConfig

Generates a new ExternalBeaconConfig configuration

func (*ExternalBeaconConfig) GetParameters

func (cfg *ExternalBeaconConfig) GetParameters() []IParameter

Get the parameters for this config

func (*ExternalBeaconConfig) GetSubconfigs

func (cfg *ExternalBeaconConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*ExternalBeaconConfig) GetTitle

func (cfg *ExternalBeaconConfig) GetTitle() string

The title for the config

type ExternalExecutionConfig

type ExternalExecutionConfig struct {
	// The selected EC
	ExecutionClient Parameter[ExecutionClient]

	// The URL of the HTTP endpoint
	HttpUrl Parameter[string]

	// The URL of the Websocket endpoint
	WebsocketUrl Parameter[string]
	// contains filtered or unexported fields
}

Configuration for external Execution clients

func NewExternalExecutionConfig

func NewExternalExecutionConfig(parent *HyperdriveConfig) *ExternalExecutionConfig

Generates a new ExternalExecutionConfig configuration

func (*ExternalExecutionConfig) GetParameters

func (cfg *ExternalExecutionConfig) GetParameters() []IParameter

Get the parameters for this config

func (*ExternalExecutionConfig) GetSubconfigs

func (cfg *ExternalExecutionConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*ExternalExecutionConfig) GetTitle

func (cfg *ExternalExecutionConfig) GetTitle() string

The title for the config

type FallbackConfig

type FallbackConfig struct {
	// Flag for enabling fallback clients
	UseFallbackClients Parameter[bool]

	// The URL of the Execution Client HTTP endpoint
	EcHttpUrl Parameter[string]

	// The URL of the Beacon Node HTTP endpoint
	BnHttpUrl Parameter[string]

	// The URL of the Prysm gRPC endpoint (only needed if using Prysm VCs)
	PrysmRpcUrl Parameter[string]
	// contains filtered or unexported fields
}

Fallback configuration

func NewFallbackConfig

func NewFallbackConfig(parent *HyperdriveConfig) *FallbackConfig

Generates a new FallbackConfig configuration

func (*FallbackConfig) GetParameters

func (cfg *FallbackConfig) GetParameters() []IParameter

Get the Parameters for this config

func (*FallbackConfig) GetSubconfigs

func (cfg *FallbackConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*FallbackConfig) GetTitle

func (cfg *FallbackConfig) GetTitle() string

The title for the config

type GethConfig

type GethConfig struct {
	// The flag for enabling PBSS
	EnablePbss Parameter[bool]

	// Max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// The Docker Hub tag for Geth
	ContainerTag Parameter[string]

	// Custom command line flags
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Geth

func NewGethConfig

func NewGethConfig(parent *LocalExecutionConfig) *GethConfig

Generates a new Geth configuration

func (*GethConfig) GetParameters

func (cfg *GethConfig) GetParameters() []IParameter

Get the parameters for this config

func (*GethConfig) GetSubconfigs

func (cfg *GethConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*GethConfig) GetTitle

func (cfg *GethConfig) GetTitle() string

Get the title for the config

type GrafanaConfig

type GrafanaConfig struct {
	// The HTTP port to serve on
	Port Parameter[uint16]

	// The Docker Hub tag for Grafana
	ContainerTag Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Grafana

func NewGrafanaConfig

func NewGrafanaConfig(parent *MetricsConfig) *GrafanaConfig

Generates a new Grafana config

func (*GrafanaConfig) GetParameters

func (cfg *GrafanaConfig) GetParameters() []IParameter

Get the parameters for this config

func (*GrafanaConfig) GetSubconfigs

func (cfg *GrafanaConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*GrafanaConfig) GetTitle

func (cfg *GrafanaConfig) GetTitle() string

The title for the config

type HyperdriveConfig

type HyperdriveConfig struct {
	// General settings
	DebugMode          Parameter[bool]
	Network            Parameter[Network]
	ClientMode         Parameter[ClientMode]
	ProjectName        Parameter[string]
	UserDataPath       Parameter[string]
	AutoTxMaxFee       Parameter[float64]
	MaxPriorityFee     Parameter[float64]
	AutoTxGasThreshold Parameter[float64]

	// Execution client settings
	LocalExecutionConfig    *LocalExecutionConfig
	ExternalExecutionConfig *ExternalExecutionConfig

	// Beacon node settings
	LocalBeaconConfig    *LocalBeaconConfig
	ExternalBeaconConfig *ExternalBeaconConfig

	// Fallback clients
	Fallback *FallbackConfig

	// Metrics
	Metrics *MetricsConfig

	// Modules
	Modules map[string]any

	// Internal fields
	Version                 string
	HyperdriveUserDirectory string
	// contains filtered or unexported fields
}

The master configuration struct

func LoadFromFile

func LoadFromFile(path string) (*HyperdriveConfig, error)

Load configuration settings from a file

func NewHyperdriveConfig

func NewHyperdriveConfig(hdDir string) *HyperdriveConfig

Creates a new Hyperdrive configuration instance

func (*HyperdriveConfig) AutoTxGasThresholdInt added in v0.2.3

func (cfg *HyperdriveConfig) AutoTxGasThresholdInt() uint64

func (*HyperdriveConfig) AutoTxMaxFeeInt

func (cfg *HyperdriveConfig) AutoTxMaxFeeInt() uint64

func (*HyperdriveConfig) BeaconNodeContainerName added in v0.2.3

func (c *HyperdriveConfig) BeaconNodeContainerName() string

func (*HyperdriveConfig) BeaconNodeDataVolume added in v0.2.3

func (c *HyperdriveConfig) BeaconNodeDataVolume() string

func (*HyperdriveConfig) BnHttpUrl

func (cfg *HyperdriveConfig) BnHttpUrl() (string, error)

func (*HyperdriveConfig) BnRpcUrl

func (cfg *HyperdriveConfig) BnRpcUrl() (string, error)

func (*HyperdriveConfig) DaemonContainerName added in v0.2.3

func (c *HyperdriveConfig) DaemonContainerName() string

func (*HyperdriveConfig) Deserialize

func (cfg *HyperdriveConfig) Deserialize(masterMap map[string]any) error

Deserializes a settings file into this config

func (*HyperdriveConfig) ExecutionClientContainerName added in v0.2.3

func (c *HyperdriveConfig) ExecutionClientContainerName() string

func (*HyperdriveConfig) ExecutionClientDataVolume added in v0.2.3

func (c *HyperdriveConfig) ExecutionClientDataVolume() string

func (*HyperdriveConfig) ExporterContainerName added in v0.2.3

func (c *HyperdriveConfig) ExporterContainerName() string

func (*HyperdriveConfig) FallbackBnHttpUrl

func (cfg *HyperdriveConfig) FallbackBnHttpUrl() string

func (*HyperdriveConfig) FallbackBnRpcUrl

func (cfg *HyperdriveConfig) FallbackBnRpcUrl() string

func (*HyperdriveConfig) GetBeaconHostname

func (cfg *HyperdriveConfig) GetBeaconHostname() (string, error)

Gets the hostname portion of the Beacon Node's URI. Used by text/template to format prometheus.yml.

func (*HyperdriveConfig) GetBnAdditionalFlags

func (cfg *HyperdriveConfig) GetBnAdditionalFlags() (string, error)

Used by text/template to format bn.yml

func (*HyperdriveConfig) GetBnContainerTag

func (cfg *HyperdriveConfig) GetBnContainerTag() (string, error)

Gets the tag of the bn container Used by text/template to format bn.yml

func (*HyperdriveConfig) GetBnHttpEndpoint

func (cfg *HyperdriveConfig) GetBnHttpEndpoint() string

Get the HTTP API endpoint for the provided BN

func (*HyperdriveConfig) GetBnHttpEndpointsWithFallback

func (cfg *HyperdriveConfig) GetBnHttpEndpointsWithFallback() string

Get the endpoints of the BN, including the fallback if applicable

func (*HyperdriveConfig) GetBnMaxPeers

func (cfg *HyperdriveConfig) GetBnMaxPeers() (uint16, error)

Gets the max peers of the bn container Used by text/template to format bn.yml

func (*HyperdriveConfig) GetBnOpenPorts

func (cfg *HyperdriveConfig) GetBnOpenPorts() []string

Used by text/template to format bn.yml

func (*HyperdriveConfig) GetBnStartScript

func (cfg *HyperdriveConfig) GetBnStartScript() string

Gets the name of the Beacon Node start script

func (*HyperdriveConfig) GetDaemonContainerTag

func (cfg *HyperdriveConfig) GetDaemonContainerTag() string

func (*HyperdriveConfig) GetDockerArtifactName

func (cfg *HyperdriveConfig) GetDockerArtifactName(entity string) string

Gets the full name of the Docker container or volume with the provided suffix (name minus the project ID prefix)

func (*HyperdriveConfig) GetEcAdditionalFlags

func (cfg *HyperdriveConfig) GetEcAdditionalFlags() (string, error)

Used by text/template to format ec.yml

func (*HyperdriveConfig) GetEcContainerTag

func (cfg *HyperdriveConfig) GetEcContainerTag() (string, error)

Gets the tag of the ec container Used by text/template to format ec.yml

func (*HyperdriveConfig) GetEcHttpEndpoint

func (cfg *HyperdriveConfig) GetEcHttpEndpoint() string

Used by text/template to format bn.yml

func (*HyperdriveConfig) GetEcHttpEndpointsWithFallback

func (cfg *HyperdriveConfig) GetEcHttpEndpointsWithFallback() string

Get the endpoints of the EC, including the fallback if applicable

func (*HyperdriveConfig) GetEcMaxPeers

func (cfg *HyperdriveConfig) GetEcMaxPeers() (uint16, error)

Gets the max peers of the ec container Used by text/template to format ec.yml

func (*HyperdriveConfig) GetEcOpenApiPorts

func (cfg *HyperdriveConfig) GetEcOpenApiPorts() string

Gets the port mapping of the ec container Used by text/template to format ec.yml

func (*HyperdriveConfig) GetEcStartScript

func (cfg *HyperdriveConfig) GetEcStartScript() string

Gets the name of the Execution Client start script

func (*HyperdriveConfig) GetEcWsEndpoint

func (cfg *HyperdriveConfig) GetEcWsEndpoint() string

Used by text/template to format bn.yml

func (*HyperdriveConfig) GetExecutionHostname

func (cfg *HyperdriveConfig) GetExecutionHostname() (string, error)

Gets the hostname portion of the Execution Client's URI. Used by text/template to format prometheus.yml.

func (*HyperdriveConfig) GetExporterAdditionalFlags

func (cfg *HyperdriveConfig) GetExporterAdditionalFlags() []string

Used by text/template to format exporter.yml

func (*HyperdriveConfig) GetExternalIP

func (cfg *HyperdriveConfig) GetExternalIP() string

Used by text/template to format ec.yml

func (*HyperdriveConfig) GetParameters

func (cfg *HyperdriveConfig) GetParameters() []IParameter

Get the parameters for this config

func (*HyperdriveConfig) GetPrometheusAdditionalFlags

func (cfg *HyperdriveConfig) GetPrometheusAdditionalFlags() []string

Used by text/template to format prometheus.yml

func (*HyperdriveConfig) GetPrometheusOpenPorts

func (cfg *HyperdriveConfig) GetPrometheusOpenPorts() string

Used by text/template to format prometheus.yml

func (*HyperdriveConfig) GetSelectedBeaconNode added in v0.2.3

func (cfg *HyperdriveConfig) GetSelectedBeaconNode() BeaconNode

Get the selected Beacon Node

func (*HyperdriveConfig) GetSelectedExecutionClient added in v0.2.3

func (cfg *HyperdriveConfig) GetSelectedExecutionClient() ExecutionClient

Get the selected Beacon Node

func (*HyperdriveConfig) GetSubconfigs

func (cfg *HyperdriveConfig) GetSubconfigs() map[string]IConfigSection

Get the subconfigurations for this config

func (*HyperdriveConfig) GetTitle

func (cfg *HyperdriveConfig) GetTitle() string

Get the title for this config

func (*HyperdriveConfig) GetVcStartScript

func (cfg *HyperdriveConfig) GetVcStartScript() string

Gets the name of the Validator Client start script

func (*HyperdriveConfig) GrafanaContainerName added in v0.2.3

func (c *HyperdriveConfig) GrafanaContainerName() string

func (*HyperdriveConfig) GraffitiPrefix added in v0.2.3

func (cfg *HyperdriveConfig) GraffitiPrefix() string

Used by text/template to format validator.yml Only returns the the prefix

func (*HyperdriveConfig) IsLocalMode

func (cfg *HyperdriveConfig) IsLocalMode() bool

Used by text/template to format bn.yml

func (*HyperdriveConfig) PrometheusContainerName added in v0.2.3

func (c *HyperdriveConfig) PrometheusContainerName() string

func (*HyperdriveConfig) Serialize

func (cfg *HyperdriveConfig) Serialize(modules []IModuleConfig) map[string]any

Serializes the configuration into a map of maps, compatible with a settings file

type IConfigSection added in v0.2.3

type IConfigSection interface {
	// Get the name of the section (for display purposes)
	GetTitle() string

	// Get the list of parameters directly belonging to this section
	GetParameters() []IParameter

	// Get the sections underneath this one
	GetSubconfigs() map[string]IConfigSection
}

Interface for describing config sections

type IModuleConfig added in v0.2.3

type IModuleConfig interface {
	IConfigSection

	GetModuleName() string

	// A map of the Validator Client IDs to their container tags
	GetValidatorContainerTagInfo() map[ContainerID]string

	// Return if doppelganger detection is enabled for any of the VCs
	IsDoppelgangerEnabled() bool

	// True if the module is enabled
	IsEnabled() bool

	// Get the list of containers that should be deployed
	GetContainersToDeploy() []ContainerID
}

type IParameter added in v0.2.3

type IParameter interface {
	// Get the parameter's common fields
	GetCommon() *ParameterCommon

	// Get the common fields from each ParameterOption (returns nil if this isn't a choice parameter)
	GetOptions() []IParameterOption

	// Set the parameter to the default value
	SetToDefault(network Network)

	// Get the parameter's value
	GetValueAsAny() any

	// Get the parameter's value as a string
	String() string

	// Get the parameter's default value for the supplied network as a string
	GetDefaultAsAny(network Network) any

	// Deserializes a string into this parameter's value
	Deserialize(serializedParam string, network Network) error

	// Set the parameter's value explicitly; panics if it's the wrong type
	SetValue(value any)

	// Change the current network
	ChangeNetwork(oldNetwork Network, newNetwork Network)
}

An interface for typed Parameter structs, to get common fields from them

type IParameterOption added in v0.2.3

type IParameterOption interface {
	// Get the parameter option's common fields
	Common() *ParameterOptionCommon

	// Get the option's value
	GetValueAsAny() any

	// Ge the option's value as a string
	String() string
}

An interface for typed ParameterOption structs, to get common fields from them

type LighthouseBnConfig

type LighthouseBnConfig struct {
	// The port to use for gossip traffic using the QUIC protocol
	P2pQuicPort Parameter[uint16]

	// The max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// The Docker Hub tag for Lighthouse BN
	ContainerTag Parameter[string]

	// Custom command line flags for the BN
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for the Lighthouse BN

func NewLighthouseBnConfig

func NewLighthouseBnConfig(parent *LocalBeaconConfig) *LighthouseBnConfig

Generates a new Lighthouse BN configuration

func (*LighthouseBnConfig) GetParameters

func (cfg *LighthouseBnConfig) GetParameters() []IParameter

Get the parameters for this config

func (*LighthouseBnConfig) GetSubconfigs

func (cfg *LighthouseBnConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*LighthouseBnConfig) GetTitle

func (cfg *LighthouseBnConfig) GetTitle() string

The title for the config

type LocalBeaconConfig

type LocalBeaconConfig struct {
	// The selected BN
	BeaconNode Parameter[BeaconNode]

	// The checkpoint sync URL if used
	CheckpointSyncProvider Parameter[string]

	// The port to use for gossip traffic
	P2pPort Parameter[uint16]

	// The port to expose the HTTP API on
	HttpPort Parameter[uint16]

	// Toggle for forwarding the HTTP API port outside of Docker
	OpenHttpPort Parameter[RpcPortMode]

	// Subconfigs
	Lighthouse *LighthouseBnConfig
	Lodestar   *LodestarBnConfig
	Nimbus     *NimbusBnConfig
	Prysm      *PrysmBnConfig
	Teku       *TekuBnConfig
	// contains filtered or unexported fields
}

Common parameters shared by all of the Beacon Clients

func NewLocalBeaconConfig

func NewLocalBeaconConfig(parent *HyperdriveConfig) *LocalBeaconConfig

Create a new LocalBeaconConfig struct

func (*LocalBeaconConfig) GetParameters

func (cfg *LocalBeaconConfig) GetParameters() []IParameter

Get the parameters for this config

func (*LocalBeaconConfig) GetSubconfigs

func (cfg *LocalBeaconConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*LocalBeaconConfig) GetTitle

func (cfg *LocalBeaconConfig) GetTitle() string

The title for the config

type LocalExecutionConfig

type LocalExecutionConfig struct {
	// The selected EC
	ExecutionClient Parameter[ExecutionClient]

	// The HTTP API port
	HttpPort Parameter[uint16]

	// The Websocket API port
	WebsocketPort Parameter[uint16]

	// The Engine API port
	EnginePort Parameter[uint16]

	// Toggle for forwarding the HTTP API port outside of Docker
	OpenApiPorts Parameter[RpcPortMode]

	// P2P traffic port
	P2pPort Parameter[uint16]

	// Subconfigs
	Geth       *GethConfig
	Nethermind *NethermindConfig
	Besu       *BesuConfig
	// contains filtered or unexported fields
}

Configuration for the Execution client

func NewExecutionCommonConfig

func NewExecutionCommonConfig(parent *HyperdriveConfig) *LocalExecutionConfig

Create a new LocalExecutionConfig struct

func (*LocalExecutionConfig) GetParameters

func (cfg *LocalExecutionConfig) GetParameters() []IParameter

Get the parameters for this config

func (*LocalExecutionConfig) GetSubconfigs

func (cfg *LocalExecutionConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*LocalExecutionConfig) GetTitle

func (cfg *LocalExecutionConfig) GetTitle() string

Get the title for the config

type LodestarBnConfig

type LodestarBnConfig struct {
	// The max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// The Docker Hub tag for Lodestar BN
	ContainerTag Parameter[string]

	// Custom command line flags for the BN
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for the Lodestar BN

func NewLodestarBnConfig

func NewLodestarBnConfig(parent *LocalBeaconConfig) *LodestarBnConfig

Generates a new Lodestar BN configuration

func (*LodestarBnConfig) GetParameters

func (cfg *LodestarBnConfig) GetParameters() []IParameter

Get the parameters for this config

func (*LodestarBnConfig) GetSubconfigs

func (cfg *LodestarBnConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*LodestarBnConfig) GetTitle

func (cfg *LodestarBnConfig) GetTitle() string

The title for the config

type MetricsConfig

type MetricsConfig struct {
	EnableMetrics           Parameter[bool]
	EcMetricsPort           Parameter[uint16]
	BnMetricsPort           Parameter[uint16]
	DaemonMetricsPort       Parameter[uint16]
	ExporterMetricsPort     Parameter[uint16]
	EnableBitflyNodeMetrics Parameter[bool]

	// Subconfigs
	Grafana           *GrafanaConfig
	Prometheus        *PrometheusConfig
	Exporter          *ExporterConfig
	BitflyNodeMetrics *BitflyNodeMetricsConfig
	// contains filtered or unexported fields
}

Configuration for Metrics

func NewMetricsConfig

func NewMetricsConfig(parent *HyperdriveConfig) *MetricsConfig

Generates a new Besu configuration

func (*MetricsConfig) GetParameters

func (cfg *MetricsConfig) GetParameters() []IParameter

Get the parameters for this config

func (*MetricsConfig) GetSubconfigs

func (cfg *MetricsConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*MetricsConfig) GetTitle

func (cfg *MetricsConfig) GetTitle() string

The title for the config

type NethermindConfig

type NethermindConfig struct {
	// Nethermind's cache memory hint
	CacheSize Parameter[uint64]

	// Max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// Nethermind's memory for pruning
	PruneMemSize Parameter[uint64]

	// Additional modules to enable on the primary JSON RPC endpoint
	AdditionalModules Parameter[string]

	// Additional JSON RPC URLs
	AdditionalUrls Parameter[string]

	// The Docker Hub tag for Nethermind
	ContainerTag Parameter[string]

	// Custom command line flags
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Nethermind

func NewNethermindConfig

func NewNethermindConfig(parent *LocalExecutionConfig) *NethermindConfig

Generates a new Nethermind configuration

func (*NethermindConfig) GetParameters

func (cfg *NethermindConfig) GetParameters() []IParameter

Get the parameters for this config

func (*NethermindConfig) GetSubconfigs

func (cfg *NethermindConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*NethermindConfig) GetTitle

func (cfg *NethermindConfig) GetTitle() string

Get the title for the config

type Network added in v0.2.3

type Network string

The network that this installation is configured to run on

const (
	// Unknown
	Network_Unknown Network = ""

	// All networks (used for parameter defaults)
	Network_All Network = "all"

	// The Holesky test network
	Network_Holesky Network = "holesky"

	// The NodeSet dev network on Holesky
	Network_HoleskyDev Network = "holesky-dev"

	// The Ethereum mainnet
	Network_Mainnet Network = "mainnet"
)

Enum to describe the various network values

type NimbusBnConfig

type NimbusBnConfig struct {
	// The max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// The Docker Hub tag for the BN
	ContainerTag Parameter[string]

	// The pruning mode to use in the BN
	PruningMode Parameter[Nimbus_PruningMode]

	// Custom command line flags for the BN
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Nimbus

func NewNimbusBnConfig

func NewNimbusBnConfig(parent *LocalBeaconConfig) *NimbusBnConfig

Generates a new Nimbus configuration

func (*NimbusBnConfig) GetParameters

func (cfg *NimbusBnConfig) GetParameters() []IParameter

Get the parameters for this config

func (*NimbusBnConfig) GetSubconfigs

func (cfg *NimbusBnConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*NimbusBnConfig) GetTitle

func (cfg *NimbusBnConfig) GetTitle() string

Get the title for the config

type Nimbus_PruningMode

type Nimbus_PruningMode string

Nimbus's pruning mode

const (
	Nimbus_PruningMode_Archive Nimbus_PruningMode = "archive"
	Nimbus_PruningMode_Pruned  Nimbus_PruningMode = "prune"
)

type Parameter added in v0.2.3

type Parameter[Type comparable] struct {
	*ParameterCommon
	Default map[Network]Type
	Value   Type
	Options []*ParameterOption[Type]
}

A parameter that can be configured by the user

func (*Parameter[_]) ChangeNetwork added in v0.2.3

func (p *Parameter[_]) ChangeNetwork(oldNetwork Network, newNetwork Network)

Apply a network change to a parameter

func (*Parameter[_]) Deserialize added in v0.2.3

func (p *Parameter[_]) Deserialize(serializedParam string, network Network) error

Deserializes a string into this parameter's value

func (*Parameter[_]) GetCommon added in v0.2.3

func (p *Parameter[_]) GetCommon() *ParameterCommon

Get the parameter's common fields

func (*Parameter[Type]) GetDefault added in v0.2.3

func (p *Parameter[Type]) GetDefault(network Network) Type

Get the default value for the provided network

func (*Parameter[_]) GetDefaultAsAny added in v0.2.3

func (p *Parameter[_]) GetDefaultAsAny(network Network) any

Get the default value for the provided network

func (*Parameter[_]) GetOptions added in v0.2.3

func (p *Parameter[_]) GetOptions() []IParameterOption

Get the common fields from each ParameterOption (returns nil if this isn't a choice parameter)

func (*Parameter[_]) GetValueAsAny added in v0.2.3

func (p *Parameter[_]) GetValueAsAny() any

Get the parameter's value

func (*Parameter[Type]) SetToDefault added in v0.2.3

func (p *Parameter[Type]) SetToDefault(network Network)

Set the value to the default for the provided config's network

func (*Parameter[Type]) SetValue added in v0.2.3

func (p *Parameter[Type]) SetValue(value any)

Set the parameter's value

func (*Parameter[_]) String added in v0.2.3

func (p *Parameter[_]) String() string

Get the parameter's value as a string

type ParameterCommon added in v0.2.3

type ParameterCommon struct {
	// The parameter's ID, used for serialization and deserialization
	ID string

	// The parameter's human-readable name
	Name string

	// A description of this parameter / setting
	Description string

	// The max length of the parameter, in characters, if it's free-form input
	MaxLength int

	// An optional regex used to validate free-form input for the parameter
	Regex string

	// True if this is an advanced parameter and should be hidden unless advanced configuration mode is enabled
	Advanced bool

	// The list of Docker containers affected by changing this parameter
	// (these containers will require a restart for the change to take effect)
	AffectsContainers []ContainerID

	// A list of Docker container environment variables that should be set to this parameter's value
	EnvironmentVariables []string

	// Whether or not the parameter is allowed to be blank
	CanBeBlank bool

	// True to reset the parameter's value to the default option after Hyperdrive is updated
	OverwriteOnUpgrade bool

	// Descriptions of the parameter that change depending on the selected network
	DescriptionsByNetwork map[Network]string
}

Common fields across all Parameter instances

func (*ParameterCommon) UpdateDescription added in v0.2.3

func (p *ParameterCommon) UpdateDescription(network Network)

Set the network-specific description of the parameter

type ParameterOption added in v0.2.3

type ParameterOption[Type any] struct {
	*ParameterOptionCommon

	// The underlying value for this option
	Value Type
}

A single option in a choice parameter

func (*ParameterOption[_]) Common added in v0.2.3

func (p *ParameterOption[_]) Common() *ParameterOptionCommon

Get the parameter option's common fields

func (*ParameterOption[_]) GetValueAsAny added in v0.2.3

func (p *ParameterOption[_]) GetValueAsAny() any

Get the parameter's value

func (*ParameterOption[_]) String added in v0.2.3

func (p *ParameterOption[_]) String() string

Get the parameter option's value as a string

type ParameterOptionCommon added in v0.2.3

type ParameterOptionCommon struct {
	// The option's human-readable name, to be used in config displays
	Name string

	// A description signifying what this option means
	Description string
}

Common fields across all ParameterOption instances

type PrometheusConfig

type PrometheusConfig struct {
	// The port to serve metrics on
	Port Parameter[uint16]

	// Toggle for forwarding the API port outside of Docker
	OpenPort Parameter[RpcPortMode]

	// The Docker Hub tag for Prometheus
	ContainerTag Parameter[string]

	// Custom command line flags
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Prometheus

func NewPrometheusConfig

func NewPrometheusConfig(parent *MetricsConfig) *PrometheusConfig

Generates a new Prometheus config

func (*PrometheusConfig) GetParameters

func (cfg *PrometheusConfig) GetParameters() []IParameter

Get the parameters for this config

func (*PrometheusConfig) GetSubconfigs

func (cfg *PrometheusConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*PrometheusConfig) GetTitle

func (cfg *PrometheusConfig) GetTitle() string

The title for the config

type PrysmBnConfig

type PrysmBnConfig struct {
	// The max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// The RPC port for BN / VC connections
	RpcPort Parameter[uint16]

	// Toggle for forwarding the RPC API outside of Docker
	OpenRpcPort Parameter[RpcPortMode]

	// The Docker Hub tag for the Prysm BN
	ContainerTag Parameter[string]

	// Custom command line flags for the BN
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for the Prysm BN

func NewPrysmBnConfig

func NewPrysmBnConfig(parent *LocalBeaconConfig) *PrysmBnConfig

Generates a new Prysm BN configuration

func (*PrysmBnConfig) GetParameters

func (cfg *PrysmBnConfig) GetParameters() []IParameter

Get the parameters for this config

func (*PrysmBnConfig) GetSubconfigs

func (cfg *PrysmBnConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*PrysmBnConfig) GetTitle

func (cfg *PrysmBnConfig) GetTitle() string

The title for the config

type RpcPortMode added in v0.2.3

type RpcPortMode string

How to expose the RPC ports

const (
	// Do not allow any connections to the RPC port
	RpcPortMode_Closed RpcPortMode = "closed"

	// Allow connections from the same host
	RpcPortMode_OpenLocalhost RpcPortMode = "localhost"

	// Allow connections from external hosts
	RpcPortMode_OpenExternal RpcPortMode = "external"
)

Enum to describe the mode for the RPC port exposure setting

func (RpcPortMode) DockerPortMapping added in v0.2.3

func (m RpcPortMode) DockerPortMapping(port uint16) string

Creates the appropriate Docker config string for the provided port, based on the port mode

func (RpcPortMode) IsOpen added in v0.2.3

func (m RpcPortMode) IsOpen() bool

True if the port is open locally or externally

type TekuBnConfig

type TekuBnConfig struct {
	// Max number of P2P peers to connect to
	JvmHeapSize Parameter[uint64]

	// The max number of P2P peers to connect to
	MaxPeers Parameter[uint16]

	// The archive mode flag
	ArchiveMode Parameter[bool]

	// The Docker Hub tag for the Teku BN
	ContainerTag Parameter[string]

	// Custom command line flags for the BN
	AdditionalFlags Parameter[string]
	// contains filtered or unexported fields
}

Configuration for Teku

func NewTekuBnConfig

func NewTekuBnConfig(parent *LocalBeaconConfig) *TekuBnConfig

Generates a new Teku BN configuration

func (*TekuBnConfig) GetParameters

func (cfg *TekuBnConfig) GetParameters() []IParameter

Get the parameters for this config

func (*TekuBnConfig) GetSubconfigs

func (cfg *TekuBnConfig) GetSubconfigs() map[string]IConfigSection

Get the sections underneath this one

func (*TekuBnConfig) GetTitle

func (cfg *TekuBnConfig) GetTitle() string

Get the title for the config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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