Documentation
¶
Index ¶
- Constants
- Variables
- func CheckObserveMode(path string) bool
- type AddressManager
- type ValidatorKey
- type Wallet
- func NewHdWallet(walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, ...) (Wallet, error)
- func NewMasqueradeWallet(walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, ...) (Wallet, error)
- func NewWallet(addressPath string, walletPath string, chainId uint, maxFee *big.Int, ...) (Wallet, error)
Constants ¶
View Source
const ( EntropyBits = 256 FileMode = 0600 DefaultNodeKeyPath = "m/44'/60'/0'/0/%d" LedgerLiveNodeKeyPath = "m/44'/60'/%d/0/0" MyEtherWalletNodeKeyPath = "m/44'/60'/0'/%d" )
Config
View Source
const (
MaxValidatorKeyRecoverAttempts uint = 1000
)
Config
Variables ¶
View Source
var ErrIsMasquerading = errors.New("The node is currently masquerading. Use the command 'rocketpool wallet end-masquerade' to restore the node wallet, if one is loaded.")
Functions ¶
func CheckObserveMode ¶ added in v1.20.6
CheckObserveMode reads the address file at path and returns true if observe mode is active. Returns false if the file doesn't exist, can't be read, or observe is not set.
Types ¶
type AddressManager ¶ added in v1.15.7
type AddressManager struct {
// contains filtered or unexported fields
}
Simple class to wrap the node's address file
func NewAddressManager ¶ added in v1.15.7
func NewAddressManager(path string) *AddressManager
Creates a new address manager
func (*AddressManager) DeleteAddressFile ¶ added in v1.15.7
func (m *AddressManager) DeleteAddressFile() error
Delete the saved address file from disk
func (*AddressManager) GetAddress ¶ added in v1.15.7
func (m *AddressManager) GetAddress() common.Address
Get the cached address
func (*AddressManager) IsObserve ¶ added in v1.20.6
func (m *AddressManager) IsObserve() bool
Get the cached observe flag
func (*AddressManager) LoadAddress ¶ added in v1.15.7
func (m *AddressManager) LoadAddress() (common.Address, error)
Gets the address saved on disk. Returns empty address if the address file doesn't exist. Also loads the observe flag as a side effect; check IsObserve() after calling.
func (*AddressManager) SetAndSaveAddress ¶ added in v1.15.7
func (m *AddressManager) SetAndSaveAddress(newAddress common.Address, observe bool) error
Sets the node address and observe flag, and saves both to disk
type ValidatorKey ¶ added in v1.7.0
type ValidatorKey struct {
PublicKey types.ValidatorPubkey
PrivateKey *eth2types.BLSPrivateKey
DerivationPath string
WalletIndex uint
}
A validator private/public key pair
type Wallet ¶
type Wallet interface {
AddKeystore(name string, ks keystore.Keystore)
CreateValidatorKey() (*eth2types.BLSPrivateKey, error)
Delete() error
DeleteValidatorStores() error
GetChainID() *big.Int
GetInitialized() (bool, error)
GetNextValidatorKey() (*eth2types.BLSPrivateKey, error)
GetNodeAccount() (accounts.Account, error)
GetNodeAccountTransactor() (*bind.TransactOpts, error)
GetNodePrivateKeyBytes() ([]byte, error)
GetValidatorKeyAt(index uint) (*eth2types.BLSPrivateKey, error)
GetValidatorKeyByPubkey(pubkey rptypes.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
GetValidatorKeyCount() (uint, error)
GetValidatorKeys(startIndex uint, length uint) ([]ValidatorKey, error)
Initialize(derivationPath string, walletIndex uint) (string, error)
IsInitialized() bool
LoadValidatorKey(pubkey rptypes.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
Recover(derivationPath string, walletIndex uint, mnemonic string) error
RecoverValidatorKey(pubkey rptypes.ValidatorPubkey, startIndex uint) (uint, error)
Reload() error
Save() error
SaveValidatorKey(key ValidatorKey) error
Sign(serializedTx []byte) ([]byte, error)
SignMessage(message string) ([]byte, error)
StoreValidatorKey(key *eth2types.BLSPrivateKey, path string) error
String() (string, error)
TestRecoverValidatorKey(pubkey rptypes.ValidatorPubkey, startIndex uint) (uint, error)
TestRecovery(derivationPath string, walletIndex uint, mnemonic string) error
MasqueradeAsAddress(address common.Address, observe bool) error
EndMasquerade() error
GetAddress() (common.Address, error)
IsNodeMasquerading() bool
}
func NewHdWallet ¶ added in v1.15.7
func NewHdWallet(walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, gasLimit uint64, passwordManager *passwords.PasswordManager, addressManager *AddressManager) (Wallet, error)
Create new hdWallet
func NewMasqueradeWallet ¶ added in v1.15.7
func NewMasqueradeWallet(walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, gasLimit uint64, passwordManager *passwords.PasswordManager, addressManager *AddressManager) (Wallet, error)
Create new masqueradeWallet
Source Files
¶
Click to show internal directories.
Click to hide internal directories.