Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

public-poa-el-cl: init example code for public testnet #2

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
78 changes: 78 additions & 0 deletions public-poa-el-cl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Public PoA Network with EL an CL clients

## Creating your Kubernetes cluster

### Prerequisites

- [`terraform`](https://www.terraform.io/)
- [`doctl`](https://github.com/digitalocean/doctl)
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl)

The terraform directory contains an example on how to create a Kubernetes cluster on Digitalocean.

```sh
# Move to terraform dir
$ cd terraform

# Initialize terraform
$ terraform init

# See what's going to happen
$ terraform plan

# If all looks good, apply changes to create your cluster
$ terraform apply
```

Once the stack is created you can obtain your `~/.kube` config file by using the `doctl` cli.

```sh
# Initialize authentication
$ doctl auth init

# List available clusters
$ doctl kubernetes cluster list

# Save your connection iformation to ~/.kube/config
$ doctl kubernetes cluster kubeconfig save <CLUSTER_ID>

# Check that it works
$ kubectl get nodes
```

## Using helmsman to deploy multiple helm charts

### Prerequisites

- [`helm`](https://helm.sh/)
- [`helmsman`](https://github.com/Praqma/helmsman)
- [`helm-diff`](https://github.com/databus23/helm-diff)

The helmsman directory contains an example on how to deploy the helm charts using helmsman.

```sh
# Install shared services (e.g. Kube Prometheus Stack)
helmsman -f shared-services.yaml --show-diff --apply

# Install the charts defined in ethereum.yaml
# Note: You should check the file before applying it and adjust values to your requirements
helmsman -f ethereum.yaml --show-diff --apply
```

The following is an example on how to destroy everything created by a given stack:

```sh
# Delete everything that was applied by the "ethereum.yaml" stack
helmsman --no-banner -f ethereum.yaml --destroy
# Delete any PVC that was created
kubectl -n ethereum delete pvc --all
```

## Cleanup

Destroy the whole kubernetes cluster

```sh
# Destroy all terraform resources
cd terraform && terraform destroy
```
35 changes: 35 additions & 0 deletions public-poa-el-cl/helmsman/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Info: This is just an example file.
# You can copy it and then setup your own configuration.
# Make sure to change all values.
#
# Warning: Don't reuse these mnemonics for public facing nodes. Replace them with your own ones.
#

#
# Tips: Generating mnemonics can be done using the "eth2-val-tools"
# $ eth2-val-tools mnemonic
#
# Extracting a private key for the faucet can be done using "wagyu"
# $ wagyu ethereum import-hd --mnemonic "$EXECUTION_GENESIS_MNEMONIC" --derivation "m/44'/60'/0'/0/0"
#
# Generating the PoA signer keys can be done via "geth":
# $ geth account new --datadir $PWD/.data
#

EXECUTION_CHAIN_ID: 1337332
EXECUTION_GENESIS_MNEMONIC: "orphan crawl rally crazy drip amused minor goddess tube athlete kiss elephant neutral trigger pitch cause rule legal huge floor climb nice fence make"
CONSENSUS_GENESIS_MNEMONIC: "erode length dish afford tenant reform exercise tuna payment mesh rose brief coyote similar duty head describe season measure float mesh school calm attitude"

EXECUTION_SIGNER_KEY_0: \{"address":"bb6e40885d8648615ba1210a94893b080783e718","crypto":{"cipher":"aes-128-ctr","ciphertext":"21feb9077a5c83f179350bd31a32211e22f2b0ddb60a8080bb486173aa83bcfc","cipherparams":{"iv":"d09bc25853fe89ab5cc60c7ba75002c7"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"47dddc9c1a451e58a302aad2b502a0889a5b14927ccd9aa9f317427bfa5a750e"},"mac":"d2ef03ff7f8e09dc551878743c6c25b63d65d6864547dcd24c2625346bbda369"},"id":"52a39787-ac14-4dc1-bd24-8eddf9079b27","version":3\}
EXECUTION_SIGNER_KEY_1: \{"address":"8de51318351f79257b6a82ff09c6686d3d24ee77","crypto":{"cipher":"aes-128-ctr","ciphertext":"f26aaba014b430fea70b06d40845450a2d1c6a8d95edfcdeea5ccb7a93c102c9","cipherparams":{"iv":"d8c73db191d16dcd43044353648838f8"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"2c74e869064ae08cfde6b8e20ab100ac07749a9684f0f0fd71bfd297e5878008"},"mac":"5519f60e526961cbe5d01ed2162aef01fe9bf38771cc9b7221346a3fabaf0136"},"id":"66b60243-bfee-42fb-be97-5b00bc79b241","version":3\}
EXECUTION_SIGNER_KEY_2: \{"address":"853e23a1e11501adef0c05dc2b95a7a386a10f61","crypto":{"cipher":"aes-128-ctr","ciphertext":"8aa393ed45961ac8f8a5b56af2d96cf2b1e023a1396afa74e8ad09ce1c705775","cipherparams":{"iv":"932e516eafb446ee33c21e5c172b11eb"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"58e19eb93c9f04b40d16449a77d191304a04baeb68b3e316b12cfa8ac194823f"},"mac":"b876700b8cef08005764b7ec2b2637bac0bc3ed2ca67bfc403006156980eeaa5"},"id":"384615da-b504-4249-9a31-eb10f0e9cd5c","version":3\}

EXECUTION_SIGNER_ADDR_0: bb6e40885d8648615ba1210a94893b080783e718
EXECUTION_SIGNER_ADDR_1: 8de51318351f79257b6a82ff09c6686d3d24ee77
EXECUTION_SIGNER_ADDR_2: 853e23a1e11501adef0c05dc2b95a7a386a10f61

FAUCET_CAPTCHA_SECRET: "Replace with recaptcha secret"
FAUCET_PRIVATE_KEY: 6558968c774eb75c7ec2016efaa04abfc44cc64b583a071f5e63daeee0ca2d91

DO_DNS_ZONE_TOKEN: "Replace with digitalocean API token"
DO_DNS_DOMAIN: testnet0.themerge.dev
1 change: 1 addition & 0 deletions public-poa-el-cl/helmsman/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
34 changes: 34 additions & 0 deletions public-poa-el-cl/helmsman/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Nodeport ranges

The default open range is from 30000-32767

Start | Client deployment
----- | -----
30100 | geth-bootnode
30120 | geth-signer
30130 | geth-archive
30140 | geth
30300 | nethermind
30400 | besu
31080 | lighthouse-bootnode
31100 | lighthouse-beacon
31200 | lodestar-beacon
31300 | nimbus
31400 | teku-beacon
31500 | prysm-beacon



## Validator ranges

Total validators in genesis: `100000`

### Key allocation per clients

From | To | Client
----- | ---- |------
0 | 24000 | Lighthouse x 6
24000 | 48000 | Lodestar x 6
48000 | 72000 | Prysm x 6
72000 | 96000 | Nimbus x 6
96000 | 100000 | Teku x 1
Loading