staking

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepositDomain added in v0.2.4

func DepositDomain(version beaconcommon.Version) beaconcommon.BLSDomain

Return the bls domain for deposit

func GenerateRandomMnemonics

func GenerateRandomMnemonics() (string, error)

func Seed

func Seed(mnemonic, mnemonicPassphrase string) ([]byte, error)

func ValidateDepositData added in v0.2.8

func ValidateDepositData(
	expectedCreds beaconcommon.Root,
	expectedVersion beaconcommon.Version,
	expectedAmount beaconcommon.Gwei,
	datas ...*DepositData,
) error

Types

type DepositData

type DepositData struct {
	beaconcommon.DepositData

	Version beaconcommon.Version
}

func (*DepositData) MarshalJSON

func (data *DepositData) MarshalJSON() ([]byte, error)

func (*DepositData) Network added in v0.2.5

func (data *DepositData) Network() string

func (*DepositData) Sign added in v0.2.4

func (data *DepositData) Sign(
	vkey *ValidatorKey,
) (*DepositData, error)

func (*DepositData) SigningRoot added in v0.2.4

func (data *DepositData) SigningRoot() beaconcommon.Root

Compute DepositMessage root to be signed

func (*DepositData) UnmarshalJSON added in v0.2.4

func (data *DepositData) UnmarshalJSON(b []byte) error

func (*DepositData) VerifySignature added in v0.2.4

func (data *DepositData) VerifySignature() (bool, error)

type KeystoreManager

type KeystoreManager struct {
	// contains filtered or unexported fields
}

func NewKeystoreManager

func NewKeystoreManager() *KeystoreManager

func (*KeystoreManager) DecryptFromKeystore

func (mngr *KeystoreManager) DecryptFromKeystore(ks map[string]interface{}, pwd string) (*ValidatorKey, error)

func (*KeystoreManager) EncryptToPbkdf2Keystore

func (mngr *KeystoreManager) EncryptToPbkdf2Keystore(vKey *ValidatorKey, pwd string) (map[string]interface{}, error)

func (*KeystoreManager) EncryptToPrysmKeystore

func (mngr *KeystoreManager) EncryptToPrysmKeystore(vkeys []*ValidatorKey, pwd string) (map[string]interface{}, error)

func (*KeystoreManager) EncryptToScryptKeystore

func (mngr *KeystoreManager) EncryptToScryptKeystore(vKey *ValidatorKey, pwd string) (map[string]interface{}, error)

func (*KeystoreManager) GenerateValidatorKeys

func (mngr *KeystoreManager) GenerateValidatorKeys(mnemonic string, count int, storeMnemo bool, cb func(string) error) (keys []*ValidatorKey, err error)

type ValidatorKey

type ValidatorKey struct {
	UUID string

	PrivKey *e2types.BLSPrivateKey

	Pubkey             string
	MnemonicPassphrase string
	MnemonicPassword   string
	Path               string

	Desc string
}

func GenerateValidatorKey

func GenerateValidatorKey(seed []byte, path, desc string) (*ValidatorKey, error)

func GenerateValidatorKeys

func GenerateValidatorKeys(mnemonicPassphrase, mnemonicPassword string, count int, storeMnemo bool, cb func(string) error) (keys []*ValidatorKey, err error)

func ValidatorKeyFromBytes

func ValidatorKeyFromBytes(privkey []byte) (*ValidatorKey, error)

func ValidatorKeyFromString

func ValidatorKeyFromString(privkey string) (*ValidatorKey, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL