swconfig

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: AGPL-3.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ModuleName           string = "stakewise"
	ShortModuleName      string = "sw"
	DaemonBaseRoute      string = ModuleName
	ApiVersion           string = "1"
	ApiClientRoute       string = DaemonBaseRoute + "/api/v" + ApiVersion
	WalletFilename       string = "wallet.json"
	PasswordFilename     string = "password.txt"
	KeystorePasswordFile string = "secret.txt"
	DepositDataFile      string = "deposit-data.json"
	AvailableKeysFile    string = "available-keys.json"
	OracleManagerFile    string = "oracle-data.json"
	DefaultApiPort       uint16 = 8180
	RelayLogName         string = "relay.log"
	DefaultRelayPort     uint16 = 18180

	// Volumes
	DataVolume string = "swdata"

	// Logging
	ClientLogName string = "hd.log"
)
View Source
const (
	// The stakewise Hyperdrive daemon
	ContainerID_StakeWiseDaemon config.ContainerID = "sw_daemon"

	// The stakewise operator container
	ContainerID_StakewiseOperator config.ContainerID = "sw_operator"

	// The stakewise Validator client
	ContainerID_StakewiseValidator config.ContainerID = "sw_vc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MergedResources added in v1.1.0

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

	// StakeWise-specific resources
	*StakeWiseResources
}

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

type StakeWiseConfig added in v1.0.0

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

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

	// Port to run the StakeWise Relay server on
	RelayPort config.Parameter[uint16]

	// Toggle for verifying deposit data Merkle roots before saving
	VerifyDepositsRoot config.Parameter[bool]

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

	// The Docker Hub tag for the Stakewise operator
	OperatorContainerTag config.Parameter[string]

	// Custom command line flags
	AdditionalOpFlags 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 Stakewise

func NewStakeWiseConfig added in v1.0.0

func NewStakeWiseConfig(hdCfg *hdconfig.HyperdriveConfig, networks []*StakeWiseSettings) (*StakeWiseConfig, error)

Generates a new Stakewise config

func (*StakeWiseConfig) ChangeNetwork added in v1.0.0

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

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

func (*StakeWiseConfig) Clone added in v1.0.0

func (cfg *StakeWiseConfig) Clone() hdconfig.IModuleConfig

Creates a copy of the configuration

func (*StakeWiseConfig) DaemonContainerName added in v1.0.0

func (c *StakeWiseConfig) DaemonContainerName() string

func (*StakeWiseConfig) DataVolume added in v1.0.2

func (c *StakeWiseConfig) DataVolume() string

func (*StakeWiseConfig) DepositDataFile added in v1.0.0

func (c *StakeWiseConfig) DepositDataFile() string

func (*StakeWiseConfig) Deserialize added in v1.0.0

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

Deserialize the module config from a map

func (*StakeWiseConfig) GetApiLogFileName added in v1.0.0

func (cfg *StakeWiseConfig) GetApiLogFileName() string

func (*StakeWiseConfig) GetContainersToDeploy added in v1.0.0

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

func (*StakeWiseConfig) GetDaemonContainerTag added in v1.0.0

func (cfg *StakeWiseConfig) GetDaemonContainerTag() string

The tag for the daemon container

func (*StakeWiseConfig) GetHdClientLogFileName added in v1.0.0

func (cfg *StakeWiseConfig) GetHdClientLogFileName() string

func (*StakeWiseConfig) GetLogNames added in v1.0.0

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

func (*StakeWiseConfig) GetModuleName added in v1.0.0

func (cfg *StakeWiseConfig) GetModuleName() string

The module name

func (*StakeWiseConfig) GetNetworkSettings added in v1.1.0

func (cfg *StakeWiseConfig) GetNetworkSettings() []*StakeWiseSettings

Get all loaded network settings

func (*StakeWiseConfig) GetParameters added in v1.0.0

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

Get the parameters for this config

func (*StakeWiseConfig) GetRelayLogFileName added in v1.2.0

func (cfg *StakeWiseConfig) GetRelayLogFileName() string

func (*StakeWiseConfig) GetShortName added in v1.0.0

func (cfg *StakeWiseConfig) GetShortName() string

The module name

func (*StakeWiseConfig) GetSubconfigs added in v1.0.0

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

Get the sections underneath this one

func (*StakeWiseConfig) GetTasksLogFileName added in v1.0.0

func (cfg *StakeWiseConfig) GetTasksLogFileName() string

func (*StakeWiseConfig) GetTitle added in v1.0.0

func (cfg *StakeWiseConfig) GetTitle() string

The title for the config

func (*StakeWiseConfig) GetValidatorContainerTagInfo added in v1.0.0

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

func (*StakeWiseConfig) GetVcAdditionalFlags added in v1.0.0

func (cfg *StakeWiseConfig) GetVcAdditionalFlags() string

Gets the additional flags of the selected VC

func (*StakeWiseConfig) GetVcContainerTag added in v1.0.0

func (cfg *StakeWiseConfig) GetVcContainerTag() string

Get the container tag of the selected VC

func (*StakeWiseConfig) GetVersion added in v1.0.0

