From ad245702c9ce293e7294d80a2c2f5acc996ab974 Mon Sep 17 00:00:00 2001 From: Derek <103802618+leeederek@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:48:09 -0400 Subject: [PATCH] docs: minor fixes/polish to private network docs (#4441) --- book/run/private-testnet.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/book/run/private-testnet.md b/book/run/private-testnet.md index 901a4de68..e6bb16897 100644 --- a/book/run/private-testnet.md +++ b/book/run/private-testnet.md @@ -6,12 +6,13 @@ This guide uses [Kurtosis' eth2-package](https://github.com/kurtosis-tech/eth2-p * Go [here](https://docs.kurtosis.com/install/) to install Kurtosis * Go [here](https://docs.docker.com/get-docker/) to install Docker -The `eth2-package` is a package that is a general purpose testnet definition for instantiating private testnets at any scale over Docker or Kubernetes. This guide will go through how to spin up a local private testnet with Reth various CL clients. Specifically, you will instantiate a 2-node network over Docker with Reth/Lighthouse and Reth/Teku client combinations. +The [`eth2-package`](https://github.com/kurtosis-tech/eth2-package) is a [package](https://docs.kurtosis.com/concepts-reference/packages) for a general purpose Ethereum testnet definition used for instantiating private testnets at any scale over Docker or Kubernetes, locally or in the cloud. This guide will go through how to spin up a local private testnet with Reth various CL clients locally. Specifically, you will instantiate a 2-node network over Docker with Reth/Lighthouse and Reth/Teku client combinations. To see all possible configurations and flags you can use, including metrics and observability tools (e.g. Grafana, Prometheus, etc), go [here](https://github.com/kurtosis-tech/eth2-package#configuration). 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/concepts-reference/enclaves/). Read more about how the `eth2-package` works by going [here](https://github.com/kurtosis-tech/eth2-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 { @@ -30,17 +31,17 @@ First, in your home directory, create a file with the name `network_params.json` "cl_client_image": "consensys/teku:latest", "count": 1 } - ] + ], "launch_additional_services": false } ``` +### Step 2: Spin up your network Next, run the following command from your command line: ```bash kurtosis run github.com/kurtosis-tech/eth2-package "$(cat ~/network_params.json)" ``` - -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: +Kurtosis will spin up an [enclave](https://docs.kurtosis.com/concepts-reference/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 || @@ -89,5 +90,17 @@ b454497fbec8 el-1-reth-lighthouse engine-rpc: 8551/tcp - 46829c4bd8b0 prelaunch-data-generator-el-genesis-data RUNNING ``` -## Using Kubernetes on remote infrastructure -Kurtosis packages are portable and reproducible, meaning they will work the same way over Docker locally as in the cloud on Kubernetes. Check out these docs [here](https://docs.kurtosis.com/k8s/) to learn how to deploy your private testnet to a Kubernetes cluster. +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. + +## Using Kurtosis on Kubernetes +Kurtosis packages are portable and reproducible, meaning they will work the same way over Docker or Kubernetes, locally or on remote infrsatructure. For use cases that require a larger scale, Kurtosis can be deployed on Kubernetes by following these docs [here](https://docs.kurtosis.com/k8s/). + +## Running the network with additional services +The [`eth2-package`](https://github.com/kurtosis-tech/eth2-package) comes with many optional flags and arguments you can enable for your private network. Some include: +- A Grafana + Prometheus instance +- A transaction spammer called [`tx-fuzz`](https://github.com/MariusVanDerWijden/tx-fuzz) +- [A network metrics collector](https://github.com/dapplion/beacon-metrics-gazer) +- Flashbot's `mev-boost` implementation of PBS (to test/simulate MEV workflows) + +### Questions? +Please reach out to the [Kurtosis discord](https://discord.com/invite/6Jjp9c89z9) should you have any questions about how to use the `eth2-package` for your private testnet needs. Thanks!