Documentation
¶
Index ¶
- type AttestationInfo
- type BeaconBlock
- type BeaconHead
- type BeaconNode
- type ChangedSection
- type ChangedSetting
- type ClientMode
- type ContainerID
- type DerivationPath
- type Eth1Data
- type Eth2Config
- type Eth2DepositContract
- type ExecutionClient
- type HardwareWalletData
- type IBeaconClient
- type IParameter
- type IParameterOption
- type LocalWalletData
- type Network
- type Parameter
- func (p *Parameter[_]) ChangeNetwork(oldNetwork Network, newNetwork Network)
- func (p *Parameter[_]) Deserialize(serializedParam string, network Network) error
- func (p *Parameter[_]) GetCommon() *ParameterCommon
- func (p *Parameter[Type]) GetDefault(network Network) Type
- func (p *Parameter[_]) GetDefaultAsAny(network Network) any
- func (p *Parameter[_]) GetOptions() []IParameterOption
- func (p *Parameter[_]) GetValueAsAny() any
- func (p *Parameter[Type]) SetToDefault(network Network)
- func (p *Parameter[Type]) SetValue(value any)
- func (p *Parameter[_]) String() string
- type ParameterCommon
- type ParameterOption
- type ParameterOptionCommon
- type RpcPortMode
- type SyncStatus
- type ValidatorState
- type ValidatorStatus
- type ValidatorStatusOptions
- type WalletData
- type WalletStatus
- type WalletType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestationInfo ¶
type BeaconBlock ¶
type BeaconHead ¶
type BeaconNode ¶
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 ChangedSection ¶
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
type ChangedSetting ¶
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 ¶
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 ¶
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 DerivationPath ¶
type DerivationPath string
const ( DerivationPath_Default DerivationPath = "" DerivationPath_LedgerLive DerivationPath = "ledger-live" DerivationPath_Mew DerivationPath = "mew" )
type Eth2Config ¶
type Eth2DepositContract ¶
type ExecutionClient ¶
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 IBeaconClient ¶
type IBeaconClient interface {
GetSyncStatus() (SyncStatus, error)
GetEth2Config() (Eth2Config, error)
GetEth2DepositContract() (Eth2DepositContract, error)
GetAttestations(blockId string) ([]AttestationInfo, bool, error)
GetBeaconBlock(blockId string) (BeaconBlock, bool, error)
GetBeaconHead() (BeaconHead, error)
GetValidatorStatusByIndex(index string, opts *ValidatorStatusOptions) (ValidatorStatus, error)
GetValidatorStatus(pubkey beacon.ValidatorPubkey, opts *ValidatorStatusOptions) (ValidatorStatus, error)
GetValidatorStatuses(pubkeys []beacon.ValidatorPubkey, opts *ValidatorStatusOptions) (map[beacon.ValidatorPubkey]ValidatorStatus, error)
GetValidatorIndex(pubkey beacon.ValidatorPubkey) (string, error)
GetValidatorSyncDuties(indices []string, epoch uint64) (map[string]bool, error)
GetValidatorProposerDuties(indices []string, epoch uint64) (map[string]uint64, error)
GetDomainData(domainType []byte, epoch uint64, useGenesisFork bool) ([]byte, error)
ExitValidator(validatorIndex string, epoch uint64, signature beacon.ValidatorSignature) error
Close() error
GetEth1DataForEth2Block(blockId string) (Eth1Data, bool, error)
ChangeWithdrawalCredentials(validatorIndex string, fromBlsPubkey beacon.ValidatorPubkey, toExecutionAddress common.Address, signature beacon.ValidatorSignature) error
}
Beacon client interface
type IParameter ¶
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 ¶
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 LocalWalletData ¶
type LocalWalletData struct {
// Encrypted seed information
Crypto map[string]interface{} `json:"crypto"`
// Name of the encryptor used to generate the keystore
Name string `json:"name"`
// Version of the encryptor used to generate the keystore
Version uint `json:"version"`
// Unique ID for this keystore
UUID uuid.UUID `json:"uuid"`
// The path that should be used to derive the target key; assumes there's only one index that can be iterated on
DerivationPath string `json:"derivationPath,omitempty"`
// The index of the target wallet, used to format DerivationPath
WalletIndex uint `json:"walletIndex,omitempty"`
}
Keystore for local node wallets - note that this is NOT an EIP-2335 keystore.
type Network ¶
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 Parameter ¶
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 ¶
Apply a network change to a parameter
func (*Parameter[_]) Deserialize ¶
Deserializes a string into this parameter's value
func (*Parameter[_]) GetCommon ¶
func (p *Parameter[_]) GetCommon() *ParameterCommon
Get the parameter's common fields
func (*Parameter[Type]) GetDefault ¶
Get the default value for the provided network
func (*Parameter[_]) GetDefaultAsAny ¶
Get the default value for the provided network
func (*Parameter[_]) GetOptions ¶
func (p *Parameter[_]) GetOptions() []IParameterOption
Get the common fields from each ParameterOption (returns nil if this isn't a choice parameter)
func (*Parameter[_]) GetValueAsAny ¶
Get the parameter's value
func (*Parameter[Type]) SetToDefault ¶
Set the value to the default for the provided config's network
type ParameterCommon ¶
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 ¶
func (p *ParameterCommon) UpdateDescription(network Network)
Set the network-specific description of the parameter
type ParameterOption ¶
type ParameterOption[Type any] struct { *ParameterOptionCommon // The underlying value for this option Value Type }
A single option in a choice parameter
func (*ParameterOption[_]) Common ¶
func (p *ParameterOption[_]) Common() *ParameterOptionCommon
Get the parameter option's common fields
func (*ParameterOption[_]) GetValueAsAny ¶
func (p *ParameterOption[_]) GetValueAsAny() any
Get the parameter's value
func (*ParameterOption[_]) String ¶
func (p *ParameterOption[_]) String() string
Get the parameter option's value as a string
type ParameterOptionCommon ¶
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 RpcPortMode ¶
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 ¶
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 ¶
func (m RpcPortMode) IsOpen() bool
True if the port is open locally or externally
type ValidatorState ¶
type ValidatorState string
const ( ValidatorState_PendingInitialized ValidatorState = "pending_initialized" ValidatorState_PendingQueued ValidatorState = "pending_queued" ValidatorState_ActiveOngoing ValidatorState = "active_ongoing" ValidatorState_ActiveExiting ValidatorState = "active_exiting" ValidatorState_ActiveSlashed ValidatorState = "active_slashed" ValidatorState_ExitedUnslashed ValidatorState = "exited_unslashed" ValidatorState_ExitedSlashed ValidatorState = "exited_slashed" ValidatorState_WithdrawalPossible ValidatorState = "withdrawal_possible" ValidatorState_WithdrawalDone ValidatorState = "withdrawal_done" )
type ValidatorStatus ¶
type ValidatorStatusOptions ¶
API request options
type WalletData ¶
type WalletData struct {
// The type of wallet
Type WalletType `json:"type"`
// Data about a local wallet
LocalData LocalWalletData `json:"localData"`
// Data about a hardware wallet
HardwareData HardwareWalletData `json:"hardwareData"`
}
Data storage for node wallets
type WalletStatus ¶
type WalletStatus struct {
Address struct {
NodeAddress common.Address `json:"nodeAddress"`
HasAddress bool `json:"hasAddress"`
} `json:"address"`
Wallet struct {
Type WalletType `json:"type"`
IsLoaded bool `json:"isLoaded"`
IsOnDisk bool `json:"isOnDisk"`
WalletAddress common.Address `json:"walletAddress"`
} `json:"wallet"`
Password struct {
IsPasswordSaved bool `json:"isPasswordSaved"`
} `json:"password"`
}
type WalletType ¶
type WalletType string
An enum describing the type of wallet used by the node
const ( // Unset wallet type WalletType_Unknown WalletType = "" // Indicator for local wallets that have encrypted keystores saved to disk WalletType_Local WalletType = "local" // Indicator for hardware wallets that store the private key offline WalletType_Hardware WalletType = "hardware" )