func (cfg *StakeWiseConfig) GetVersion() string

Get the version of the module config

func (*StakeWiseConfig) Graffiti added in v1.0.0

func (cfg *StakeWiseConfig) Graffiti() (string, error)

Used by text/template to format validator.yml

func (*StakeWiseConfig) IsDoppelgangerEnabled added in v1.0.0

func (cfg *StakeWiseConfig) IsDoppelgangerEnabled() bool

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

func (*StakeWiseConfig) IsEnabled added in v1.0.0

func (cfg *StakeWiseConfig) IsEnabled() bool

func (*StakeWiseConfig) KeystorePasswordFile added in v1.0.0

func (c *StakeWiseConfig) KeystorePasswordFile() string

func (*StakeWiseConfig) OperatorContainerName added in v1.0.0

func (c *StakeWiseConfig) OperatorContainerName() string

func (*StakeWiseConfig) PasswordFilename added in v1.0.0

func (c *StakeWiseConfig) PasswordFilename() string

func (*StakeWiseConfig) Serialize added in v1.0.0

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

Serialize the module config to a map

func (*StakeWiseConfig) UpdateDefaults added in v1.0.0

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

Updates the default parameters based on the current network value

func (*StakeWiseConfig) Validate added in v1.0.0

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

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

func (*StakeWiseConfig) VcContainerName added in v1.0.0

func (c *StakeWiseConfig) VcContainerName() string

func (*StakeWiseConfig) WalletFilename added in v1.0.0

func (c *StakeWiseConfig) WalletFilename() string

type StakeWiseResources added in v1.1.0

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

	// The address of the Stakewise v3 vault contract, the withdrawal address for all Stakewise validators on Beacon.
	// It's also the address of an ERC-20 token on the EL, which is an LST for the NodeSet partner administrating the vault.
	// See https://app.stakewise.io/vault/mainnet/<vault_address> for details.
	Vault common.Address `yaml:"vault" json:"vault"`

	// The address of the NodeSet fee recipient, the Stakewise "smoothing pool".
	// See https://github.com/stakewise/v3-core/blob/main/contracts/vaults/ethereum/mev/SharedMevEscrow.sol
	FeeRecipient common.Address `yaml:"feeRecipient" json:"feeRecipient"`

	// The address of the Stakewise keeper contract
	Keeper common.Address `yaml:"keeper" json:"keeper"`

	// The block on the network that StakeWise's keeper contract was deployed
	KeeperGenesisBlock *big.Int `yaml:"keeperGenesisBlock" json:"keeperGenesisBlock"`
}

A collection of network-specific resources and getters for them

var (
	// Mainnet resources for reference in testing
	MainnetResourcesReference *StakeWiseResources = &StakeWiseResources{
		Vault:        common.HexToAddress("0xE2AEECC76839692AEa35a8D119181b14ebf411c9"),
		FeeRecipient: common.HexToAddress("0x48319f97E5Da1233c21c48b80097c0FB7a20Ff86"),

		Keeper:             common.HexToAddress("0x6B5815467da09DaA7DC83Db21c9239d98Bb487b5"),
		KeeperGenesisBlock: big.NewInt(18470089),
	}

	// Hoodi devnet resources for reference in testing
	HoodiDevResourcesReference *StakeWiseResources = &StakeWiseResources{
		Vault:        common.HexToAddress("0xb163b6d4e1b317f3b4bace8770d74c1c21c4a131"),
		FeeRecipient: common.HexToAddress("0x51FD45BAEfB12f54766B5C4d639b360Ea50063bd"),

		Keeper:             common.HexToAddress("0xA7D1Ac9D6F32B404C75626874BA56f7654c1dC0f"),
		KeeperGenesisBlock: big.NewInt(94074),
	}

	// Hoodi resources for reference in testing
	HoodiResourcesReference *StakeWiseResources = &StakeWiseResources{
		Vault:        common.HexToAddress("0x2b3eb77e5cbde5deb70c928e1e2814f8a6f143e0"),
		FeeRecipient: common.HexToAddress("0x51FD45BAEfB12f54766B5C4d639b360Ea50063bd"),

		Keeper:             common.HexToAddress("0xA7D1Ac9D6F32B404C75626874BA56f7654c1dC0f"),
		KeeperGenesisBlock: big.NewInt(94074),
	}
)

type StakeWiseSettings added in v1.1.0

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

	// Hyperdrive resources for the network
	StakeWiseResources *StakeWiseResources `yaml:"stakeWiseResources" json:"stakeWiseResources"`

	// 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 StakeWise-specific settings

func LoadSettingsFiles added in v1.1.0

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

Load network settings from a folder

type StakeWiseVault added in v1.2.0

type StakeWiseVault struct {
	// Whether or not the vault is enabled on the node
	Enabled bool `yaml:"enabled" json:"enabled"`

	// The address of the vault contract
	Address common.Address `yaml:"address" json:"address"`

	// The fee recipient to use for the vault
	FeeRecipient common.Address `yaml:"feeRecipient" json:"feeRecipient"`
}

Details for a StakeWise vault

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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