Documentation ¶
Index ¶
- Constants
- Variables
- func ABIOpenFile(ctx context.Context, abiFile string) (*abi.ABI, error)
- func DecryptKeystoreCipher(ctx context.Context, keystoreJSON map[string]interface{}, password string) ([]byte, error)
- func DecryptKeystoreCipherIntoEthSignerBLS(ctx context.Context, keystoreJSON map[string]interface{}, password string) (bls_signer.EthBLSAccount, error)
- func ForceDirToEthSigningDirLocation() string
- func GetCurrentForkVersion(ctx context.Context, beacon string) (*spec.Version, error)
- func GetEphemeralForkVersion(ctx context.Context) (*spec.Version, error)
- func GetForkVersion(ctx context.Context, beacon string) (*spec.Version, error)
- func GetValidatorDepositPayload(ctx context.Context, depositParams *DepositDataParams) (web3_actions.SendContractTxPayload, error)
- func GetValidatorDepositPayloadV2(ctx context.Context, depositParams ExtendedDepositParams) (web3_actions.SendContractTxPayload, error)
- func GetValidatorIndexFromPubkey(ctx context.Context, beacon, pubkey string) (string, error)
- func MultiplyEtherUnit(mul int64, unit *big.Int) *big.Int
- func PrintJSONSlice(p filepaths.Path, dpParamSlice []*DepositDataParams, network string)
- func ReadAbi(ctx context.Context, reader io.Reader) (*abi.ABI, error)
- func SubmitVoluntaryExit(ctx context.Context, beacon string, ve *spec.SignedVoluntaryExit) error
- func ValidateAndReturnBLSPubkeyBytes(blsPubKey string) ([]byte, error)
- func ValidateAndReturnEcdsaPubkeyBytes(ecdsaWithdrawalKey string) ([]byte, error)
- type DepositDataJSON
- type DepositDataParams
- type ExtendedDepositParams
- type ForkData
- type GenesisData
- type ValidatorDepositGenerationParams
- func (vd *ValidatorDepositGenerationParams) DerivedKey(ctx context.Context, path string) (*types.BLSPrivateKey, error)
- func (vd *ValidatorDepositGenerationParams) EthDepositEncryptionAndAddMetadata(ctx context.Context, path string) (map[string]interface{}, error)
- func (vd *ValidatorDepositGenerationParams) GenerateAgeEncryptedValidatorKeysInMemZipFile(ctx context.Context, inMemFs memfs.MemFS, age age_encryption.Age) (*bytes.Buffer, error)
- func (vd *ValidatorDepositGenerationParams) GenerateAndEncryptValidatorKeysFromSeedAndPath(ctx context.Context) error
- func (vd *ValidatorDepositGenerationParams) GenerateDerivedKeySigner(ctx context.Context, offset int) (bls_signer.EthBLSAccount, error)
- func (vd *ValidatorDepositGenerationParams) GenerateDerivedWithdrawalKeys(ctx context.Context) ([]string, error)
- func (vd *ValidatorDepositGenerationParams) GeneratePaddedBytesDefaultDerivedBLSWithdrawalKey(ctx context.Context) ([]byte, error)
- type ValidatorDepositParams
- type ValidatorDepositSlice
- type ValidatorInfo
- type VoluntaryExitMessage
- type Web3SignerClient
- func (w *Web3SignerClient) GenerateDepositData(ctx context.Context, blsSigner bls_signer.EthBLSAccount, ...) (*DepositDataParams, error)
- func (w *Web3SignerClient) GenerateDepositDataWithDefaultWd(ctx context.Context, vdg ValidatorDepositGenerationParams, fv *spec.Version) ([]*DepositDataParams, error)
- func (w *Web3SignerClient) GenerateDepositDataWithForWdAddr(ctx context.Context, vdg ValidatorDepositGenerationParams, wd []byte, ...) ([]*DepositDataParams, error)
- func (w *Web3SignerClient) GenerateEphemeryDepositDataWithDefaultWd(ctx context.Context, vdg ValidatorDepositGenerationParams) ([]*DepositDataParams, error)
- func (w *Web3SignerClient) GenerateVoluntaryExit(ctx context.Context, blsSigner bls_signer.EthBLSAccount, ...) (*spec.SignedVoluntaryExit, error)
- func (w *Web3SignerClient) SignValidatorDepositTxToBroadcast(ctx context.Context, depositParams *DepositDataParams) (*types.Transaction, error)
- func (w *Web3SignerClient) SignValidatorDepositTxToBroadcastFromJSON(ctx context.Context, depositParams ExtendedDepositParams) (*types.Transaction, error)
Constants ¶
View Source
const ( EphemeralDepositContractAddr = "0x4242424242424242424242424242424242424242" MainnetDepositContractAddr = "0x00000000219ab540356cBB839Cbe05303d7705Fa" GoerliDepositContractAddr = "0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b" EphemeralBeacon = "https://eth.ephemeral.zeus.fyi" BeaconGenesisPath = "/eth/v1/beacon/genesis" BeaconForkPath = "/eth/v1/beacon/states/head/fork" BeaconVoluntaryExitPath = "/eth/v1/beacon/pool/voluntary_exits" )
Variables ¶
View Source
var ( Gwei = big.NewInt(1e9) Szabo = big.NewInt(1e12) Finney = big.NewInt(1e15) Ether = big.NewInt(1e18) OneHundred = big.NewInt(100) ThirtyTwo = big.NewInt(32) ValidatorDeposit32Eth = big.NewInt(1).Mul(Ether, ThirtyTwo) ValidatorDeposit32EthInGweiUnits = big.NewInt(1).Mul(Gwei, ThirtyTwo) )
Functions ¶
func DecryptKeystoreCipher ¶
func DecryptKeystoreCipherIntoEthSignerBLS ¶
func DecryptKeystoreCipherIntoEthSignerBLS(ctx context.Context, keystoreJSON map[string]interface{}, password string) (bls_signer.EthBLSAccount, error)
func ForceDirToEthSigningDirLocation ¶
func ForceDirToEthSigningDirLocation() string
func GetCurrentForkVersion ¶ added in v0.4.0
func GetEphemeralForkVersion ¶
func GetForkVersion ¶
func GetValidatorDepositPayload ¶ added in v0.2.2
func GetValidatorDepositPayload(ctx context.Context, depositParams *DepositDataParams) (web3_actions.SendContractTxPayload, error)
func GetValidatorDepositPayloadV2 ¶ added in v0.2.2
func GetValidatorDepositPayloadV2(ctx context.Context, depositParams ExtendedDepositParams) (web3_actions.SendContractTxPayload, error)
func GetValidatorIndexFromPubkey ¶ added in v0.4.0
func PrintJSONSlice ¶
func PrintJSONSlice(p filepaths.Path, dpParamSlice []*DepositDataParams, network string)
func SubmitVoluntaryExit ¶ added in v0.4.0
func ValidateAndReturnBLSPubkeyBytes ¶
ValidateAndReturnBLSPubkeyBytes is borrowed from https://github.com/wealdtech/ethdo
func ValidateAndReturnEcdsaPubkeyBytes ¶
ValidateAndReturnEcdsaPubkeyBytes is borrowed from https://github.com/wealdtech/ethdo
Types ¶
type DepositDataJSON ¶
type DepositDataJSON struct { Pubkey string `json:"pubkey"` WithdrawalCredentials string `json:"withdrawal_credentials"` Signature string `json:"signature"` Amount int `json:"amount"` DepositDataRoot string `json:"deposit_data_root"` DepositMessageRoot string `json:"deposit_message_root"` ForkVersion string `json:"fork_version"` }
func DepositDataParamsJSON ¶ added in v0.3.2
func DepositDataParamsJSON(dpParamSlice []*DepositDataParams) []DepositDataJSON
type DepositDataParams ¶
type DepositDataParams struct { *spec.DepositData `json:"deposit_data"` DepositDataRoot [32]byte `json:"deposit_data_root"` DepositMessageRoot [32]byte `json:"deposit_message_root"` ForkVersion *spec.Version `json:"fork_version"` }
func (*DepositDataParams) FormatJSON ¶
func (dd *DepositDataParams) FormatJSON() DepositDataJSON
func (*DepositDataParams) GetValidatorDepositParamsStringValues ¶
func (dd *DepositDataParams) GetValidatorDepositParamsStringValues() ValidatorDepositParams
type ExtendedDepositParams ¶
type GenesisData ¶
type ValidatorDepositGenerationParams ¶
type ValidatorDepositGenerationParams struct { Fp filepaths.Path Mnemonic string `json:"mnemonic"` Pw string `json:"hdWalletPassword"` ValidatorIndexOffset int `json:"hdOffset"` NumValidators int `json:"validatorCount"` // used for looping derivations WithdrawalKeyIndexOffset int `json:"WdHdOffset"` NumWithdrawalKeys int `json:"numWdKeys"` // used for network selection variables Network string `json:"network"` }
func (*ValidatorDepositGenerationParams) DerivedKey ¶
func (vd *ValidatorDepositGenerationParams) DerivedKey(ctx context.Context, path string) (*types.BLSPrivateKey, error)
func (*ValidatorDepositGenerationParams) EthDepositEncryptionAndAddMetadata ¶
func (*ValidatorDepositGenerationParams) GenerateAgeEncryptedValidatorKeysInMemZipFile ¶ added in v0.3.2
func (vd *ValidatorDepositGenerationParams) GenerateAgeEncryptedValidatorKeysInMemZipFile(ctx context.Context, inMemFs memfs.MemFS, age age_encryption.Age) (*bytes.Buffer, error)
GenerateAgeEncryptedValidatorKeysInMemZipFile generates a zip file of validator keys encrypted with age, the unzipped contents are keystores/keystores.tar.gz.age
func (*ValidatorDepositGenerationParams) GenerateAndEncryptValidatorKeysFromSeedAndPath ¶
func (vd *ValidatorDepositGenerationParams) GenerateAndEncryptValidatorKeysFromSeedAndPath(ctx context.Context) error
func (*ValidatorDepositGenerationParams) GenerateDerivedKeySigner ¶ added in v0.4.0
func (vd *ValidatorDepositGenerationParams) GenerateDerivedKeySigner(ctx context.Context, offset int) (bls_signer.EthBLSAccount, error)
func (*ValidatorDepositGenerationParams) GenerateDerivedWithdrawalKeys ¶
func (vd *ValidatorDepositGenerationParams) GenerateDerivedWithdrawalKeys(ctx context.Context) ([]string, error)
func (*ValidatorDepositGenerationParams) GeneratePaddedBytesDefaultDerivedBLSWithdrawalKey ¶
func (vd *ValidatorDepositGenerationParams) GeneratePaddedBytesDefaultDerivedBLSWithdrawalKey(ctx context.Context) ([]byte, error)
type ValidatorDepositParams ¶
type ValidatorDepositSlice ¶
type ValidatorDepositSlice []ExtendedDepositParams
type ValidatorInfo ¶ added in v0.4.0
type ValidatorInfo struct { ExecutionOptimistic bool `json:"execution_optimistic"` Finalized bool `json:"finalized"` Data struct { Index string `json:"index"` Balance string `json:"balance"` Status string `json:"status"` Validator struct { Pubkey string `json:"pubkey"` WithdrawalCredentials string `json:"withdrawal_credentials"` EffectiveBalance string `json:"effective_balance"` Slashed bool `json:"slashed"` ActivationEligibilityEpoch string `json:"activation_eligibility_epoch"` ActivationEpoch string `json:"activation_epoch"` ExitEpoch string `json:"exit_epoch"` WithdrawableEpoch string `json:"withdrawable_epoch"` } `json:"validator"` } `json:"data"` }
type VoluntaryExitMessage ¶ added in v0.4.0
type Web3SignerClient ¶
type Web3SignerClient struct {
web3_actions.Web3Actions
}
func NewWeb3Client ¶
func NewWeb3Client(nodeUrl string, acc *accounts.Account) Web3SignerClient
func (*Web3SignerClient) GenerateDepositData ¶
func (w *Web3SignerClient) GenerateDepositData(ctx context.Context, blsSigner bls_signer.EthBLSAccount, withdrawalAddress []byte, forkVersion *spec.Version) (*DepositDataParams, error)
func (*Web3SignerClient) GenerateDepositDataWithDefaultWd ¶
func (w *Web3SignerClient) GenerateDepositDataWithDefaultWd(ctx context.Context, vdg ValidatorDepositGenerationParams, fv *spec.Version) ([]*DepositDataParams, error)
func (*Web3SignerClient) GenerateDepositDataWithForWdAddr ¶ added in v0.3.2
func (w *Web3SignerClient) GenerateDepositDataWithForWdAddr(ctx context.Context, vdg ValidatorDepositGenerationParams, wd []byte, fv *spec.Version) ([]*DepositDataParams, error)
func (*Web3SignerClient) GenerateEphemeryDepositDataWithDefaultWd ¶
func (w *Web3SignerClient) GenerateEphemeryDepositDataWithDefaultWd(ctx context.Context, vdg ValidatorDepositGenerationParams) ([]*DepositDataParams, error)
func (*Web3SignerClient) GenerateVoluntaryExit ¶ added in v0.4.0
func (w *Web3SignerClient) GenerateVoluntaryExit(ctx context.Context, blsSigner bls_signer.EthBLSAccount, forkVersion *spec.Version, genesisForkVersion [32]byte, validatorIndex string) (*spec.SignedVoluntaryExit, error)
GenerateVoluntaryExit TODO generateVoluntaryExit needs current fork version
func (*Web3SignerClient) SignValidatorDepositTxToBroadcast ¶
func (w *Web3SignerClient) SignValidatorDepositTxToBroadcast(ctx context.Context, depositParams *DepositDataParams) (*types.Transaction, error)
func (*Web3SignerClient) SignValidatorDepositTxToBroadcastFromJSON ¶ added in v0.2.2
func (w *Web3SignerClient) SignValidatorDepositTxToBroadcastFromJSON(ctx context.Context, depositParams ExtendedDepositParams) (*types.Transaction, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.