Documentation ¶
Index ¶
- Constants
- func GetNodesetStatus(pubKey beacon.ValidatorPubkey, ...) swtypes.NodesetStatus
- func IsUploadedToNodeset(pubKey beacon.ValidatorPubkey, registeredPubkeys []beacon.ValidatorPubkey) bool
- type DepositDataManager
- func (m *DepositDataManager) ComputeMerkleRoot(data []beacon.ExtendedDepositData) (common.Hash, error)
- func (m *DepositDataManager) GenerateDepositData(logger *slog.Logger, keys []*eth2types.BLSPrivateKey) ([]beacon.ExtendedDepositData, error)
- func (m *DepositDataManager) GetDepositData() ([]byte, error)
- func (m *DepositDataManager) UpdateDepositData(data []beacon.ExtendedDepositData) error
- type IDepositDataManagerProvider
- type IStakeWiseConfigProvider
- type IStakeWiseRequirementsProvider
- type IStakeWiseServiceProvider
- func NewStakeWiseServiceProvider(sp services.IModuleServiceProvider, settingsList []*swconfig.StakeWiseSettings) (IStakeWiseServiceProvider, error)
- func NewStakeWiseServiceProviderFromCustomServices(sp services.IModuleServiceProvider, cfg *swconfig.StakeWiseConfig, ...) (IStakeWiseServiceProvider, error)
- type IStakeWiseWalletProvider
- type Wallet
- func (w *Wallet) CheckIfStakewiseWalletExists() (bool, error)
- func (w *Wallet) DerivePubKeys(privateKeys []*eth2types.BLSPrivateKey) ([]beacon.ValidatorPubkey, error)
- func (w *Wallet) GenerateNewValidatorKey() (*eth2types.BLSPrivateKey, error)
- func (w *Wallet) GetAllPrivateKeys() ([]*eth2types.BLSPrivateKey, error)
- func (w *Wallet) GetLatestDepositDataVersion() int
- func (w *Wallet) GetPrivateKeyForPubkey(pubkey beacon.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
- func (w *Wallet) Reload() error
- func (w *Wallet) SaveStakewiseWallet(ethKey []byte, password string) error
- func (w *Wallet) SetLatestDepositDataVersion(version int) error
Constants ¶
const ( // Stakewise validators deposit a full 32 ETH StakewiseDepositAmount uint64 = 32e9 )
Variables ¶
This section is empty.
Functions ¶
func GetNodesetStatus ¶ added in v1.0.0
func GetNodesetStatus(pubKey beacon.ValidatorPubkey, registeredPubkeysStatusMapping map[beacon.ValidatorPubkey]stakewise.StakeWiseStatus) swtypes.NodesetStatus
func IsUploadedToNodeset ¶ added in v0.1.2
func IsUploadedToNodeset(pubKey beacon.ValidatorPubkey, registeredPubkeys []beacon.ValidatorPubkey) bool
Types ¶
type DepositDataManager ¶
type DepositDataManager struct {
// contains filtered or unexported fields
}
DepositDataManager manages the aggregated deposit data file that Stakewise uses
func NewDepositDataManager ¶
func NewDepositDataManager(sp IStakeWiseServiceProvider) (*DepositDataManager, error)
Creates a new manager
func (*DepositDataManager) ComputeMerkleRoot ¶
func (m *DepositDataManager) ComputeMerkleRoot(data []beacon.ExtendedDepositData) (common.Hash, error)
Compute the Merkle root of the aggregated deposit data using the Stakewise rules NOTE: reverse engineered from https://github.com/stakewise/v3-operator/blob/fa4ac2673a64a486ced51098005376e56e2ddd19/src/validators/utils.py#L207
func (*DepositDataManager) GenerateDepositData ¶
func (m *DepositDataManager) GenerateDepositData(logger *slog.Logger, keys []*eth2types.BLSPrivateKey) ([]beacon.ExtendedDepositData, error)
Generates deposit data for the provided keys
func (*DepositDataManager) GetDepositData ¶
func (m *DepositDataManager) GetDepositData() ([]byte, error)
Read the deposit data file
func (*DepositDataManager) UpdateDepositData ¶
func (m *DepositDataManager) UpdateDepositData(data []beacon.ExtendedDepositData) error
Save the deposit data file
type IDepositDataManagerProvider ¶ added in v1.1.0
type IDepositDataManagerProvider interface { // Gets the deposit data manager GetDepositDataManager() *DepositDataManager }
Provides the deposit data manager
type IStakeWiseConfigProvider ¶ added in v1.1.0
type IStakeWiseConfigProvider interface { // Gets the StakeWise config GetConfig() *swconfig.StakeWiseConfig // Gets the StakeWise resources GetResources() *swconfig.MergedResources }
Provides the StakeWise module config and resources
type IStakeWiseRequirementsProvider ¶ added in v1.1.0
type IStakeWiseRequirementsProvider interface { RequireStakewiseWalletReady(ctx context.Context, status wallet.WalletStatus) error WaitForStakewiseWallet(ctx context.Context) error }
Provides requirements for the StakeWise daemon
type IStakeWiseServiceProvider ¶ added in v1.1.0
type IStakeWiseServiceProvider interface { IStakeWiseConfigProvider IStakeWiseWalletProvider IDepositDataManagerProvider IStakeWiseRequirementsProvider services.IModuleServiceProvider }
func NewStakeWiseServiceProvider ¶ added in v1.0.0
func NewStakeWiseServiceProvider(sp services.IModuleServiceProvider, settingsList []*swconfig.StakeWiseSettings) (IStakeWiseServiceProvider, error)
Create a new service provider with Stakewise daemon-specific features
func NewStakeWiseServiceProviderFromCustomServices ¶ added in v1.0.0
func NewStakeWiseServiceProviderFromCustomServices(sp services.IModuleServiceProvider, cfg *swconfig.StakeWiseConfig, resources *swconfig.MergedResources) (IStakeWiseServiceProvider, error)
Create a new service provider with Stakewise daemon-specific features, using custom services instead of loading them from the module service provider.
type IStakeWiseWalletProvider ¶ added in v1.1.0
type IStakeWiseWalletProvider interface { // Gets the wallet GetWallet() *Wallet }
Provides the StakeWise wallet
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet manager for the Stakewise daemon
func NewWallet ¶
func NewWallet(sp services.IModuleServiceProvider) (*Wallet, error)
Create a new wallet
func (*Wallet) CheckIfStakewiseWalletExists ¶
Check if the Stakewise wallet and password files exist
func (*Wallet) DerivePubKeys ¶
func (w *Wallet) DerivePubKeys(privateKeys []*eth2types.BLSPrivateKey) ([]beacon.ValidatorPubkey, error)
Get the private validator key with the corresponding pubkey
func (*Wallet) GenerateNewValidatorKey ¶
func (w *Wallet) GenerateNewValidatorKey() (*eth2types.BLSPrivateKey, error)
Generate a new validator key and save it
func (*Wallet) GetAllPrivateKeys ¶
func (w *Wallet) GetAllPrivateKeys() ([]*eth2types.BLSPrivateKey, error)
Gets all of the validator private keys that are stored in the Stakewise keystore folder
func (*Wallet) GetLatestDepositDataVersion ¶
Get the version of the aggregated deposit data from the NodeSet server that's stored on disk
func (*Wallet) GetPrivateKeyForPubkey ¶
func (w *Wallet) GetPrivateKeyForPubkey(pubkey beacon.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
Get the private validator key with the corresponding pubkey
func (*Wallet) SaveStakewiseWallet ¶
Saves the Stakewise wallet and password files
func (*Wallet) SetLatestDepositDataVersion ¶
Set the latest deposit data version and save the wallet data