# Connect to the Kintsugi Testnet **Note:** We've updated this doc to have information for the kintsugi devnet as best we could, please let us know if you find any stale information. Please find the information about the latest branch/image to use here: https://notes.ethereum.org/@ExXcnR0-SJGthjz1dwkA1A/HkJ8Aolct ## Docker 1. Clone the repository: https://github.com/parithosh/consensus-deployment-ansible 2. Ensure `docker` and `docker-compose` is installed: `docker-compose --version` and `docker --version * If your version of docker does not work try with docker-compose 1.25.4 and docker 20.10.12. 3. Change directories with `cd consensus-deployment-ansible/scripts/quick-run/merge-devnets` 4. Create the required directories for persistent data with `mkdir -p execution_data beacon_data` 5. Find your IP address(public IP) and add it to the `<testnet-name>.vars`(e.g: `kintsugi.vars`) file file located in `consensus-deployment-ansible/scripts/quick-run/merge-devnets`, this is just to ensure easy peering 5.1 `curl ifconfig.me` or visit https://whatismyipaddress.com 5.2 Replace IP in the config file `kintsugi.vars` with your own IP address: https://i.imgur.com/xnNqN6h.png 6. Run your chosen execution engine, e.g: `docker-compose --env-file kintsugi.vars -f docker-compose.geth.yml up -d` 7. Check your logs to confirm execution engine(geth) is up * e.g. ` docker logs geth_init -f --tail=20` * e.g. ` docker logs geth -f --tail=20` * Troubleshooting if execution engine(geth) is not coming up and shows error like below. ``` Fatal: Failed to write genesis block: database contains incompatible genesis (have 97bd4312dfa0f247e7199b59f243673d45934f3071be44174e007d56d29ada2b, new a28d8d73e087a01d09d8cb806f60863652f30b6b6dfa4e0157501ff07d422399) Fatal: Failed to write genesis block: database contains incompatible genesis (have 97bd4312dfa0f247e7199b59f243673d45934f3071be44174e007d56d29ada2b, new a28d8d73e087a01d09d8cb806f60863652f30b6b6dfa4e0157501ff07d422399) ``` Solution : * Delete directory `beacon_data` and `execution_data` in path `consensus-deployment-ansible/scripts/quick-run/merge-devnets/` 8. Run your chosen consensus engine, e.g: `docker-compose --env-file kintsugi.vars -f docker-compose.lighthouse.yml up -d` 9. Check your logs to confirm that they are up and syncing, e.g `docker logs lighthouse_beacon -f --tail=20` 10. To stop the clients, run `docker-compose -f <insert file name you used earlier here> down` * e.g. `docker stop geth` * e.g. `docker stop lighthouse_beacon` ## Setting up Metamask You can find a "Add to metamask" button on https://kintsugi.themerge.dev. As an alternative, you can also do it manually: 1. Ensure your nodes are using the current devnet config and are syncing or already synced. 2. Open your Metamask Extension in your browser. 3. Click on the network switcher on the top. You will need to configure a custom network. Do NOT simply used "Localhost 8545" as you need to specify the chain ID. 4. Click on "Add Network" 5. In the next screen fill in the chainID 1337702 and address of your local RPC. Take care to refer to your rpc endpoint with correct protocol which is http not https! 6. Now you can select the new network and use Metamask like you are used to! To request funds go to the [faucet](https://faucet.kintsugi.themerge.dev) ## Linux ## Clone the testnet configuration ``` git clone https://github.com/eth-clients/merge-testnets.git cd merge-testnets/kintsugi ``` ## Build Geth Pre-requisites: `git`, `make`, `go`, `gcc`. (use geth branch `merge-kintsugi` from github.com/mariusvanderwijden/go-ethereum) ``` git clone -b merge-kintsugi https://github.com/MariusVanDerWijden/go-ethereum.git cd go-ethereum make geth cd .. ``` ## Build Nethermind Pre-requisites: `dotnet 6.0` `libsnappy-dev` `libc6-dev` `libc6` ``` git clone -b themerge_kintsugi https://github.com/NethermindEth/nethermind --recursive cd nethermind/src/Nethermind dotnet build Nethermind.sln -c Release ``` ## Build Besu Ensure Java 11 or above is installed (Ubuntu: `sudo apt install default-jre`). ``` git clone -b merge https://github.com/hyperledger/besu --recursive cd besu ./gradlew installDist distTar cd .. ``` The besu executable is now available in `./besu/build/install/besu/bin/besu` and a tar distribution is available in `./besu/build/distributions`. You can also build a docker image by using the `distDocker` gradle target or use the pre-built docker image `suburbandad/besu:kintsugi-v3`. ## Build Erigon ## Build EthereumJS ## Build Lighthouse (use branch `unstable`) ``` git clone -b unstable https://github.com/sigp/lighthouse.git cd lighthouse make cd .. ``` ## Build Lodestar ``` git clone https://github.com/chainsafe/lodestar.git cd lodestar yarn install --ignore-optional yarn run build cd .. ``` ## Build Nimbus ``` git clone -b kintsugi https://github.com/status-im/nimbus-eth2.git cd nimbus-eth2/ make nimbus_beacon_node cd .. ``` ## Build Teku Ensure Java 11 or above is installed (Ubuntu: `sudo apt install default-jre`). ``` git clone https://github.com/ConsenSys/teku.git cd teku ./gradlew installDist cd .. ``` The teku executable is now available in `./teku/build/install/teku/bin/teku`. You can also use the [pre-built distribution](https://artifacts.consensys.net/public/teku/raw/names/teku.tar.gz/versions/develop/teku-develop.tar.gz) or the `consensys/teku:develop` docker image. ## Build Prysm Ensure you have Bazel-4.2.1 installed in your system. You can simply download the binary from [github](https://github.com/bazelbuild/bazel/releases/tag/4.2.1). ``` git clone -b kintsugi https://github.com/prysmaticlabs/prysm.git cd prysm bazel build //beacon-chain:beacon-chain ``` If you plan to run a validator ``` bazel build //validator:validator ``` ## Connect Geth-LH In the `kintsugi` folder ``` ./go-ethereum/build/bin/geth init genesis.json --datadir "datadir-lh" ./go-ethereum/build/bin/geth --datadir "datadir-lh" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337702 --syncmode=full --catalyst console ``` in a second window (use lighthouse branch `unstable`) ``` lighthouse \ --spec mainnet \ --testnet-dir ./ \ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8545 \ --enr-udp-port=9001 \ --enr-tcp-port=9001 \ --discovery-port=9001 \ --boot-nodes="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Geth-Prysm In the `kintsugi` folder: ``` mkdir datadir-prysm ./go-ethereum/build/bin/geth --catalyst init genesis.json --datadir datadir-prysm ./go-ethereum/build/bin/geth --catalyst --datadir datadir-prysm --networkid=1337702 --http --http.api engine,net,eth --ws --ws.api net,eth,engine --bootnodes enode://57745805245c441b71a9f3b3e7d78f75dd576d36b236b9f64cf9a9cccdcb574ec1f64d69c05add598ef26e3d7f646534b4c9976ca53551f71ad579a472635086@165.232.185.207:30303 ``` In a different window in the `kintsugi` folder ``` cd prysm bazel run //beacon-chain -- --genesis-state $PWD/../genesis.ssz --datadir $PWD/../datadir-prysm --http-web3provider=http://localhost:8545 --min-sync-peers=1 --chain-config-file $PWD/../config.yaml --bootstrap-node "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" OR bazel run //beacon-chain -- --genesis-state $PWD/../genesis.ssz --datadir $PWD/../datadir-prysm --http-web3provider=http://localhost:8545 --kintsugi-testnet ``` If you plan to run a validator, in yet another window in the `kintsugi` folder ``` cd prysm bazel run //validator -- --chain-config-file $PWD/../config.yaml ``` ## Connect Geth-Teku In the `kintsugi` folder ``` ./go-ethereum/build/bin/geth init genesis.json --datadir "datadir-teku" ./go-ethereum/build/bin/geth --datadir "datadir-teku" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337702 --syncmode=full --catalyst console ``` in second window ``` ./teku/build/install/teku/bin/teku \ --data-path "datadir-teku" \ --network https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/config.yaml \ --initial-state https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/genesis.ssz \ --Xee-endpoint http://localhost:8545 \ --p2p-discovery-bootnodes "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --log-destination console ``` ## Connect Geth-Nimbus In the `kintsugi` folder ``` ./go-ethereum/build/bin/geth init genesis.json --datadir "datadir-nimbus" ./go-ethereum/build/bin/geth --datadir "datadir-nimbus" --ws --ws.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337702 --syncmode=full --catalyst console ``` in second window ``` nimbus-eth2/build/nimbus_beacon_node --network=. --web3-url=ws://127.0.0.1:8546 --log-level=DEBUG --bootstrap-file=bootstrap_nodes.txt --terminal-total-difficulty-override=5000000000 --data-dir=nimbus-beacondata --bootstrap-node=enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk ``` ## Connect Geth-Lodestar In the `kintsugi` folder ``` ./go-ethereum/build/bin/geth init genesis.json --datadir "datadir-lodestar" ./go-ethereum/build/bin/geth --datadir "datadir-lodestar" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337702 --syncmode=full --catalyst console ``` In a second window ``` cd lodestar ./lodestar beacon --rootDir="../lodestar-beacondata" --paramsFile="../config.yaml" --genesisStateFile="../genesis.ssz" --network.discv5.bootEnrs="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" --eth1.enabled=true --execution.urls="http://127.0.0.1:8545" --network.connectToDiscv5Bootnodes --network.discv5.enabled=true ```` ## Connect Nethermind-LH In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `kintsugi` folder (use lighthouse branch `kintsugi`) ``` lighthouse \ --spec mainnet \ --testnet-dir ./ \ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8550 \ --enr-udp-port=9001 \ --enr-tcp-port=9001 \ --discovery-port=9001 \ --boot-nodes="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Nethermind-Prysm In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `prysm` folder ``` bazel run //beacon-chain -- \ --interop-genesis-state merge-testnets/kintsugi/genesis.ssz \ --datadir $PWD/../datadir-prysm \ --http-web3provider=http://localhost:8550 \ --min-sync-peers=1 \ --chain-config-file merge-testnets/kintsugi/config.yaml \ --bootstrap-node "enr:-Ly4QGibo1DJfV1BkAf8AnN6matZIlxGrDjnyTpR0qojiGD8XxDysNCEk1NctXRv3e04sHBu-okKgJBZzYHwQDeWG2QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpDtvzqoQQAAcAQAAAAAAAAAgmlkgnY0gmlwhMBR0MqJc2VjcDI1NmsxoQI69Upbug4HrZ-WKvP3uqZfapzxM7WUG3_eB3F5zoP3B4hzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA" \ --merge-testnet --terminal-total-difficulty-override 5000000000 ``` ## Connect Nethermind-Teku In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window ``` teku/build/install/teku/bin/teku \ --data-path "datadir-teku" \ --network https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/config.yaml \ --initial-state https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/genesis.ssz \ --Xee-endpoint http://localhost:8550 \ --p2p-discovery-bootnodes "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Nethermind-Nimbus In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `kintsugi` folder ``` nimbus-eth2/build/nimbus_beacon_node \ --network=. \ --web3-url=ws://127.0.0.1:8551 \ --log-level=DEBUG \ --terminal-total-difficulty-override=5000000000 \ --data-dir=nimbus-beacondata \ --bootstrap-node=enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk ``` ## Connect Nethermind-Lodestar In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `lodestar` folder ``` ./lodestar beacon \ --rootDir="../lodestar-beacondata" \ --paramsFile="./config.yaml" \ --genesisStateFile="./genesis.ssz" \ --network.discv5.bootEnrs="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --eth1.enabled=true \ --execution.urls="http://127.0.0.1:8550" \ --network.connectToDiscv5Bootnodes \ --network.discv5.enabled=true ``` Make sure to copy `config.yml` and `genesis.ssz` from `merge-testnets/kintsugi` folder to `lodestar` folder ## Connect Besu-LH In the `kintsugi` folder ``` mkdir datadir-lh-besu && \ ./besu/build/install/besu/bin/besu \ --data-path "datadir-lh-besu" \ --genesis-file "besu_genesis.json" \ --rpc-http-api=ADMIN,MINER,ETH,NET,DEBUG,TXPOOL,EXECUTION \ --network-id=1337702 \ --p2p-enabled=true \ --Xmerge-support=true \ --bootnodes=enode://6f377dd1ef5a3272d7e02fac9064c4f95d74f7edfd866e59ded774ee5b4649ff61c3f24c95f5c3d07d692b447f0569716b8921b6861810b96a705c92e1d27ff9@161.35.67.219:30303 ``` in a second window (use lighthouse branch `unstable`) ``` lighthouse \ --spec mainnet \ --testnet-dir ./ \ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8545 \ --enr-udp-port=9001 \ --enr-tcp-port=9001 \ --discovery-port=9001 \ --boot-nodes="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Besu-Prysm In the `kintsugi` folder: ``` mkdir datadir-prysm-besu && \ ./besu/build/install/besu/bin/besu \ --data-path "datadir-prysm-besu" \ --genesis-file "besu_genesis.json" \ --rpc-http-api=ADMIN,MINER,ETH,NET,DEBUG,TXPOOL,EXECUTION \ --network-id=1337702 \ --p2p-enabled=true \ --Xmerge-support=true \ --bootnodes=enode://6f377dd1ef5a3272d7e02fac9064c4f95d74f7edfd866e59ded774ee5b4649ff61c3f24c95f5c3d07d692b447f0569716b8921b6861810b96a705c92e1d27ff9@161.35.67.219:30303 ``` In a different window in the `kintsugi` folder ``` cd prysm bazel run //beacon-chain -- --genesis-state $PWD/../genesis.ssz --datadir $PWD/../datadir-prysm --http-web3provider=http://localhost:8545 --min-sync-peers=1 --chain-config-file $PWD/../config.yaml --bootstrap-node "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" OR bazel run //beacon-chain -- --genesis-state $PWD/../genesis.ssz --datadir $PWD/../datadir-prysm --http-web3provider=http://localhost:8545 --kintsugi-testnet ``` If you plan to run a validator, in yet another window in the `kintsugi` folder ``` cd prysm bazel run //validator -- --chain-config-file $PWD/../config.yaml ``` ## Connect Besu-Teku In the `kintsugi` folder ``` mkdir datadir-teku-besu && \ ./besu/build/install/besu/bin/besu \ --data-path "datadir-teku-besu" \ --genesis-file "besu_genesis.json" \ --rpc-http-api=ADMIN,MINER,ETH,NET,DEBUG,TXPOOL,EXECUTION \ --network-id=1337702 \ --p2p-enabled=true \ --Xmerge-support=true \ --bootnodes=enode://6f377dd1ef5a3272d7e02fac9064c4f95d74f7edfd866e59ded774ee5b4649ff61c3f24c95f5c3d07d692b447f0569716b8921b6861810b96a705c92e1d27ff9@161.35.67.219:30303 ``` in second window ``` ./teku/build/install/teku/bin/teku \ --data-path "datadir-teku" \ --network https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/config.yaml \ --initial-state https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/genesis.ssz \ --Xee-endpoint http://localhost:8545 \ --p2p-discovery-bootnodes "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --log-destination console ``` ## Connect Besu-Nimbus In the `kintsugi` folder ``` mkdir datadir-nimbus-besu && \ ./besu/build/install/besu/bin/besu \ --data-path "datadir-nimbus-besu" \ --genesis-file "besu_genesis.json" \ --rpc-http-api=ADMIN,MINER,ETH,NET,DEBUG,TXPOOL,EXECUTION \ --rpc-ws-api=ADMIN,MINER,ETH,NET,DEBUG,TXPOOL,EXECUTION \ --network-id=1337702 \ --p2p-enabled=true \ --Xmerge-support=true \ --bootnodes=enode://6f377dd1ef5a3272d7e02fac9064c4f95d74f7edfd866e59ded774ee5b4649ff61c3f24c95f5c3d07d692b447f0569716b8921b6861810b96a705c92e1d27ff9@161.35.67.219:30303 ``` in second window ``` nimbus-eth2/build/nimbus_beacon_node --network=. --web3-url=ws://127.0.0.1:8546 --log-level=DEBUG --bootstrap-file=bootstrap_nodes.txt --terminal-total-difficulty-override=5000000000 --data-dir=nimbus-beacondata --bootstrap-node=enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk ``` ## Connect Besu-Lodestar In the `kintsugi` folder ``` mkdir datadir-lodestar-besu && \ ./besu/build/install/besu/bin/besu \ --data-path "datadir-ldoestar-besu" \ --genesis-file "besu_genesis.json" \ --rpc-http-api=ADMIN,MINER,ETH,NET,DEBUG,TXPOOL,EXECUTION \ --network-id=1337702 \ --p2p-enabled=true \ --Xmerge-support=true \ --bootnodes=enode://6f377dd1ef5a3272d7e02fac9064c4f95d74f7edfd866e59ded774ee5b4649ff61c3f24c95f5c3d07d692b447f0569716b8921b6861810b96a705c92e1d27ff9@161.35.67.219:30303 ``` In a second window ``` cd lodestar ./lodestar beacon --rootDir="../lodestar-beacondata" --paramsFile="../config.yaml" --genesisStateFile="../genesis.ssz" --network.discv5.bootEnrs="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" --eth1.enabled=true --execution.urls="http://127.0.0.1:8545" --network.connectToDiscv5Bootnodes --network.discv5.enabled=true ```` # Windows ## Build Nethermind ``` git clone -b themerge_kintsugi https://github.com/NethermindEth/nethermind --recursive cd nethermind/src/Nethermind dotnet build Nethermind.sln -c Release ``` ## Build Lodestar In Cygwin https://www.cygwin.com/ console: ``` git clone https://github.com/chainsafe/lodestar.git cd lodestar yarn install --ignore-optional yarn run build cd .. ``` ## Build Lighthouse (use branch `unstable`) ``` git clone -b unstable https://github.com/sigp/lighthouse.git cd lighthouse make cd .. ``` ## Connect Nethermind-Lodestar In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In Cygwin https://www.cygwin.com/ console, in the `lodestar` folder ``` ./lodestar beacon \ --rootDir="../lodestar-beacondata" \ --paramsFile="./config.yaml" \ --genesisStateFile="./genesis.ssz" \ --network.discv5.bootEnrs="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --eth1.enabled=true \ --execution.urls="http://127.0.0.1:8550" \ --network.connectToDiscv5Bootnodes \ --network.discv5.enabled=true ``` Make sure to copy `config.yml` and `genesis.ssz` from `merge-testnets/kintsugi` folder to `lodestar` folder ## Connect Nethermind-LH In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In Cygwin https://www.cygwin.com/ console, in the `unstable` folder (use lighthouse branch `unstable`) ``` lighthouse \ --spec mainnet \ --testnet-dir ./ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8550 \ --enr-udp-port=9001 \ --enr-tcp-port=9001 \ --discovery-port=9001 \ --boot-nodes="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --eth1-endpoints http://127.0.0.1:8550 ``` # MacOS ## Clone the testnet configuration ``` git clone https://github.com/eth-clients/merge-testnets.git cd merge-testnets/kintsugi ``` ## Build Geth First make sure to have the `go` compiler installed: ``` brew install go ``` (use geth branch `merge-kintsugi` from github.com/mariusvanderwijden/go-ethereum) ``` git clone -b merge-kintsugi https://github.com/MariusVanDerWijden/go-ethereum.git cd go-ethereum make geth cd .. ``` ## Build Nethermind Pre-requisites: `dotnet 6.0` Install all prerequisites: ``` brew install rocksdb gmp snappy lz4 zstd ``` Build binary on `themerge_kintsugi` branch: ``` git clone -b themerge_kintsugi https://github.com/NethermindEth/nethermind --recursive cd nethermind/src/Nethermind dotnet build Nethermind.sln -c Release ``` ## Build Lighthouse Install cmake ``` brew install cmake rust ``` Install rust compiler and configure it ``` brew install rustup rustup-init ``` Then restart the current shell to have the shell's PATH updated. (use branch `unstable`) ``` git clone -b unstable https://github.com/sigp/lighthouse.git cd lighthouse make cd .. ``` ## Build Teku Ensure Java 11 or above is installed ``` brew install openjdk ``` ``` git clone https://github.com/ConsenSys/teku.git cd teku ./gradlew installDist cd .. ``` The teku executable is now available in `./teku/build/install/teku/bin/teku`. You can also use the pre-built distributions from https://github.com/ConsenSys/teku#binary-releases or the `consensys/teku:develop` docker image. ## Connect Geth-LH In the `kintsugi` folder ``` ./go-ethereum/build/bin/geth init genesis.json --datadir "datadir-lh" ./go-ethereum/build/bin/geth --datadir "datadir-lh" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337702 --syncmode=full --catalyst console ``` in second window (always from `kintsugi` folder): ``` lighthouse \ --spec mainnet \ --testnet-dir ./ \ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8545 \ --enr-udp-port=9001 \ --enr-tcp-port=9001 \ --discovery-port=9001 \ --boot-nodes="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Geth-Teku In the `kintsugi` folder ``` ./go-ethereum/build/bin/geth init genesis.json --datadir "datadir-teku" ./go-ethereum/build/bin/geth --datadir "datadir-teku" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337702 --syncmode=full --catalyst console ``` in second window ``` ./teku/build/install/teku/bin/teku \ --data-path "datadir-teku" \ --network https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/config.yaml \ --initial-state https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/genesis.ssz \ --Xee-endpoint http://localhost:8545 \ --p2p-discovery-bootnodes "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --log-destination console ``` ## Connect Nethermind-LH In the `src/Nethermind/Nethermind.Runner` folder of `nethermind` ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `kintsugi` folder (use lighthouse branch `unstable`) ``` lighthouse \ --spec mainnet \ --testnet-dir ./ \ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --dummy-eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8550 \ --eth1-endpoints http://127.0.0.1:8550 \ --enr-udp-port=9001 \ --enr-tcp-port=9001 \ --discovery-port=9001 \ --boot-nodes="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Nethermind-Prysm In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `prysm` folder ``` bazel run //beacon-chain -- \ --interop-genesis-state merge-testnets/kintsugi/genesis.ssz \ --datadir $PWD/../datadir-prysm \ --http-web3provider=http://localhost:8550 \ --min-sync-peers=1 \ --chain-config-file merge-testnets/kintsugi/config.yaml \ --bootstrap-node "enr:-Ly4QGibo1DJfV1BkAf8AnN6matZIlxGrDjnyTpR0qojiGD8XxDysNCEk1NctXRv3e04sHBu-okKgJBZzYHwQDeWG2QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpDtvzqoQQAAcAQAAAAAAAAAgmlkgnY0gmlwhMBR0MqJc2VjcDI1NmsxoQI69Upbug4HrZ-WKvP3uqZfapzxM7WUG3_eB3F5zoP3B4hzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA" \ --merge-testnet \ --terminal-total-difficulty-override 5000000000 ``` ## Connect Nethermind-Teku In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window ``` teku/build/install/teku/bin/teku \ --data-path "datadir-teku" \ --network https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/config.yaml \ --initial-state https://github.com/eth-clients/merge-testnets/raw/main/kintsugi/genesis.ssz \ --Xee-endpoint http://localhost:8550 \ --p2p-discovery-bootnodes "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" ``` ## Connect Nethermind-Nimbus In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `kintsugi` folder ``` nimbus-eth2/build/nimbus_beacon_node \ --network=. \ --web3-url=ws://127.0.0.1:8551 \ --log-level=DEBUG \ --terminal-total-difficulty-override=5000000000 \ --data-dir=nimbus-beacondata \ --bootstrap-node=enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk ``` ## Connect Nethermind-Lodestar In the `src/Nethermind/Nethermind.Runner` folder of nethermind ``` dotnet run -c Release -- --config kintsugi ``` In a second window, in the `lodestar` folder ``` ./lodestar beacon \ --rootDir="../lodestar-beacondata" -\ -paramsFile="./config.yaml" \ --genesisStateFile="./genesis.ssz" \ --network.discv5.bootEnrs="enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \ --eth1.enabled=true \ --execution.urls="http://127.0.0.1:8550" \ --network.connectToDiscv5Bootnodes \ --network.discv5.enabled=true ``` Make sure to copy `config.yml` and `genesis.ssz` from `merge-testnets/kintsugi` folder to `lodestar` folder # Creating a validator deposit 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 (please build from source) - 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="0x60000069" # 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.kintsugi.themerge.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 # 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" ``` 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.