csconfig

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: AGPL-3.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// The deployment name for Mainnet
	NodesetDeploymentMainnet string = "mainnet"

	// The deployment name for Holesky testing
	NodesetDeploymentHolesky string = "holesky"
)
View Source
const (
	ModuleName           string = "constellation"
	ShortModuleName      string = "cs"
	DaemonBaseRoute      string = ModuleName
	ApiVersion           string = "1"
	ApiClientRoute       string = DaemonBaseRoute + "/api/v" + ApiVersion
	DefaultApiPort       uint16 = 8280
	DefaultVcMetricsPort uint16 = 9111
	KeystorePasswordFile string = "secret.txt"

	// Logging
	ClientLogName string = "hd.log"
)
View Source
const (
	// The Constellation Hyperdrive daemon
	ContainerID_ConstellationDaemon config.ContainerID = "cs_daemon"

	// The Constellation Validator client
	ContainerID_ConstellationValidator config.ContainerID = "cs_vc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstellationConfig

type ConstellationConfig struct {
	// Toggle for enabling the module
	Enabled config.Parameter[bool]

	// Port to run the Constellation API server on
	ApiPort config.Parameter[uint16]

	// The Docker Hub tag for the Constellation daemon
	DaemonContainerTag config.Parameter[string]

	// Validator client configs
	VcCommon   *config.ValidatorClientCommonConfig
	Lighthouse *config.LighthouseVcConfig
	Lodestar   *config.LodestarVcConfig
	Nimbus     *config.NimbusVcConfig
	Prysm      *config.PrysmVcConfig
	Teku       *config.TekuVcConfig

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

Configuration for Constellation

func NewConstellationConfig

func NewConstellationConfig(hdCfg *hdconfig.HyperdriveConfig, networks []*ConstellationSettings) (*ConstellationConfig, error)

Generates a new Constellation config

func (*ConstellationConfig) ChangeNetwork

func (cfg *ConstellationConfig) ChangeNetwork(oldNetwork config.Network, newNetwork config.Network)

Changes the current network, propagating new parameter settings if they are affected

func (*ConstellationConfig) Clone

Creates a copy of the configuration

func (*ConstellationConfig) DaemonContainerName

func (c *ConstellationConfig) DaemonContainerName() string

func (*ConstellationConfig) Deserialize

func (cfg *ConstellationConfig) Deserialize(configMap map[string]any, network config.Network) error

Deserialize the module config from a map

func (*ConstellationConfig) GetApiLogFileName

func (cfg *ConstellationConfig) GetApiLogFileName() string

func (*ConstellationConfig) GetContainersToDeploy

func (cfg *ConstellationConfig) GetContainersToDeploy() []config.ContainerID

func (*ConstellationConfig) GetDaemonContainerTag

func (cfg *ConstellationConfig) GetDaemonContainerTag() string

The tag for the daemon container

func (*ConstellationConfig) GetHdClientLogFileName

func (cfg *ConstellationConfig) GetHdClientLogFileName() string

func (*ConstellationConfig) GetLogNames

func (cfg *ConstellationConfig) GetLogNames() []string

func (*ConstellationConfig) GetModuleName

func (cfg *ConstellationConfig) GetModuleName() string

The module name

func (*ConstellationConfig) GetNetworkSettings

func (cfg *ConstellationConfig) GetNetworkSettings() []*ConstellationSettings

Get all loaded network settings

func (*ConstellationConfig) GetParameters

func (cfg *ConstellationConfig) GetParameters() []config.IParameter

Get the parameters for this config

func (*ConstellationConfig) GetShortName

func (cfg *ConstellationConfig) GetShortName() string

The module name

func (*ConstellationConfig) GetSubconfigs

func (cfg *ConstellationConfig) GetSubconfigs() map[string]config.IConfigSection

Get the sections underneath this one

func (*ConstellationConfig) GetTasksLogFileName

func (cfg *ConstellationConfig) GetTasksLogFileName() string

func (*ConstellationConfig) GetTitle

func (cfg *ConstellationConfig) GetTitle() string

The title for the config

func (*ConstellationConfig) GetValidatorContainerTagInfo

func (cfg *ConstellationConfig) GetValidatorContainerTagInfo() map[config.ContainerID]string

func (*ConstellationConfig) GetVcAdditionalFlags

func (cfg *ConstellationConfig) GetVcAdditionalFlags() string

Gets the additional flags of the selected VC

func (*ConstellationConfig) GetVcContainerTag

func (cfg *ConstellationConfig) GetVcContainerTag() string

Get the container tag of the selected VC

func (*ConstellationConfig) GetVersion

func (cfg *ConstellationConfig) GetVersion() string

Get the version of the module config

func (*ConstellationConfig) Graffiti

func (cfg *ConstellationConfig) Graffiti() string

Used by text/template to format validator.yml

func (*ConstellationConfig) IsDoppelgangerEnabled

func (cfg *ConstellationConfig) IsDoppelgangerEnabled() bool

Check if any of the services have doppelganger detection enabled NOTE: update this with each new service that runs a VC!

func (*ConstellationConfig) IsEnabled

func (cfg *ConstellationConfig) IsEnabled() bool

func (*ConstellationConfig) Serialize

func (cfg *ConstellationConfig) Serialize() map[string]any

Serialize the module config to a map

func (*ConstellationConfig) UpdateDefaults

func (cfg *ConstellationConfig) UpdateDefaults(network config.Network)

Updates the default parameters based on the current network value

func (*ConstellationConfig) Validate

func (cfg *ConstellationConfig) Validate() []string

Checks to see if the current configuration is valid; if not, returns a list of errors

func (*ConstellationConfig) VcContainerName

func (c *ConstellationConfig) VcContainerName() string

type ConstellationResources

type ConstellationResources struct {
	// The name of the deployment used by nodeset.io
	DeploymentName string `yaml:"deploymentName" json:"deploymentName"`

	// The Constellation directory contract address, which houses all of the other contract addresses
	Directory *common.Address `yaml:"directory" json:"directory"`

	// Address of the RocketStorage contract, the master contract for all of Rocket Pool
	RocketStorage *common.Address `yaml:"rocketStorage" json:"rocketStorage"`

	// The fee recipient to use for the Constellation VC. This must ALWAYS be set to the Rocket Pool Smoothing Pool contract address.
	// Technically this should come from Directory (or RocketStorage within Directory) but it needs to be set here for templating to use it.
	FeeRecipient *common.Address `yaml:"feeRecipient" json:"feeRecipient"`
}

A collection of network-specific resources and getters for them

var (
	// Mainnet resources for reference in testing
	MainnetResourcesReference *ConstellationResources = &ConstellationResources{
		Directory:     nil,
		RocketStorage: config.HexToAddressPtr("0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46"),
		FeeRecipient:  config.HexToAddressPtr("0xd4E96eF8eee8678dBFf4d535E033Ed1a4F7605b7"),
	}

	// Holesky resources for reference in testing
	HoleskyResourcesReference *ConstellationResources = &ConstellationResources{
		Directory:     nil,
		RocketStorage: config.HexToAddressPtr("0x594Fb75D3dc2DFa0150Ad03F99F97817747dd4E1"),
		FeeRecipient:  config.HexToAddressPtr("0xA347C391bc8f740CAbA37672157c8aAcD08Ac567"),
	}
)

type ConstellationSettings

type ConstellationSettings struct {
	// The unique key used to identify the network in the configuration
	Key config.Network `yaml:"key" json:"key"`

	// Hyperdrive resources for the network
	ConstellationResources *ConstellationResources `yaml:"constellationResources" json:"constellationResources"`

	// Smart Node resources for the network
	SmartNodeResources *snconfig.SmartNodeResources `yaml:"smartNodeResources" json:"smartNodeResources"`

	// A collection of default configuration settings to use for the network, which will override
	// the standard "general-purpose" default value for the setting
	DefaultConfigSettings map[string]any `yaml:"defaultConfigSettings,omitempty" json:"defaultConfigSettings,omitempty"`
}

Network settings with a field for Constellation-specific settings

func LoadSettingsFiles

func LoadSettingsFiles(sourceDir string) ([]*ConstellationSettings, error)

Load network settings from a folder

type MergedResources

type MergedResources struct {
	// General resources
	*hdconfig.MergedResources

	// Constellation-specific resources
	*ConstellationResources

	// Rocket Pool Smart Node resources
	*snconfig.SmartNodeResources
}

A merged set of general resources and Constellation-specific resources for the selected network

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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