Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update private-testnet.md #9389

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 53 additions & 62 deletions book/run/private-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,85 +13,76 @@ To see all possible configurations and flags you can use, including metrics and
Genesis data will be generated using this [genesis-generator](https://github.com/ethpandaops/ethereum-genesis-generator) to be used to bootstrap the EL and CL clients for each node. The end result will be a private testnet with nodes deployed as Docker containers in an ephemeral, isolated environment on your machine called an [enclave](https://docs.kurtosis.com/advanced-concepts/enclaves/). Read more about how the `ethereum-package` works by going [here](https://github.com/ethpandaops/ethereum-package/).

### Step 1: Define the parameters and shape of your private network
First, in your home directory, create a file with the name `network_params.json` with the following contents:
```json
{
"participants": [
{
"el_type": "reth",
"el_image": "ghcr.io/paradigmxyz/reth",
"cl_type": "lighthouse",
"cl_image": "sigp/lighthouse:latest",
"count": 1
},
{
"el_type": "reth",
"el_image": "ghcr.io/paradigmxyz/reth",
"cl_type": "teku",
"cl_image": "consensys/teku:latest",
"count": 1
}
],
"launch_additional_services": false
}
First, in your home directory, create a file with the name `network_params.yaml` with the following contents:
```yaml
participants:
- el_type: reth
el_image: ghcr.io/paradigmxyz/reth
cl_type: lighthouse
cl_image: sigp/lighthouse:latest
- el_type: reth
el_image: ghcr.io/paradigmxyz/reth
cl_type: teku
cl_image: consensys/teku:latest
```

> [!TIP]
> If you would like to use a modified reth node, you can build an image locally with a custom tag. The tag can then be used in the `el_image` field in the `network_params.json` file.
> If you would like to use a modified reth node, you can build an image locally with a custom tag. The tag can then be used in the `el_image` field in the `network_params.yaml` file.

### Step 2: Spin up your network

Next, run the following command from your command line:
```bash
kurtosis run github.com/ethpandaops/ethereum-package --args-file ~/network_params.json
kurtosis run github.com/ethpandaops/ethereum-package --args-file ~/network_params.yaml --image-download always
```
Kurtosis will spin up an [enclave](https://docs.kurtosis.com/advanced-concepts/enclaves/) (i.e an ephemeral, isolated environment) and begin to configure and instantiate the nodes in your network. In the end, Kurtosis will print the services running in your enclave that form your private testnet alongside all the container ports and files that were generated & used to start up the private testnet. Here is a sample output:
```console
INFO[2023-08-21T18:22:18-04:00] ====================================================
INFO[2023-08-21T18:22:18-04:00] || Created enclave: silky-swamp ||
INFO[2023-08-21T18:22:18-04:00] ====================================================
Name: silky-swamp
UUID: 3df730c66123
INFO[2024-07-09T12:01:35+02:00] ========================================================
INFO[2024-07-09T12:01:35+02:00] || Created enclave: silent-mountain ||
INFO[2024-07-09T12:01:35+02:00] ========================================================
Name: silent-mountain
UUID: cb5d0a7d0e7c
Status: RUNNING
Creation Time: Mon, 21 Aug 2023 18:21:32 EDT
Creation Time: Tue, 09 Jul 2024 12:00:03 CEST
Flags:

========================================= Files Artifacts =========================================
UUID Name
c168ec4468f6 1-lighthouse-reth-0-63
61f821e2cfd5 2-teku-reth-64-127
e6f94fdac1b8 cl-genesis-data
e6b57828d099 el-genesis-data
1fb632573a2e genesis-generation-config-cl
b8917e497980 genesis-generation-config-el
6fd8c5be336a geth-prefunded-keys
6ab83723b4bd prysm-password
414a075a37aa 1-lighthouse-reth-0-63-0
34d0b9ff906b 2-teku-reth-64-127-0
dffa1bcd1da1 el_cl_genesis_data
fdb202429b26 final-genesis-timestamp
da0d9d24b340 genesis-el-cl-env-file
55c46a6555ad genesis_validators_root
ba79dbd109dd jwt_file
04948fd8b1e3 keymanager_file
538211b6b7d7 prysm-password
ed75fe7d5293 validator-ranges

========================================== User Services ==========================================
UUID Name Ports Status
95386198d3f9 cl-1-lighthouse-reth http: 4000/tcp -> http://127.0.0.1:64947 RUNNING
metrics: 5054/tcp -> http://127.0.0.1:64948
tcp-discovery: 9000/tcp -> 127.0.0.1:64949
udp-discovery: 9000/udp -> 127.0.0.1:60303
5f5cc4cf639a cl-1-lighthouse-reth-validator http: 5042/tcp -> 127.0.0.1:64950 RUNNING
metrics: 5064/tcp -> http://127.0.0.1:64951
27e1cfaddc72 cl-2-teku-reth http: 4000/tcp -> 127.0.0.1:64954 RUNNING
metrics: 8008/tcp -> 127.0.0.1:64952
tcp-discovery: 9000/tcp -> 127.0.0.1:64953
udp-discovery: 9000/udp -> 127.0.0.1:53749
b454497fbec8 el-1-reth-lighthouse engine-rpc: 8551/tcp -> 127.0.0.1:64941 RUNNING
metrics: 9001/tcp -> 127.0.0.1:64937
rpc: 8545/tcp -> 127.0.0.1:64939
tcp-discovery: 30303/tcp -> 127.0.0.1:64938
udp-discovery: 30303/udp -> 127.0.0.1:55861
ws: 8546/tcp -> 127.0.0.1:64940
03a2ef13c99b el-2-reth-teku engine-rpc: 8551/tcp -> 127.0.0.1:64945 RUNNING
metrics: 9001/tcp -> 127.0.0.1:64946
rpc: 8545/tcp -> 127.0.0.1:64943
tcp-discovery: 30303/tcp -> 127.0.0.1:64942
udp-discovery: 30303/udp -> 127.0.0.1:64186
ws: 8546/tcp -> 127.0.0.1:64944
5c199b334236 prelaunch-data-generator-cl-genesis-data <none> RUNNING
46829c4bd8b0 prelaunch-data-generator-el-genesis-data <none> RUNNING
UUID Name Ports Status
0853f809c300 cl-1-lighthouse-reth http: 4000/tcp -> http://127.0.0.1:32811 RUNNING
metrics: 5054/tcp -> http://127.0.0.1:32812
tcp-discovery: 9000/tcp -> 127.0.0.1:32813
udp-discovery: 9000/udp -> 127.0.0.1:32776
f81cd467efe3 cl-2-teku-reth http: 4000/tcp -> http://127.0.0.1:32814 RUNNING
metrics: 8008/tcp -> http://127.0.0.1:32815
tcp-discovery: 9000/tcp -> 127.0.0.1:32816
udp-discovery: 9000/udp -> 127.0.0.1:32777
f21d5ca3061f el-1-reth-lighthouse engine-rpc: 8551/tcp -> 127.0.0.1:32803 RUNNING
metrics: 9001/tcp -> http://127.0.0.1:32804
rpc: 8545/tcp -> 127.0.0.1:32801
tcp-discovery: 30303/tcp -> 127.0.0.1:32805
udp-discovery: 30303/udp -> 127.0.0.1:32774
ws: 8546/tcp -> 127.0.0.1:32802
e234b3b4a440 el-2-reth-teku engine-rpc: 8551/tcp -> 127.0.0.1:32808 RUNNING
metrics: 9001/tcp -> http://127.0.0.1:32809
rpc: 8545/tcp -> 127.0.0.1:32806
tcp-discovery: 30303/tcp -> 127.0.0.1:32810
udp-discovery: 30303/udp -> 127.0.0.1:32775
ws: 8546/tcp -> 127.0.0.1:32807
92dd5a0599dc validator-key-generation-cl-validator-keystore <none> RUNNING
f0a7d5343346 vc-1-reth-lighthouse metrics: 8080/tcp -> http://127.0.0.1:32817 RUNNING
```

Great! You now have a private network with 2 full Ethereum nodes on your local machine over Docker - one that is a Reth/Lighthouse pair and another that is Reth/Teku. Check out the [Kurtosis docs](https://docs.kurtosis.com/cli) to learn about the various ways you can interact with and inspect your network.
Expand Down
Loading