Skip to content

Instantly share code, notes, and snippets.

@gus4rs
Last active November 7, 2023 01:55
Show Gist options
  • Save gus4rs/18e00a1249778b8bbbb71c3efe586ff1 to your computer and use it in GitHub Desktop.
Save gus4rs/18e00a1249778b8bbbb71c3efe586ff1 to your computer and use it in GitHub Desktop.
Create a validator on Holesky without the Launchpad

⚠️ Do not do this for mainnet, this is a quick and insecure procedure that it's fine for Testnet only

  1. Download and install https://github.com/wealdtech/ethdo and https://github.com/ethereum/staking-deposit-cli
  2. Connect your Metamask to Holesky and generate a new address
  3. Use the address to get some 33 HolETH from https://holesky-faucet.pk910.de/
  4. Generate a new keystore for your validator using the staking-deposit-cli tool. Replace 0xADDR by your metamask address
./deposit.sh new-mnemonic --chain holesky --execution_address 0xADDR --num_validators 1

You will need to enter a password and you will get a mnemonic phrase. They will be referred as PASSWD and MNEM from now on

  1. Import the wallet in ethdo:
ethdo wallet create --type hd --mnemonic "MNEM" --wallet-passphrase "PASSWD" --wallet wallet
  1. Create the validator account in ethdo
ethdo account create --account wallet/validating-0 --path m/12381/3600/0/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
  1. Create the deposit data:
ethdo validator depositdata --validatoraccount wallet/validating-0 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw
  1. Execute the transaction in Metamask

Check "Show hex data" in Settings -> Advanced

Create a new Send transaction in Metamask:

  • Destination: 0x4242424242424242424242424242424242424242 which is the Holesky deposit contract
  • Amount: 32 ETH
  • Hex Data: 0x... (extract it from output of step 7. Only copy the number starting with 0x)
  1. Import the validators into Nimbus
cd /path/to/staking-deposit-cli
/path/to/nimbus-beacon deposits import --data-dir=/path/to/nimbus/data/
  1. Wait for 1 epoch (6 minutes) and check your validator at https://holesky.beaconcha.in/validator/PUBKEY

replace PUBKEY with the value obtained from:

ethdo account info --account wallet/validating-0
@JamesSmartCell
Copy link

Excellent guide!

If you want to set up multiple validators in this method, change the above steps as follows:

  1. Specify the number of validators (let's say 4):

./deposit.sh new-mnemonic --chain holesky --execution_address 0xADDR --num_validators 4

  1. Create the validator accounts for each validator (note we changed the wallet/validating-<x> and the hd path derivation m/12381/x/0/0)

ethdo account create --account wallet/validating-0 --path m/12381/3600/0/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
ethdo account create --account wallet/validating-1 --path m/12381/3600/1/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
ethdo account create --account wallet/validating-2 --path m/12381/3600/2/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
ethdo account create --account wallet/validating-3 --path m/12381/3600/3/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"

  1. Create the deposit data for each validator:

ethdo validator depositdata --validatoraccount wallet/validating-0 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw
ethdo validator depositdata --validatoraccount wallet/validating-1 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw
ethdo validator depositdata --validatoraccount wallet/validating-2 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw
ethdo validator depositdata --validatoraccount wallet/validating-3 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw

Execute the 4 transactions as per the guide.

For more than a few validators you would take the json file generated in step 4 and populate the transaction and send using web3j/ethers.js etc.

@JamesSmartCell
Copy link

If you want to add more validators after getting your node running:

In this example we're adding 20 more nodes:

  1. Create the new deposits:
    ./deposit.sh existing-mnemonic --chain holesky --execution_address 0xADDR --num_validators 20

The deposit program will guide you through adding these new validator deposits. First you will need to type which derivation number you want the new validators to start from. If you previously created 4, then you'd start from path 4 (as you previously created paths 0-3).

Then you will need to type in your seed phrase again. Then you'll also need your seed phrase password you specified previously.

Now the new deposit json will be created. You will need to import this into your validator client. EG for Lighthouse:

  1. Free the mutex lock on the validator database:
    sudo systemctl stop validator

  2. Import into Lighthouse validator

sudo lighthouse account validator import \
  --network holesky \
  --datadir /var/lib/lighthouse \
  --directory=$HOME/staking-deposit-cli/validator_keys \
  --reuse-password
  1. Restart the validator. Quick before you miss your next attestation!
    sudo systemctl start validator

  2. Watch the validator startup:
    sudo journalctl -fu | ccze

you should see the new public keys getting imported, and now when the validator is running you should see that there are 24 validators, 4 active.

  1. Create the validator accounts:
    ethdo account create --account wallet/validating-4 --path m/12381/3600/4/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
    ethdo account create --account wallet/validating-5 --path m/12381/3600/5/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
    ethdo account create --account wallet/validating-6 --path m/12381/3600/6/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
    ethdo account create --account wallet/validating-7 --path m/12381/3600/7/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"
    ...
    ethdo account create --account wallet/validating-23 --path m/12381/3600/23/0/0 --wallet-passphrase "PASSWD" --passphrase "PASSWD"

  2. Create deposit for each validator:
    ethdo validator depositdata --validatoraccount wallet/validating-4 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw
    ethdo validator depositdata --validatoraccount wallet/validating-5 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw
    ...
    ethdo validator depositdata --validatoraccount wallet/validating-23 --depositvalue 32Ether --passphrase "PASSWD" --forkversion 0x01017000 --withdrawaladdress "0xADDR" --raw

Finally execute the transactions for each.

You would want to automate this process with a script. This guide is to illustrate 'how to'.

@yagolgmesol
Copy link

can i ask holesky for help around 9600 holesky for
test validator creation and funding using custom made smart contract?

@JamesSmartCell
Copy link

can i ask holesky for help around 9600 holesky for test validator creation and funding using custom made smart contract?

Did you have any success?

@yagolgmesol
Copy link

yagolgmesol commented Nov 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment