Documentation
¶
Index ¶
- Constants
- type AttestationInfo
- type BeaconBlock
- type BeaconHead
- type ByteArray
- type DerivationPath
- type Eth1Data
- type Eth2Config
- type Eth2DepositContract
- type ExtendedDepositData
- type HardwareWalletData
- type IBeaconClient
- type LocalWalletData
- type SyncStatus
- type ValidatorKeystore
- type ValidatorState
- type ValidatorStatus
- type ValidatorStatusOptions
- type WalletData
- type WalletStatus
- type WalletType
Constants ¶
View Source
const ( RocketPoolValidatorPath string = "m/12381/3600/%d/0/0" StakewiseValidatorPath string = "m/12381/3600/%d/1/0" ConstellationValidatorPath string = "m/12381/3600/%d/2/0" SoloValidatorPath string = "m/12381/3600/%d/3/0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestationInfo ¶
type BeaconBlock ¶
type BeaconHead ¶
type ByteArray ¶
type ByteArray []byte
Byte array type
func (ByteArray) MarshalJSON ¶
func (*ByteArray) UnmarshalJSON ¶
type DerivationPath ¶
type DerivationPath string
const ( DerivationPath_Default DerivationPath = "" DerivationPath_LedgerLive DerivationPath = "ledger-live" DerivationPath_Mew DerivationPath = "mew" )
type Eth2Config ¶
type Eth2DepositContract ¶
type ExtendedDepositData ¶
type ExtendedDepositData struct {
PublicKey ByteArray `json:"pubkey"`
WithdrawalCredentials ByteArray `json:"withdrawal_credentials"`
Amount uint64 `json:"amount"`
Signature ByteArray `json:"signature"`
DepositMessageRoot ByteArray `json:"deposit_message_root"`
DepositDataRoot ByteArray `json:"deposit_data_root"`
ForkVersion ByteArray `json:"fork_version"`
NetworkName string `json:"network_name"`
HyperdriveVersion string `json:"hyperdrive_version,omitempty"`
}
Extended deposit data beyond what is required in an actual deposit message to Beacon, emulating what the deposit CLI produces
type IBeaconClient ¶
type IBeaconClient interface {
GetSyncStatus(ctx context.Context) (SyncStatus, error)
GetEth2Config(ctx context.Context) (Eth2Config, error)
GetEth2DepositContract(ctx context.Context) (Eth2DepositContract, error)
GetAttestations(ctx context.Context, blockId string) ([]AttestationInfo, bool, error)
GetBeaconBlock(ctx context.Context, blockId string) (BeaconBlock, bool, error)
GetBeaconHead(ctx context.Context) (BeaconHead, error)
GetValidatorStatusByIndex(ctx context.Context, index string, opts *ValidatorStatusOptions) (ValidatorStatus, error)
GetValidatorStatus(ctx context.Context, pubkey beacon.ValidatorPubkey, opts *ValidatorStatusOptions) (ValidatorStatus, error)
GetValidatorStatuses(ctx context.Context, pubkeys []beacon.ValidatorPubkey, opts *ValidatorStatusOptions) (map[beacon.ValidatorPubkey]ValidatorStatus, error)
GetValidatorIndex(ctx context.Context, pubkey beacon.ValidatorPubkey) (string, error)
GetValidatorSyncDuties(ctx context.Context, indices []string, epoch uint64) (map[string]bool, error)
GetValidatorProposerDuties(ctx context.Context, indices []string, epoch uint64) (map[string]uint64, error)
GetDomainData(ctx context.Context, domainType []byte, epoch uint64, useGenesisFork bool) ([]byte, error)
ExitValidator(ctx context.Context, validatorIndex string, epoch uint64, signature beacon.ValidatorSignature) error
Close(ctx context.Context) error
GetEth1DataForEth2Block(ctx context.Context, blockId string) (Eth1Data, bool, error)
ChangeWithdrawalCredentials(ctx context.Context, validatorIndex string, fromBlsPubkey beacon.ValidatorPubkey, toExecutionAddress common.Address, signature beacon.ValidatorSignature) error
}
Beacon client interface
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 ValidatorKeystore ¶
type ValidatorKeystore struct {
Crypto map[string]interface{} `json:"crypto"`
Name string `json:"name,omitempty"` // Technically not part of the spec but Prysm needs it
Version uint `json:"version"`
UUID uuid.UUID `json:"uuid"`
Path string `json:"path"`
Pubkey beacon.ValidatorPubkey `json:"pubkey,omitempty"`
}
Encrypted validator keystore following the EIP-2335 standard (https://eips.ethereum.org/EIPS/eip-2335)
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" )
Click to show internal directories.
Click to hide internal directories.