Documentation ¶
Index ¶
- Variables
- func AcceptablePassphrase(passphrase string) bool
- func AttestationHeadCorrect(ctx context.Context, headersCache *BeaconBlockHeaderCache, ...) (bool, error)
- func AttestationTargetCorrect(ctx context.Context, headersCache *BeaconBlockHeaderCache, ...) (bool, error)
- func BLSID(id uint64) *bls.ID
- func BestPublicKey(account e2wtypes.Account) (e2types.PublicKey, error)
- func ConnectToBeaconNode(ctx context.Context, address string, timeout time.Duration, allowInsecure bool) (eth2client.Service, error)
- func GetBaseDir() string
- func GetOptionalPassphrase() (string, error)
- func GetPassphrase() (string, error)
- func GetPassphrases() []string
- func GetStorePassphrase(store string) string
- func GetWalletPassphrase() string
- func InitLogging() error
- func LockAccount(ctx context.Context, account e2wtypes.Account) error
- func Network(ctx context.Context, eth2Client eth2client.Service) (string, error)
- func ParseAccount(ctx context.Context, accountStr string, supplementary []string, unlock bool) (e2wtypes.Account, error)
- func ParseEpoch(ctx context.Context, chainTime chaintime.Service, epochStr string) (phase0.Epoch, error)
- func ParseValidator(ctx context.Context, validatorsProvider eth2client.ValidatorsProvider, ...) (*apiv1.Validator, error)
- func ParseValidators(ctx context.Context, validatorsProvider eth2client.ValidatorsProvider, ...) ([]*apiv1.Validator, error)
- func SeedFromMnemonic(mnemonic string) ([]byte, error)
- func SetupStore() error
- func SignRoot(account e2wtypes.Account, root spec.Root, domain spec.Domain) (e2types.Signature, error)
- func UnlockAccount(ctx context.Context, account e2wtypes.Account, passphrases []string) (bool, error)
- func ValidatorIndex(ctx context.Context, client consensusclient.Service, account string, ...) (phase0.ValidatorIndex, error)
- func VerifyRoot(account e2wtypes.Account, root spec.Root, domain spec.Domain, ...) (bool, error)
- func WalletAndAccountFromInput(ctx context.Context) (e2wtypes.Wallet, e2wtypes.Account, error)
- func WalletAndAccountFromPath(ctx context.Context, path string) (e2wtypes.Wallet, e2wtypes.Account, error)
- func WalletAndAccountsFromPath(ctx context.Context, path string) (e2wtypes.Wallet, []e2wtypes.Account, error)
- func WalletFromInput(ctx context.Context) (e2wtypes.Wallet, error)
- func WalletFromPath(ctx context.Context, path string) (e2wtypes.Wallet, error)
- type BeaconBlockHeaderCache
- type DepositInfo
- type ScratchAccount
- func (a *ScratchAccount) ID() uuid.UUID
- func (a *ScratchAccount) IsUnlocked(ctx context.Context) (bool, error)
- func (a *ScratchAccount) Lock(ctx context.Context) error
- func (a *ScratchAccount) Name() string
- func (a *ScratchAccount) Path() string
- func (a *ScratchAccount) PrivateKey(ctx context.Context) (e2types.PrivateKey, error)
- func (a *ScratchAccount) PublicKey() e2types.PublicKey
- func (a *ScratchAccount) Sign(ctx context.Context, data []byte) (e2types.Signature, error)
- func (a *ScratchAccount) Unlock(ctx context.Context, passphrase []byte) error
- type ValidatorExitData
Constants ¶
This section is empty.
Variables ¶
var Log zerolog.Logger
Log is the ethdo global logger.
Functions ¶
func AcceptablePassphrase ¶ added in v1.7.0
AcceptablePassphrase returns true if the passphrase is acceptable.
func AttestationHeadCorrect ¶ added in v1.26.0
func AttestationHeadCorrect(ctx context.Context, headersCache *BeaconBlockHeaderCache, attestation *phase0.Attestation, ) ( bool, error, )
AttestationHeadCorrect returns true if the given attestation had the correct head.
func AttestationTargetCorrect ¶ added in v1.26.0
func AttestationTargetCorrect(ctx context.Context, headersCache *BeaconBlockHeaderCache, chainTime chaintime.Service, attestation *phase0.Attestation, ) ( bool, error, )
AttestationTargetCorrect returns true if the given attestation had the correct target.
func BestPublicKey ¶ added in v1.7.3
BestPublicKey returns the best public key for operations. It prefers the composite public key if present, otherwise the public key.
func ConnectToBeaconNode ¶ added in v1.7.0
func ConnectToBeaconNode(ctx context.Context, address string, timeout time.Duration, allowInsecure bool) (eth2client.Service, error)
ConnectToBeaconNode connects to a beacon node at the given address.
func GetBaseDir ¶ added in v1.7.0
func GetBaseDir() string
GetBaseDir fetches the base directory for wallets.
func GetOptionalPassphrase ¶ added in v1.7.0
GetOptionalPassphrase fetches the passphrase if supplied by the user.
func GetPassphrase ¶ added in v1.7.0
GetPassphrase fetches the passphrase supplied by the user.
func GetPassphrases ¶ added in v1.7.0
func GetPassphrases() []string
GetPassphrases fetches the passphrases supplied by the user.
func GetStorePassphrase ¶ added in v1.7.0
GetStorePassphrase fetches the store passphrase supplied by the user.
func GetWalletPassphrase ¶ added in v1.7.0
func GetWalletPassphrase() string
GetWalletPassphrase fetches the wallet passphrase supplied by the user.
func LockAccount ¶ added in v1.7.0
LockAccount attempts to lock an account.
func Network ¶ added in v1.7.0
Network returns the name of the network., calculated from the deposit contract information. If not known, returns "Unknown".
func ParseAccount ¶ added in v1.26.0
func ParseAccount(ctx context.Context, accountStr string, supplementary []string, unlock bool, ) ( e2wtypes.Account, error, )
ParseAccount parses input to obtain an account.
func ParseEpoch ¶ added in v1.19.0
func ParseEpoch(ctx context.Context, chainTime chaintime.Service, epochStr string) (phase0.Epoch, error)
ParseEpoch parses input to calculate the desired epoch.
func ParseValidator ¶ added in v1.26.0
func ParseValidator(ctx context.Context, validatorsProvider eth2client.ValidatorsProvider, validatorStr string, stateID string, ) ( *apiv1.Validator, error, )
ParseValidator parses input to obtain the validator.
func ParseValidators ¶ added in v1.26.0
func ParseValidators(ctx context.Context, validatorsProvider eth2client.ValidatorsProvider, validatorsStr []string, stateID string) ([]*apiv1.Validator, error)
ParseValidators parses input to obtain the list of validators.
func SeedFromMnemonic ¶ added in v1.26.0
SeedFromMnemonic creates a seed from a mnemonic.
func SignRoot ¶ added in v1.7.3
func SignRoot(account e2wtypes.Account, root spec.Root, domain spec.Domain) (e2types.Signature, error)
SignRoot signs the hash tree root of a data structure.
func UnlockAccount ¶ added in v1.7.0
func UnlockAccount(ctx context.Context, account e2wtypes.Account, passphrases []string) (bool, error)
UnlockAccount attempts to unlock an account. It returns true if the account was already unlocked.
func ValidatorIndex ¶ added in v1.17.0
func ValidatorIndex(ctx context.Context, client consensusclient.Service, account string, pubKey string, index string) (phase0.ValidatorIndex, error)
ValidatorIndex obtains the index of a validator.
func VerifyRoot ¶ added in v1.7.3
func VerifyRoot(account e2wtypes.Account, root spec.Root, domain spec.Domain, signature e2types.Signature) (bool, error)
VerifyRoot verifies the hash tree root of a data structure.
func WalletAndAccountFromInput ¶ added in v1.7.3
WalletAndAccountFromInput obtains the wallet and account given the information in the viper variable "account".
func WalletAndAccountFromPath ¶ added in v1.7.3
func WalletAndAccountFromPath(ctx context.Context, path string) (e2wtypes.Wallet, e2wtypes.Account, error)
WalletAndAccountFromPath obtains the wallet and account given a path specification.
func WalletAndAccountsFromPath ¶ added in v1.7.3
func WalletAndAccountsFromPath(ctx context.Context, path string) (e2wtypes.Wallet, []e2wtypes.Account, error)
WalletAndAccountsFromPath obtains the wallet and matching accounts given a path specification.
func WalletFromInput ¶ added in v1.7.3
WalletFromInput obtains a wallet given the information in the viper variable "account", or if not present the viper variable "wallet".
Types ¶
type BeaconBlockHeaderCache ¶ added in v1.26.0
type BeaconBlockHeaderCache struct {
// contains filtered or unexported fields
}
BeaconBlockHeaderCache is a cache of beacon block headers.
func NewBeaconBlockHeaderCache ¶ added in v1.26.0
func NewBeaconBlockHeaderCache(provider eth2client.BeaconBlockHeadersProvider) *BeaconBlockHeaderCache
NewBeaconBlockHeaderCache makes a new beacon block header cache.
func (*BeaconBlockHeaderCache) Fetch ¶ added in v1.26.0
func (b *BeaconBlockHeaderCache) Fetch(ctx context.Context, slot phase0.Slot, ) ( *apiv1.BeaconBlockHeader, error, )
Fetch the beacon block header for the given slot.
type DepositInfo ¶ added in v1.5.8
type DepositInfo struct { Name string Account string PublicKey []byte WithdrawalCredentials []byte Signature []byte DepositDataRoot []byte DepositMessageRoot []byte ForkVersion []byte Amount uint64 Version uint64 }
DepositInfo is a generic deposit structure.
func DepositInfoFromJSON ¶ added in v1.5.8
func DepositInfoFromJSON(input []byte) ([]*DepositInfo, error)
DepositInfoFromJSON obtains deposit info from various possibly formx of JSON.
type ScratchAccount ¶
type ScratchAccount struct {
// contains filtered or unexported fields
}
ScratchAccount is an account that exists temporarily.
func NewScratchAccount ¶
func NewScratchAccount(privKey []byte, pubKey []byte) (*ScratchAccount, error)
NewScratchAccount creates a new local account.
func (*ScratchAccount) IsUnlocked ¶
func (a *ScratchAccount) IsUnlocked(ctx context.Context) (bool, error)
IsUnlocked returns true if the account is unlocked.
func (*ScratchAccount) Lock ¶
func (a *ScratchAccount) Lock(ctx context.Context) error
Lock locks the account.
func (*ScratchAccount) PrivateKey ¶ added in v1.26.0
func (a *ScratchAccount) PrivateKey(ctx context.Context) (e2types.PrivateKey, error)
PrivateKey returns the account private key.
func (*ScratchAccount) PublicKey ¶
func (a *ScratchAccount) PublicKey() e2types.PublicKey
PublicKey returns the account public key.
type ValidatorExitData ¶ added in v1.7.0
type ValidatorExitData struct { Exit *spec.SignedVoluntaryExit ForkVersion spec.Version }
ValidatorExitData contains data for a validator exit.
func (*ValidatorExitData) MarshalJSON ¶ added in v1.7.0
func (d *ValidatorExitData) MarshalJSON() ([]byte, error)
MarshalJSON implements custom JSON marshaller.
func (*ValidatorExitData) UnmarshalJSON ¶ added in v1.7.0
func (d *ValidatorExitData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom JSON unmarshaller.