# Creating deposits on devnets
Warning: Please do not try this with real ether, these instructions are purely meant for the merge devnets.
This guide assumes you are using metamask to interact with the faucet and store the funds, Advanced users can bypass this step. There are other methods to perform deposits, this guide merely describes one such method.
## Pre-requities:
- `eth2-val-tools`: https://github.com/protolambda/eth2-val-tools
- `ethereal`: https://github.com/wealdtech/ethereal
- Metamask connected to the correct network
- `jq` for pretty printing output
## Instructions:
1. Obtain some testnet ether by visiting the faucet [here](https://faucet.devnet3.themerge.dev/)
2. Create a new file called `secrets.env`. This file will contain our private key, so make sure you don't commit it anywhere.
3. Fill `secrets.env` with the follwing variable names:
```bash
# sets the deposit amount to use
DEPOSIT_AMOUNT=32000000000
# sets the genesis fork version of the testnet
FORK_VERSION="0x50000069"
# sets the mnemonic to derive the keys from
VALIDATORS_MNEMONIC=""
# sets the mnemonic for withdrawal credentials
WITHDRAWALS_MNEMONIC=""
# temporary location to store the deposit data
DEPOSIT_DATAS_FILE_LOCATION="/tmp/deposit_data.txt"
# sets the deposit contract address
DEPOSIT_CONTRACT_ADDRESS="0x4242424242424242424242424242424242424242"
# sets the eth1 address from which the transaction will be made
ETH1_FROM_ADDR=""
# sets the eth1 private key used to sign the transaction
ETH1_FROM_PRIV=""
# forces the deposit since the deposit contract will not be recognized by the tool
FORCE_DEPOSIT=true
# sets an RPC endpoint to submit the transaction to
ETH1_RPC=https://rpc.merge-devnet-3.wenmerge.dev
```
4. Our Mnemonic is the source of the private keys of the validators. Loosing this mnemonic means the loss of all funds, so please store the mnemonic safely. We can generate the validator and withdrawal mnemonic using the tool eth2-val-tools. In your terminal, type out:
```bash
eth2-val-tools mnemonic
```
The output should contain a list of 24 words. Copy those words into the secrets.env file under the variable VALIDATORS_MNEMONIC. Don't forget to wrap the 24 words inside ""!
Repeat the process for WITHDRAWALS_MNEMONIC.
5. Now we can finally add our private key and address from which the deposits will be made. This will be in metamask, go to the account with the testnet ether > click on the three dots > click on Account details > click on export private key. We will need the private key in the script to access the funds and perform the deposits, so save this somewhere safely. Fill out ETH1_FROM_ADDR and ETH1_FROM_PRIV in secrets.env accordingly. Don't forget to wrap both inside "" and they should start with 0x.
6. Sanity check all the values in `secrets.env` again!
7. Create a new file called `devnet_deposits.sh` with the following content:
```bash
#!/bin/bash
echo "USE AT YOUR OWN RISK"
read -p "Are you sure you've double checked the values and want to make this deposit? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
source secrets.env
if [[ -z "${ETH1_FROM_ADDR}" ]]; then
echo "need ETH1_FROM_ADDR environment var"
exit 1 || return 1
fi
if [[ -z "${ETH1_FROM_PRIV}" ]]; then
echo "need ETH1_FROM_PRIV environment var"
exit 1 || return 1
fi
eth2-val-tools deposit-data \
--source-min=0 \
--source-max=1 \
--amount=$DEPOSIT_AMOUNT \
--fork-version=$FORK_VERSION \
--withdrawals-mnemonic="$WITHDRAWALS_MNEMONIC" \
--validators-mnemonic="$VALIDATORS_MNEMONIC" > $DEPOSIT_DATAS_FILE_LOCATION.txt
# Iterate through lines, each is a json of the deposit data and some metadata
while read x; do
account_name="$(echo "$x" | jq '.account')"
pubkey="$(echo "$x" | jq '.pubkey')"
echo "Sending deposit for validator $account_name $pubkey"
ethereal beacon deposit \
--allow-unknown-contract=$FORCE_DEPOSIT \
--address="$DEPOSIT_CONTRACT_ADDRESS" \
--connection=$ETH1_RPC \
--data="$x" \
--value="$DEPOSIT_ACTUAL_VALUE" \
--from="$ETH1_FROM_ADDR" \
--privatekey="$ETH1_FROM_PRIV"
echo "Sent deposit for validator $account_name $pubkey"
sleep 3
done < "$DEPOSIT_DATAS_FILE_LOCATION.txt"
```
8. Make the script executable by running the following:
```bash
chmod +x ./devnet_deposits.sh
```
9. Please double check all the values in `secrets.env` and then finally run the script with:
```bash
./devnet_deposit.sh
```
10. The terminal output will indicate a transaction hash, check the transaction explorer to check the status. Once the transaction is included, you would still need to wait `64` epochs before the validator is included on the beaconchain.
Now that the deposit has been made, please generate your validator keys using your validator mnemonic specified in `secrets.env` and then start your validator to be a part of the network.