Documentation
¶
Index ¶
- Constants
- func NewMetricsConfig() *config.MetricsConfig
- type HyperdriveConfig
- func LoadFromFile(path string, networks []*HyperdriveSettings) (*HyperdriveConfig, error)
- func NewHyperdriveConfig(hdDir string, networks []*HyperdriveSettings) (*HyperdriveConfig, error)
- func NewHyperdriveConfigForNetwork(hdDir string, networks []*HyperdriveSettings, selectedNetwork config.Network) (*HyperdriveConfig, error)
- func (cfg *HyperdriveConfig) AutoTxGasThresholdInt() uint64
- func (cfg *HyperdriveConfig) AutoTxMaxFeeInt() uint64
- func (c *HyperdriveConfig) BeaconNodeContainerName() string
- func (c *HyperdriveConfig) BeaconNodeDataVolume() string
- func (cfg *HyperdriveConfig) BnHttpUrl() (string, error)
- func (cfg *HyperdriveConfig) BnRpcUrl() (string, error)
- func (cfg *HyperdriveConfig) ChangeNetwork(newNetwork config.Network)
- func (cfg *HyperdriveConfig) Clone() *HyperdriveConfig
- func (c *HyperdriveConfig) DaemonContainerName() string
- func (cfg *HyperdriveConfig) Deserialize(masterMap map[string]any) error
- func (c *HyperdriveConfig) ExecutionClientContainerName() string
- func (c *HyperdriveConfig) ExecutionClientDataVolume() string
- func (c *HyperdriveConfig) ExporterContainerName() string
- func (cfg *HyperdriveConfig) FallbackBnHttpUrl() string
- func (cfg *HyperdriveConfig) FallbackBnRpcUrl() string
- func (cfg *HyperdriveConfig) GetAdditionalDockerNetworks() []string
- func (cfg *HyperdriveConfig) GetApiLogFilePath() string
- func (cfg *HyperdriveConfig) GetBeaconHostname() (string, error)
- func (cfg *HyperdriveConfig) GetBeaconNodeUrls() (string, string)
- func (cfg *HyperdriveConfig) GetBnAdditionalFlags() (string, error)
- func (cfg *HyperdriveConfig) GetBnContainerTag() (string, error)
- func (cfg *HyperdriveConfig) GetBnHttpEndpoint() string
- func (cfg *HyperdriveConfig) GetBnHttpEndpointsWithFallback() string
- func (cfg *HyperdriveConfig) GetBnMaxPeers() (uint16, error)
- func (cfg *HyperdriveConfig) GetBnOpenPorts() []string
- func (cfg *HyperdriveConfig) GetBnStartScript() string
- func (cfg *HyperdriveConfig) GetDaemonContainerTag() string
- func (cfg *HyperdriveConfig) GetDockerArtifactName(entity string) string
- func (cfg *HyperdriveConfig) GetEcAdditionalFlags() (string, error)
- func (cfg *HyperdriveConfig) GetEcContainerTag() (string, error)
- func (cfg *HyperdriveConfig) GetEcHttpEndpoint() string
- func (cfg *HyperdriveConfig) GetEcHttpEndpointsWithFallback() string
- func (cfg *HyperdriveConfig) GetEcMaxPeers() (uint16, error)
- func (cfg *HyperdriveConfig) GetEcOpenApiPorts() string
- func (cfg *HyperdriveConfig) GetEcStartScript() string
- func (cfg *HyperdriveConfig) GetEcWsEndpoint() string
- func (cfg *HyperdriveConfig) GetEthNetworkName() string
- func (cfg *HyperdriveConfig) GetExecutionClientUrls() (string, string)
- func (cfg *HyperdriveConfig) GetExecutionHostname() (string, error)
- func (cfg *HyperdriveConfig) GetExporterAdditionalFlags() []string
- func (cfg *HyperdriveConfig) GetLoggerOptions() log.LoggerOptions
- func (cfg *HyperdriveConfig) GetModuleLogFilePath(moduleName string, moduleLogName string) string
- func (cfg *HyperdriveConfig) GetNetworkSettings() []*HyperdriveSettings
- func (cfg *HyperdriveConfig) GetNodeAddressFilePath() string
- func (cfg *HyperdriveConfig) GetParameters() []config.IParameter
- func (cfg *HyperdriveConfig) GetPasswordFilePath() string
- func (cfg *HyperdriveConfig) GetPbsConfigPath() string
- func (cfg *HyperdriveConfig) GetPbsStartScript() string
- func (cfg *HyperdriveConfig) GetPrometheusAdditionalFlags() []string
- func (cfg *HyperdriveConfig) GetPrometheusOpenPorts() string
- func (cfg *HyperdriveConfig) GetSelectedBeaconNode() config.BeaconNode
- func (cfg *HyperdriveConfig) GetSelectedExecutionClient() config.ExecutionClient
- func (cfg *HyperdriveConfig) GetSubconfigs() map[string]config.IConfigSection
- func (cfg *HyperdriveConfig) GetTasksLogFilePath() string
- func (cfg *HyperdriveConfig) GetTitle() string
- func (cfg *HyperdriveConfig) GetUserDirectory() string
- func (cfg *HyperdriveConfig) GetVcStartScript() string
- func (cfg *HyperdriveConfig) GetWalletFilePath() string
- func (c *HyperdriveConfig) GrafanaContainerName() string
- func (cfg *HyperdriveConfig) GraffitiPrefix() string
- func (cfg *HyperdriveConfig) IsLocalMode() bool
- func (c *HyperdriveConfig) PbsClientContainerName() string
- func (cfg *HyperdriveConfig) PbsUrl() string
- func (c *HyperdriveConfig) PrometheusContainerName() string
- func (cfg *HyperdriveConfig) Serialize(modules []IModuleConfig, includeUserDir bool) map[string]any
- type HyperdriveResources
- type HyperdriveSettings
- type IModuleConfig
- type MergedResources
Constants ¶
const ( ModulesName string = "modules" ValidatorsDirectory string = "validators" )
const ( // The nodeset.io URL for production usage NodesetUrlProd string = "https://nodeset.io/api" // The nodeset.io URL for development / staging NodesetUrlStaging string = "https://staging.nodeset.io/api" )
const ( EventLogInterval int = 1000 HyperdriveDaemonRoute string = "hyperdrive" HyperdriveApiVersion string = "1" HyperdriveApiClientRoute string = HyperdriveDaemonRoute + "/api/v" + HyperdriveApiVersion ConfigFilename string = "user-settings.yml" DefaultApiPort uint16 = 8080 // 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" PbsStartScript string = "start-pbs.sh" // Volumes ExecutionClientDataVolume string = "ecdata" BeaconNodeDataVolume string = "bndata" // Logging LogDir string = "logs" ApiLogName string = "api.log" TasksLogName string = "tasks.log" // API Keys SecretsDir string = "secrets" DaemonKeyFilename string = "daemon.key" // PBS PbsDir string = "pbs" )
const ( // Local test network for development Network_LocalTest config.Network = "local-test" )
Variables ¶
This section is empty.
Functions ¶
func NewMetricsConfig ¶
func NewMetricsConfig() *config.MetricsConfig
Generates a new metrics config
Types ¶
type HyperdriveConfig ¶
type HyperdriveConfig struct {
// General settings
Network config.Parameter[config.Network]
ClientMode config.Parameter[config.ClientMode]
EnableIPv6 config.Parameter[bool]
ProjectName config.Parameter[string]
ApiPort config.Parameter[uint16]
UserDataPath config.Parameter[string]
AutoTxMaxFee config.Parameter[float64]
MaxPriorityFee config.Parameter[float64]
AutoTxGasThreshold config.Parameter[float64]
AdditionalDockerNetworks config.Parameter[string]
ClientTimeout config.Parameter[uint16]
// The Docker Hub tag for the daemon container
ContainerTag config.Parameter[string]
// Logging
Logging *config.LoggerConfig
// Execution client settings
LocalExecutionClient *config.LocalExecutionConfig
ExternalExecutionClient *config.ExternalExecutionConfig
// Beacon node settings
LocalBeaconClient *config.LocalBeaconConfig
ExternalBeaconClient *config.ExternalBeaconConfig
// Fallback clients
Fallback *config.FallbackConfig
// Metrics
Metrics *config.MetricsConfig
// PBS
Pbs *pbs.PbsConfig
// Modules
Modules map[string]any
// Internal fields
Version string
// contains filtered or unexported fields
}
The master configuration struct
func LoadFromFile ¶
func LoadFromFile(path string, networks []*HyperdriveSettings) (*HyperdriveConfig, error)
Load configuration settings from a file
func NewHyperdriveConfig ¶
func NewHyperdriveConfig(hdDir string, networks []*HyperdriveSettings) (*HyperdriveConfig, error)
Creates a new Hyperdrive configuration instance
func NewHyperdriveConfigForNetwork ¶
func NewHyperdriveConfigForNetwork(hdDir string, networks []*HyperdriveSettings, selectedNetwork config.Network) (*HyperdriveConfig, error)
Creates a new Hyperdrive configuration instance for a specific network
func (*HyperdriveConfig) AutoTxGasThresholdInt ¶
func (cfg *HyperdriveConfig) AutoTxGasThresholdInt() uint64
func (*HyperdriveConfig) AutoTxMaxFeeInt ¶
func (cfg *HyperdriveConfig) AutoTxMaxFeeInt() uint64
func (*HyperdriveConfig) BeaconNodeContainerName ¶
func (c *HyperdriveConfig) BeaconNodeContainerName() string
func (*HyperdriveConfig) BeaconNodeDataVolume ¶
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) ChangeNetwork ¶
func (cfg *HyperdriveConfig) ChangeNetwork(newNetwork config.Network)
Changes the current network, propagating new parameter settings if they are affected
func (*HyperdriveConfig) Clone ¶
func (cfg *HyperdriveConfig) Clone() *HyperdriveConfig
Creates a copy of the configuration
func (*HyperdriveConfig) DaemonContainerName ¶
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 ¶
func (c *HyperdriveConfig) ExecutionClientContainerName() string
func (*HyperdriveConfig) ExecutionClientDataVolume ¶
func (c *HyperdriveConfig) ExecutionClientDataVolume() string
func (*HyperdriveConfig) ExporterContainerName ¶
func (c *HyperdriveConfig) ExporterContainerName() string
func (*HyperdriveConfig) FallbackBnHttpUrl ¶
func (cfg *HyperdriveConfig) FallbackBnHttpUrl() string
func (*HyperdriveConfig) FallbackBnRpcUrl ¶
func (cfg *HyperdriveConfig) FallbackBnRpcUrl() string
func (*HyperdriveConfig) GetAdditionalDockerNetworks ¶
func (cfg *HyperdriveConfig) GetAdditionalDockerNetworks() []string
func (*HyperdriveConfig) GetApiLogFilePath ¶
func (cfg *HyperdriveConfig) GetApiLogFilePath() 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) GetBeaconNodeUrls ¶
func (cfg *HyperdriveConfig) GetBeaconNodeUrls() (string, string)
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
Container tag for the daemon
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) GetEthNetworkName ¶ added in v1.1.0
func (cfg *HyperdriveConfig) GetEthNetworkName() string
Get the Eth network name of the selected network
func (*HyperdriveConfig) GetExecutionClientUrls ¶
func (cfg *HyperdriveConfig) GetExecutionClientUrls() (string, string)
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) GetLoggerOptions ¶
func (cfg *HyperdriveConfig) GetLoggerOptions() log.LoggerOptions
func (*HyperdriveConfig) GetModuleLogFilePath ¶
func (cfg *HyperdriveConfig) GetModuleLogFilePath(moduleName string, moduleLogName string) string
func (*HyperdriveConfig) GetNetworkSettings ¶ added in v1.1.0
func (cfg *HyperdriveConfig) GetNetworkSettings() []*HyperdriveSettings
Get all loaded network settings
func (*HyperdriveConfig) GetNodeAddressFilePath ¶
func (cfg *HyperdriveConfig) GetNodeAddressFilePath() string
func (*HyperdriveConfig) GetParameters ¶
func (cfg *HyperdriveConfig) GetParameters() []config.IParameter
Get the config.Parameters for this config
func (*HyperdriveConfig) GetPasswordFilePath ¶
func (cfg *HyperdriveConfig) GetPasswordFilePath() string
func (*HyperdriveConfig) GetPbsConfigPath ¶ added in v1.3.0
func (cfg *HyperdriveConfig) GetPbsConfigPath() string
Get the path within the user dir that stores PBS config data
func (*HyperdriveConfig) GetPbsStartScript ¶ added in v1.3.0
func (cfg *HyperdriveConfig) GetPbsStartScript() string
Gets the name of the PBS start script
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 ¶
func (cfg *HyperdriveConfig) GetSelectedBeaconNode() config.BeaconNode
Get the selected Beacon Node
func (*HyperdriveConfig) GetSelectedExecutionClient ¶
func (cfg *HyperdriveConfig) GetSelectedExecutionClient() config.ExecutionClient
Get the selected Beacon Node
func (*HyperdriveConfig) GetSubconfigs ¶
func (cfg *HyperdriveConfig) GetSubconfigs() map[string]config.IConfigSection
Get the subconfigurations for this config
func (*HyperdriveConfig) GetTasksLogFilePath ¶
func (cfg *HyperdriveConfig) GetTasksLogFilePath() string
func (*HyperdriveConfig) GetTitle ¶
func (cfg *HyperdriveConfig) GetTitle() string
Get the title for this config
func (*HyperdriveConfig) GetUserDirectory ¶
func (cfg *HyperdriveConfig) GetUserDirectory() string
func (*HyperdriveConfig) GetVcStartScript ¶
func (cfg *HyperdriveConfig) GetVcStartScript() string
Gets the name of the Validator Client start script
func (*HyperdriveConfig) GetWalletFilePath ¶
func (cfg *HyperdriveConfig) GetWalletFilePath() string
func (*HyperdriveConfig) GrafanaContainerName ¶
func (c *HyperdriveConfig) GrafanaContainerName() string
func (*HyperdriveConfig) GraffitiPrefix ¶
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) PbsClientContainerName ¶ added in v1.3.0
func (c *HyperdriveConfig) PbsClientContainerName() string
func (*HyperdriveConfig) PbsUrl ¶ added in v1.3.0
func (cfg *HyperdriveConfig) PbsUrl() string
Used by text/template to format validator.yml
func (*HyperdriveConfig) PrometheusContainerName ¶
func (c *HyperdriveConfig) PrometheusContainerName() string
func (*HyperdriveConfig) Serialize ¶
func (cfg *HyperdriveConfig) Serialize(modules []IModuleConfig, includeUserDir bool) map[string]any
Serializes the configuration into a map of maps, compatible with a settings file
type HyperdriveResources ¶ added in v1.1.0
type HyperdriveResources struct {
// The URL for the NodeSet API server
NodeSetApiUrl string `yaml:"nodeSetApiUrl" json:"nodeSetApiUrl"`
// The pubkey used to encrypt messages to nodeset.io
EncryptionPubkey string `yaml:"encryptionPubkey" json:"encryptionPubkey"`
}
A collection of network-specific resources and getters for them
var ( // Mainnet resources for reference in testing MainnetResourcesReference *HyperdriveResources = &HyperdriveResources{ NodeSetApiUrl: NodesetUrlProd, } // Hoodi resources for reference in testing HoodiResourcesReference *HyperdriveResources = &HyperdriveResources{ NodeSetApiUrl: NodesetUrlProd, } // Hoodi Devnet resources for reference in testing HoodiDevResourcesReference *HyperdriveResources = &HyperdriveResources{ NodeSetApiUrl: NodesetUrlStaging, } )
type HyperdriveSettings ¶ added in v1.1.0
type HyperdriveSettings struct {
*config.NetworkSettings `yaml:",inline"`
// Hyperdrive resources for the network
HyperdriveResources *HyperdriveResources `yaml:"hyperdriveResources" json:"hyperdriveResources"`
}
Network settings with a field for Hyperdrive-specific settings
func LoadSettingsFiles ¶ added in v1.1.0
func LoadSettingsFiles(sourceDir string) ([]*HyperdriveSettings, error)
Load network settings from a folder
type IModuleConfig ¶
type IModuleConfig interface {
config.IConfigSection
// Get the name of the module
GetModuleName() string
// Get the short name of the module, for things like prefixing
GetShortName() string
// The name to use for the Hyperdrive Client log file
GetHdClientLogFileName() string
// The name to use for the API log file
GetApiLogFileName() string
// The name to use for the tasks log file
GetTasksLogFileName() string
// Get the list of all log file names used by the module
GetLogNames() []string
// A map of the Validator Client IDs to their container tags
GetValidatorContainerTagInfo() map[config.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() []config.ContainerID
// Handle a network change, for example by updating the default parameters
ChangeNetwork(oldNetwork config.Network, newNetwork config.Network)
// Create a copy of this config
Clone() IModuleConfig
// Update the default parameters based on the Hyperdrive config's current network value
UpdateDefaults(network config.Network)
// Verify the current settings and publish a list of errors that must be resolved before saving
Validate() []string
// Serialize the module config to a map
Serialize() map[string]any
// Deserialize the module config from a map
Deserialize(configMap map[string]any, network config.Network) error
// Get the version of the module config
GetVersion() string
}
type MergedResources ¶ added in v1.1.0
type MergedResources struct {
// Base network resources
*config.NetworkResources
// Hyperdrive resources
*HyperdriveResources
}
An aggregated collection of resources for the selected network, including Hyperdrive resources