Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
268 commits
Select commit Hold shift + click to select a range
aca26a1
Fix TTD on gc-merge-devnet-1
dapplion Jun 30, 2022
08b4f35
Merge pull request #8 from gnosischain/gc-merge-devnet-1-ttd
dapplion Jun 30, 2022
4b95915
Add parithosh
dapplion Jul 7, 2022
8e8d1fa
WIP gc-merge-devnet-2
dapplion Jul 8, 2022
a5fb564
Add nethermind Seq
dapplion Jul 8, 2022
c02a5e0
disable EthStats for nethermind
dapplion Jul 8, 2022
9b7c883
Archive logs
dapplion Jul 8, 2022
ee2c152
Update inventory
dapplion Jul 8, 2022
6dc6858
Add inventory
dapplion Jul 8, 2022
f7cf964
Fix data
dapplion Jul 9, 2022
9d92f85
Add generate eth2 genesis playbook
dapplion Jul 9, 2022
4985773
All deploy from scratch playbook
dapplion Jul 9, 2022
e0b87af
Update genesis time
dapplion Jul 9, 2022
d5cbc81
Fix eth2 gen
dapplion Jul 9, 2022
65caff8
Add bootnodes
dapplion Jul 9, 2022
fc6bc2d
Update playbooks
dapplion Jul 8, 2022
2883166
Merge pull request #11 from gnosischain/update_playbooks
dapplion Jul 9, 2022
f06639c
Merge branch 'master' into gc-merge-devnet-2
dapplion Jul 9, 2022
ee51b3a
Delete scripts
dapplion Jul 9, 2022
b343714
Merge pull request #10 from gnosischain/gc-merge-devnet-2
dapplion Jul 9, 2022
edb0365
Setup cadvisor
dapplion Jul 9, 2022
e59202e
Change cadvisor port
dapplion Jul 9, 2022
f67aee9
adding logging agent installation script
Jul 13, 2022
7e8a9c6
WIP
dapplion Jul 13, 2022
3ec3871
adding node exporter and cadvisor metrics exporter
Jul 13, 2022
ef868b5
fixing policy attachment
Jul 14, 2022
2647b8e
adding prometheus metrics pusher cronjob
Jul 15, 2022
7c0f656
latest changes
Jul 15, 2022
73df6a4
adding prometheus metrics
Jul 18, 2022
36c644a
adding an timestamp through elasticsearch
Jul 19, 2022
255ca53
Add gc-merge-devnet-3 config
dapplion Jul 19, 2022
d764c7d
Adjust params
dapplion Jul 19, 2022
bc839f6
Fix typo
dapplion Jul 19, 2022
59a15c9
Fix name
dapplion Jul 19, 2022
6ae45f7
Add note for smoother deployment
dapplion Jul 19, 2022
823676b
Correct time
dapplion Jul 19, 2022
3b200d2
Merge pull request #18 from gnosischain/gc-merge-devnet-3
dapplion Jul 19, 2022
7429540
Network explorer components in host
dapplion Jul 19, 2022
efc091e
Merge pull request #19 from gnosischain/fix-explorers
dapplion Jul 19, 2022
5c9fe3f
Deploy lighthouse:latest-unstable in devnet-1
dapplion Jul 13, 2022
a978944
Drop --Network.DiagTracerEnabled=true
dapplion Jul 19, 2022
5938d26
Rename container to execution
dapplion Jul 19, 2022
ed30fcd
host can be passed as a variable now and lowering the log level
Jul 20, 2022
2f8defb
Add xdai-shadow-fork-1
dapplion Jul 19, 2022
fb03592
Revert fixes
dapplion Jul 20, 2022
69afadc
update: push_url endpoint
Jul 20, 2022
1144f6c
update: iptables ease testing
Jul 20, 2022
dbad2d5
setup logging playbook
Jul 20, 2022
a41d5af
Add ansible-vault
dapplion Jul 20, 2022
14b86b2
Merge pull request #22 from gnosischain/vault
dapplion Jul 20, 2022
a945fd0
Run sync-test
dapplion Jul 20, 2022
72ea2fb
Remove stale groups
dapplion Jul 20, 2022
fcda1d8
fix: python script to read file with ordered array of hosts
Jul 20, 2022
fd403e3
update: do dpkg and refresh cache and upgrade apt-get
Jul 20, 2022
75289ab
update: inventory with latest params
Jul 20, 2022
821da9a
Add restart sync tests
dapplion Jul 20, 2022
3f96033
Fix permissions on validator dir
giacomolicari Jul 20, 2022
2f79176
Add RPC for txpool
dapplion Jul 20, 2022
82cb45d
Merge branch 'xdai-shadow-fork-1' into adding-log-capability
giacomolicari Jul 20, 2022
507e33e
Update README file, add common_log_driver and common_log_options to d…
giacomolicari Jul 20, 2022
a4ec151
Add roles folder to gitignore
giacomolicari Jul 20, 2022
c59f6ee
Remove roles folder from git
giacomolicari Jul 20, 2022
465e228
Update README
giacomolicari Jul 20, 2022
f0f5f3e
Merge pull request #24 from gnosischain/adding-log-capability
giacomolicari Jul 20, 2022
4b39f15
Set blockscout SUBNETWORK
dapplion Jul 19, 2022
a224dd9
Add xdai-shadow-fork-0
dapplion Jul 19, 2022
f1328c7
Update IPs
dapplion Jul 19, 2022
03cc91f
Update IPs
dapplion Jul 19, 2022
5bcf504
Add bootnodes
dapplion Jul 20, 2022
b2c2cb2
Delay TTD
dapplion Jul 20, 2022
3fc9c68
Add update_ttd playbook
dapplion Jul 20, 2022
ab32bcb
Set TTD to very high value
dapplion Jul 21, 2022
2aad9e4
Add secrets.yaml
dapplion Jul 21, 2022
375bd6f
Add Sync.FastSync
dapplion Jul 21, 2022
3155e0b
Fixes
dapplion Jul 21, 2022
1c740a6
Add replace_sources_file
dapplion Jul 21, 2022
7bc8bd1
Replace for execution_node_dir
dapplion Jul 21, 2022
748f554
Make replace_sources_file generic
dapplion Jul 21, 2022
acefb7e
Simplify replace_sources_file
dapplion Jul 21, 2022
fd269d7
:fixing the input source
Jul 21, 2022
283b1ec
fixing metrics for the fluentd agent
Jul 21, 2022
b5a9111
Handle root first login
dapplion Jul 21, 2022
956b3b5
Disable promtail_enabled
dapplion Jul 21, 2022
7ab36e6
Run sync test
dapplion Jul 21, 2022
0d8fae2
Sort Sync flags
dapplion Jul 21, 2022
80ee443
fixing a detail in the fluentd config
Jul 22, 2022
9bfc92d
Add inventory in steps
giacomolicari Jul 22, 2022
57eab15
fixing a detail in the fluentd config
Jul 22, 2022
e3b3c57
Merge parithosh/master into master
dapplion Jul 22, 2022
333529b
Merge remote-tracking branch 'parithosh/master'
dapplion Jul 22, 2022
3d28e84
Update configs
dapplion Jul 22, 2022
a3da382
Fix genesis state
dapplion Jul 22, 2022
552a136
Update genesis time
dapplion Jul 22, 2022
a0c0001
Add note about bad state
dapplion Jul 22, 2022
619ccc9
Add bootnodes
dapplion Jul 22, 2022
9f51a91
Fix Upload network data
dapplion Jul 22, 2022
57a2d9a
Make genesis sooner
dapplion Jul 22, 2022
4af9b35
Update bootnodes
dapplion Jul 22, 2022
59507f0
update: secrets
Jul 22, 2022
8e97871
add: remote_write_enabled to turn it off in environments where pull a…
Jul 22, 2022
63d1d53
update: naming convention to make clear prometheus is enabled or not …
Jul 22, 2022
ed020a5
fix: prometheus_enabled flag also to merge-devnet-0
Jul 22, 2022
50bec60
update: secrets
Jul 22, 2022
a0cb126
Resolve conflict on README
giacomolicari Jul 22, 2022
497ba0d
Add TTD calculator script
giacomolicari Jul 22, 2022
d979177
add: logging secrets
Jul 22, 2022
be109db
Update inventory vars
giacomolicari Jul 22, 2022
b56a76e
Merge remote-tracking branch 'origin/adding-log-capability' into shad…
giacomolicari Jul 22, 2022
e8d8195
Add startup host to collect_enodes task
giacomolicari Jul 22, 2022
cde3aaf
Make collect_enodes work on startup host
giacomolicari Jul 22, 2022
d80cd50
Merge branch 'master' into xdai-shadow-fork-0
dapplion Jul 22, 2022
b50c08c
Merge pull request #23 from gnosischain/xdai-shadow-fork-0
dapplion Jul 22, 2022
80502c1
Fix conflict, remove validator setup from teku config
giacomolicari Jul 22, 2022
f636e7f
Add step to deploy beacon validators
giacomolicari Jul 22, 2022
63381c7
Improve steps to deploy shadow-forks, improve TTD calculator, add dev…
giacomolicari Jul 23, 2022
da8bf6f
Improve get_beacon_status script
giacomolicari Jul 23, 2022
8c6fb85
Update MIN_GENESIS_TIME, review steps to deploy validators and explorers
giacomolicari Jul 23, 2022
dccf1ba
Get changes from master
giacomolicari Jul 24, 2022
ef28156
Solve conflicts and merge from master
giacomolicari Jul 24, 2022
7cf6e9f
Remove startup host
giacomolicari Jul 24, 2022
ae1d04f
Update TTD and genesis timestamp
giacomolicari Jul 24, 2022
ba13fc0
Move snooper task to step 2_deploy_execution_nodes
giacomolicari Jul 24, 2022
4d34f85
Make logging_capability playbook get vars from secrets file.
giacomolicari Jul 25, 2022
f4370b0
Merge pull request #25 from gnosischain/shadow-fork-setup-devops
giacomolicari Jul 25, 2022
f1eac9c
Update secrets, add Google DNS to list of DNS resolvers
giacomolicari Jul 25, 2022
8769135
Move playbooks/steps to playbooks/shadow-fork/
giacomolicari Jul 25, 2022
a131381
Merge pull request #26 from gnosischain/shadow-fork-setup-devops
giacomolicari Jul 25, 2022
3d398a7
adding a buffer to elasticsearch and limiting the request size:
Jul 25, 2022
bd1f4e1
Get latest changes from master and solve conflicts
giacomolicari Jul 25, 2022
db03fb5
Merge pull request #27 from gnosischain/adding-log-capability
giacomolicari Jul 25, 2022
43ea27d
Improve shadow-fork steps, add bootnode and firewall setup
giacomolicari Jul 25, 2022
af85a86
Merge pull request #28 from gnosischain/fix-shadow-fork-1
giacomolicari Jul 26, 2022
431a142
Update ETH2 config and TTD, update ETH2 bootnodes
giacomolicari Jul 26, 2022
b26dec7
Merge pull request #29 from gnosischain/sf-1-update-config
giacomolicari Jul 26, 2022
d9433bf
add: documentation regarding metrics and beacon api in README
Jul 26, 2022
3997139
Update secrets
giacomolicari Jul 26, 2022
09253c2
Merge pull request #31 from gnosischain/update-secrets-testnet
giacomolicari Jul 26, 2022
bfa5126
Add base
dapplion Jul 26, 2022
86d4d33
Add pre-mines
dapplion Jul 26, 2022
138822a
Prepare configs
dapplion Jul 26, 2022
6f9fd33
Add mining keystores
dapplion Jul 26, 2022
12eca6c
Deploy aura validators
dapplion Jul 26, 2022
8fb4638
Fix typo in names
dapplion Jul 26, 2022
1f89371
Fix all group variables
dapplion Jul 26, 2022
ae92446
Remove promtail
dapplion Jul 26, 2022
c3dcf98
Move keystores
dapplion Jul 26, 2022
6ad307f
Write keystore password
dapplion Jul 26, 2022
8acfc79
Update bootnodes
dapplion Jul 26, 2022
c5b5e6e
Update secrets
dapplion Jul 26, 2022
99bf2c5
List mnemonics declaration
dapplion Jul 26, 2022
e4a0b6c
Remove port bindings if network_mode: host
dapplion Jul 26, 2022
ce1c77d
Add prometheus_skip_install option
dapplion Jul 26, 2022
992fe4a
Set prometheus_push_url in visible vars
dapplion Jul 26, 2022
7ed49b5
Add GenesisHash
dapplion Jul 26, 2022
297c186
Use multiple prometheus_remote_write_configs
dapplion Jul 26, 2022
bae583a
Flat miner keystores
dapplion Jul 26, 2022
05a7f87
format keystores
dapplion Jul 26, 2022
1cc99b1
Undo changes
dapplion Jul 26, 2022
9469e71
Merge pull request #32 from gnosischain/denver
dapplion Jul 26, 2022
20e6cf6
Deploy txfuzzer in denver testnet
dapplion Jul 26, 2022
22c74ed
Merge pull request #33 from gnosischain/denver-txfuzzer
dapplion Jul 26, 2022
a454242
Add debug_bad_state.sh
dapplion Jul 26, 2022
f8cc98d
Merge pull request #35 from gnosischain/bad_state
dapplion Jul 26, 2022
2b29378
Update xdai-shadow-fork-0
dapplion Jul 26, 2022
6a53da5
Merge pull request #37 from gnosischain/fix-gc-shadow-fork-0
dapplion Jul 26, 2022
d3bc2af
Add gc-shadow-fork-2
dapplion Jul 22, 2022
ca0ba46
Remove serial 20
dapplion Jul 26, 2022
14ef798
Fix Generate validator keys
dapplion Jul 26, 2022
eef4154
Fix Upload network data
dapplion Jul 26, 2022
1326362
Add metrics and bootnodes
dapplion Jul 27, 2022
ae8eea1
Merge pull request #36 from gnosischain/gc-shadow-fork-2
dapplion Jul 27, 2022
aa2cc93
Generate genesis
dapplion Jul 27, 2022
c29d2a3
Create genesis file
dapplion Jul 27, 2022
0fbfe25
Fix genesis time
dapplion Jul 27, 2022
6316c5f
Merge pull request #38 from gnosischain/denver-cl-genesis
dapplion Jul 27, 2022
83767e6
Add bootnodes
dapplion Jul 27, 2022
d3afba8
Merge pull request #40 from gnosischain/denver_bootnodes
dapplion Jul 27, 2022
182ac75
Deploy beefy explorer for gc-shadow-fork-2
dapplion Jul 27, 2022
75b9962
Set high TTD for denver
dapplion Jul 27, 2022
850af3a
Add chiado testnet (#42)
dapplion Jul 27, 2022
a6875ae
Merge remote-tracking branch 'parithosh/master'
dapplion Jul 29, 2022
296ab5b
Allocate chiado mnemonics
dapplion Jul 29, 2022
1dba9c3
Add shadow-fork bootnodes
dapplion Aug 1, 2022
147ccf7
Complete denver provisioning (#43)
dapplion Aug 1, 2022
e6b63a3
Split denver-lighthouse-nethermind-10 keys
dapplion Aug 1, 2022
116c644
Script to print "Execution head of all nodes"
dapplion Aug 1, 2022
9d3ac46
Use docker_container in Generate keys
dapplion Aug 1, 2022
114226e
Fix generate validator keys
dapplion Aug 1, 2022
b96a13f
Don't detach from Generate keys
dapplion Aug 2, 2022
414583b
Update denver bootnodes
dapplion Aug 2, 2022
388b65e
Move denver-nimbus-nethermind-* hosts to lighthouse
dapplion Aug 2, 2022
a779c51
Lower MinGasPrice for txfuzz
dapplion Aug 2, 2022
71213d1
Add access to riccardo-gnosis
dapplion Aug 2, 2022
0bc0903
Add access to gnosis devops team
dapplion Aug 2, 2022
c858a9e
add: add setup ethstats service on shadow-fork, put password inside s…
Aug 2, 2022
bee4121
remove: forrwardslash would cause issues with nethermind config
Aug 2, 2022
98c1e71
Add denver cl genesis v2 (#45)
dapplion Aug 2, 2022
f4a78aa
Add new cl bootnodes (#46)
dapplion Aug 2, 2022
fcc5297
add: forkmon deploy as a shadow fork step, add iptables to open up rp…
Aug 2, 2022
b500ec0
Add more bootnodes
dapplion Aug 2, 2022
d620eb7
Setup ethstats in denver and chiado (#47)
dapplion Aug 3, 2022
70fa2f6
add: Makefile to create shortcuts for fine grained useful commands
Aug 3, 2022
076cd5c
fix: change ethstats_url to ethstats_host
Aug 3, 2022
b1b7866
fix: change ethstats_url to ethstats_host for denver
Aug 3, 2022
bbf53f2
add: Makefile commands to interact with secrets
Aug 3, 2022
c46588d
Split explorer group intro beacon and execution (#48)
dapplion Aug 3, 2022
e8b17eb
Disable prunning for some hosts
dapplion Aug 3, 2022
0472086
Re-add deleted code
dapplion Aug 3, 2022
eaf108c
Change chiado chainID
dapplion Aug 3, 2022
1dfbc8a
Remove unwanted code
dapplion Aug 3, 2022
c95c89a
Add chiado genesis (#49)
dapplion Aug 3, 2022
6ea3297
Add chiado genesis (#49)
dapplion Aug 3, 2022
4392f26
Add TTD to chiado genesis
dapplion Aug 4, 2022
f74004a
Merge branch 'backup'
dapplion Aug 4, 2022
07aa8af
Add chiado README
dapplion Aug 8, 2022
6709111
Add guides
dapplion Aug 8, 2022
16676de
Fix links
dapplion Aug 8, 2022
9f29d84
Re-organize chiado README
dapplion Aug 8, 2022
d355144
Fix typo ordering
dapplion Aug 8, 2022
043171e
Add metrics push to Nethermind
dapplion Aug 8, 2022
26d09aa
Assign Kleros.io mnemonic
dapplion Aug 9, 2022
6357cf1
Add Gateway
dapplion Aug 9, 2022
5000c0f
Add DAppNode packages
dapplion Aug 9, 2022
95180bb
Deploy remaining keys locally
dapplion Aug 10, 2022
f811f9a
Declare all mnemonics
dapplion Aug 10, 2022
d364e38
Fix typo in chiado naming
dapplion Aug 10, 2022
3f4a5fe
Fix inventory chiado
dapplion Aug 10, 2022
107b09c
Add Web3signer dappnode package
dapplion Aug 10, 2022
30238c0
Remove TerminalTotalDifficulty from config
dapplion Aug 10, 2022
08b31a3
Remove new group
dapplion Aug 10, 2022
7e10f74
Set peer count to 100
dapplion Aug 10, 2022
a1e59fc
Expose RPC and eth1 metrics
dapplion Aug 10, 2022
c9d7e54
Use "bad" state already distributed to network participants
dapplion Aug 10, 2022
ea2c289
Add `disable_prunning` (archive mode) for chiado-explorer-execution-l…
girianshido Aug 10, 2022
c7bd29c
Add bootnodes from Igor
dapplion Aug 10, 2022
03edb90
Move Lodestar to Teku temporarily
dapplion Aug 10, 2022
1cd3f38
Move chiado Prysm nodes to Lighthouse
dapplion Aug 10, 2022
d649151
Setup chown to permissions on beacon chain path
girianshido Aug 10, 2022
58b3d4f
Add Merge.TerminalTotalDifficulty flag
dapplion Aug 10, 2022
b2036b7
unset gather_facts
dapplion Aug 10, 2022
bdd3aa3
Enable debug module for Nethermind on Denver and Chiado
girianshido Aug 11, 2022
028d34c
Merge pull request #51 from gnosischain/feature/chown_beacon_path
girianshido Aug 11, 2022
5ed7912
Replace prunning_none with el_archive_config, disable fastsync on arc…
giacomolicari Aug 12, 2022
c9e16f7
Merge pull request #52 from gnosischain/feature/improve-chiado-explor…
giacomolicari Aug 12, 2022
161c702
update ip's of the explorer which are now running on aws
Aug 12, 2022
c69aa56
integrate task to install docker and set it up on the machine
Aug 12, 2022
e12f0cd
update ip's of the explorer which are now running on aws
Aug 12, 2022
e68b5ee
Enable additional RPC modules on Nethermind: tracing, parity
giacomolicari Aug 12, 2022
11a9848
Move chiado-prysm-nethermind-09 to prysm
dapplion Aug 13, 2022
3820998
adjusting the eth_stat and the fork monitor
Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
external_roles/
!external_roles/ansible-haproxy

mnemonic_keys
secret.sh
validator_prep
*.tar.gz
Expand All @@ -14,11 +15,15 @@ pithos-testnet/secret.sh
pithos-testnet/mergenet.yaml
pithos-testnet/custom_config_data/venv
backups
explorerdata
mergenet.yaml
faucet.yml
reverse_proxy.yml
dshackle.yml

.vault_pass

.vscode/settings.json
enrs.json
enodes.json

bad_state_data
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

testnet ?=

ifeq ($(testnet), "")
$(error you should provide a target testnet);
endif

reboot-execution:
ansible-playbook --limit=execution -i $(PWD)/$(testnet)/inventory/inventory.ini -e @$(PWD)/$(testnet)/inventory/group_vars/secrets.yaml --ask-vault-pass $(PWD)/playbooks/tasks/start_execution_node.yml

view-secrets:
ansible-vault view $(PWD)/$(testnet)/inventory/group_vars/secrets.yaml

edit-secrets:
ansible-vault edit $(PWD)/$(testnet)/inventory/group_vars/secrets.yaml

view-root-secrets:
ansible-vault view $(PWD)/secrets.yaml

edit-root-secrets:
ansible-vault edit $(PWD)/secrets.yaml
33 changes: 33 additions & 0 deletions PROVISION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Provision

Instructions for provisioning hosts efficiently with Digital Ocean

### Setup tool

Install tool: https://docs.digitalocean.com/reference/doctl/how-to/install/

Go get an API token with write permissions in the UI (bottom right corner) https://cloud.digitalocean.com/account/api/tokens

```
doctl auth init
```

### Provision hosts

```
doctl compute droplet create --image ubuntu-20-04-x64 --region sfo3 --size s-4vcpu-8gb-amd --ssh-keys lion --tag-name gc-merge-devnet-3 gc-merge-devnet-3-0
```

### Delete hosts after testnet

To delete all droplets with tag `gc-merge-devnet-3`

```
doctl compute droplet delete --tag-name gc-merge-devnet-3
```

To list remaining droplets

```
doctl compute droplet list
```
256 changes: 234 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,253 @@
# Testnet ansible files + Config
# Gnosis chain testnet deployments

This repository is a minimal set of playbooks and inventories required to set up the merge devnets consisting of execution and
consensus nodes.
Quick links:

- **Chiado testnet**
- [Guides and how to get keys](chiado/README.md)
- [Genesis and config files](chiado/custom_config_data)

## General information

This repository is a minimal set of playbooks and inventories required to set up the merge devnets consisting of execution and
consensus nodes.

- General folder structure: All testnet relevant configs are under the testnet names. Generic config variables are set under
`<name>-testnet/inventory/group_vars/all.yaml`. Client specific variables are set under e.g `<name>-testnet/inventory/group_vars/eth2client_xxxxxx.yaml`.
The client specific variables also contains the commands used to start the docker image with.
`<name>-testnet/inventory/group_vars/all.yaml`. Client specific variables are set under e.g `<name>-testnet/inventory/group_vars/eth2client_xxxxxx.yaml`.
The client specific variables also contains the commands used to start the docker image with.
- All the config files, `genesis.ssz` and other variables needed for the testnet are placed under `<name>-testnet/custom_config_data`.

## Instructions to join testnet
1. Clone this repository
## Instructions to join testnet

1. Clone this repository
2. Ensure `docker` and `docker-compose` is installed: `docker-compose --version` and `docker --version`
3. Change directories with `cd consensus-deployment-ansible/scripts/quick-run/<testnet-type>`
4. Create the required directories for persistent data with `mkdir -p execution_data beacon_data`
3. Change directories with `cd consensus-deployment-ansible/scripts/quick-run/<testnet-type>`
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` file file located in `consensus-deployment-ansible/scripts/quick-run/`, this is just to ensure easy peering
5.1 `curl ifconfig.me` or visit https://whatismyipaddress.com
5.2 Replace IP in config file with your own IP address: https://i.imgur.com/xnNqN6h.png
6. Run your chosen execution engine, e.g: `docker-compose --env-file <testnet-name>.vars -f docker-compose.geth.yml up -d`
7. Run your chosen consensus engine, e.g: `docker-compose --env-file <testnet-name>.vars -f docker-compose.lighthouse.yml up -d`
8. Check your logs to confirm that they are up and syncing, e.g `docker logs lighthouse_beacon -f --tail=20`
5.1 `curl ifconfig.me` or visit https://whatismyipaddress.com
5.2 Replace IP in config file with your own IP address: https://i.imgur.com/xnNqN6h.png
6. Run your chosen execution engine, e.g: `docker-compose --env-file <testnet-name>.vars -f docker-compose.geth.yml up -d`
7. Run your chosen consensus engine, e.g: `docker-compose --env-file <testnet-name>.vars -f docker-compose.lighthouse.yml up -d`
8. Check your logs to confirm that they are up and syncing, e.g `docker logs lighthouse_beacon -f --tail=20`
9. To stop the clients, run `docker-compose -f <insert file name you used earlier here> down`

## Alternative Instructions to join the Kintsugi testnet
- [ethstaker instructions to join Kintsugi](https://github.com/remyroy/ethstaker/blob/main/merge-devnet.md)


- [ethstaker instructions to join Kintsugi](https://github.com/remyroy/ethstaker/blob/main/merge-devnet.md)

## Instructions for running ansible playbooks (Only works if you have access)

1. Clone this repository
2. Ensure `ansible` is installed
3. Make changes in the required variable, e.g: Change the `pithos-testnet/inventory/group_vars/eth1client_ethereumjs.yaml`
with the new docker image or the `eth1_start_args` for commands to run the container with
with the new docker image or the `eth1_start_args` for commands to run the container with
4. The `update_execution_beacon_and_validator.yml` will stop the execution, beacon and validator containers and restart them
with the new configurations specified as variables. Please use the `limit=eth1/2_xxxx` flag to limit the playbook execution to just update
the nodes you have access to (otherwise it won't change the config on the others, but will show a lot of errors).
Run this playbook with: `ansible-playbook -i pithos-testnet/inventory/inventory.ini playbooks/update_execution_beacon_and_validator.yml --limit=eth1client_ethereumjs`
5. If you just want to update an execution node without touching the other docker containers use the `tasks`, e.g to restart execution node with the new parameters use,
with the new configurations specified as variables. Please use the `limit=eth1/2_xxxx` flag to limit the playbook execution to just update
the nodes you have access to (otherwise it won't change the config on the others, but will show a lot of errors).
Run this playbook with: `ansible-playbook -i pithos-testnet/inventory/inventory.ini playbooks/update_execution_beacon_and_validator.yml --limit=eth1client_ethereumjs`
5. If you just want to update an execution node without touching the other docker containers use the `tasks`, e.g to restart execution node with the new parameters use,

```bash
ansible-playbook -i pithos-testnet/inventory/inventory.ini playbooks/tasks/stop_execution_node.yml --limit=eth1client_ethereumjs
ansible-playbook -i pithos-testnet/inventory/inventory.ini playbooks/tasks/start_execution_node.yml --limit=eth1client_ethereumjs
```
```

## Use docker logs with custom logging drivers

By default the docker daemon collects logs using the `json-file` driver. While this is useful for most of the cases, there could be some specific scenarios where another logging driver should be used.

If so, just specify the variables `common_log_driver` and `common_log_options` in the all.yml config file (it will use `json-file` by default).

Accepted values are the ones from the official docker [documentation](https://docs.docker.com/config/containers/logging/)

Please note that if you are changing the logging driver of an already running container, there might need for a restart of the container in order to have docker get the latest config changes.

#### User docker logs with fluentd

There's a ready-to-use playbook which takes care of installing the fluentd logs collector.
Just set the following variables in `all.yml` or on your `secrets.yml` file:

- `logging_host=URL To Logs Collector`
- `logging_auth_user=User With Permissions to push logs`
- `logging_auth_password=User Password`

Sample logging driver configurations:

```
## JSON file
common_log_driver: json-file
common_log_options:
max-file: "10"
max-size: 500m
mode: non-blocking
max-buffer-size: 4m

## Fluentd

common_log_driver: fluentd
common_log_options: {}
```

That can be either an ElasticSearch or OpenSearch URL.

## Working with secrets

This repo uses [ansible-vault](https://www.digitalocean.com/community/tutorials/how-to-use-vault-to-protect-sensitive-ansible-data) to manage secrets. The secrets of each inventory are committed separately as a `secrets.yaml` file. This contains variables such as

```yaml
remote_write_username: ***********
remote_write_password: ***********
explorer_postgres_password: ***********
nethermind_seq_api_key: ***********
secret_keys: ***********
```

To have good UX working with secrets, do the following:

1. Get the vault secret from @dapplion
2. Write the vault secret in `./.vault_pass`
3. Add this two lines in your `~/.bashrc` file to read the password automatically on each run (remember to also apply on current terminal)

```
# Specify editor for ansible vault
export EDITOR=nano
# Automatically read vault pass for ansible-vault
export ANSIBLE_VAULT_PASSWORD_FILE=./.vault_pass
```

To add new secrets just do

```
ansible-vault edit gc-merge-devnet-3/inventory/group_vars/secrets.yaml
```

## Instructions to deploy testnet

**1. Provision**

Provision instances and allocate hosts in `$testnet/inventory/inventory.ini`

```ini
$network-$eth2client-$eth1client-1 ansible_host=159.223.195.87 mnemonic={{mnemonic_0}} indexes=2000..3000
```

Create a mnemonic with https://iancoleman.io/bip39/ and set it in a hidden `secrets.yml`, for example:

```yaml
mnemonic_0: "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete"
```

**2. Deploy**

> **Note**:
> By default the docker daemon collects logs using the `json-file` driver, check this section out if you want to ship logs using a custom provider: `Use docker logs with custom logging drivers`.

Execute the following playbooks only if you want to make Dockerd collect logs using a custom logging driver, e.g. fluentd (make sure to check-out the requirements in `Use docker logs with custom logging drivers`).

```
ansible-playbook -i $network/inventory/inventory.ini playbooks/setup_logging_capability.yml
```

> **Note**: AuRa does not handle well starting with multiple validating nodes. Set a single `mining_keyi=0` on first deployment. Then after some blocks (enough to sync), edit inventory to add more validating nodes and re-deploy execution.

First, set `ansible_user: "root"` in `$network/inventory/group_vars/all.yaml` to gain access for the first time. Then run:

```
ansible-playbook -i $network/inventory/inventory.ini playbooks/tasks/create_bootstrap_user_only.yml
```

Then, revert `ansible_user: "devops"` in `$network/inventory/group_vars/all.yaml`.

Now deploy everything from scratch

```
ansible-playbook -i $network/inventory/inventory.ini playbooks/deploy_devnet_from_scratch.yml
```

**3. Set bootnodes**

Grab execution node's endoes with command below and paste some of them into `$network/inventory/group_vars/all.yaml` to act as bootnodes in variable `eth1_bootnode_enode`

```
ansible-playbook -i $network/inventory/inventory.ini playbooks/tasks/collect_enodes.yml
```

Grab beacon node's ENRs with command below and paste some of them into `$network/inventory/group_vars/all.yaml` to act as bootnodes in variable `bootnode_enrs`

```
ansible-playbook -i $network/inventory/inventory.ini playbooks/tasks/collect_enrs.yml
```

Then re-deploy execution and beacon nodes to connect them

```
ansible-playbook -i $network/inventory/inventory.ini playbooks/tasks/start_beacon.yml
ansible-playbook -i $network/inventory/inventory.ini playbooks/tasks/start_execution_node.yml
```

- **6. Extra tooling**

* Deploy eth1 explorer
* Deploy eth2 explorer
* Deploy ethstats
* Deploy faucet
* Deploy landing page

- **7. Metrics Interpretation**

`beacon_head_slot`
MIN_GENESIS_TIME is the moment when the beacon chain will start, by this time all the beacon node shows latest logs, ideally all the beacon node should be nearly behind the maximum one and following. Until the genesis the head slot should be 0 after that should increase linearly. clock \* 5 metrics shows how many seconds are left until genesis will happen. Beacon started up if after genesis time the head slot increases, clock is increasing until 0.

`libp2p_peers`
amount of peers connected to the specific beacon chain, it is important that as much as possible peers get connected. If you do not have peers it means that beacon nodes are not communicating, in our case 12 is good 0 is bad.

`nethermind_blocks`
should increase nearly linearly, we expect the blockchain to produce one block each 5 seconds based on our configs. Blocks should keep increasing to demonstrate that the execution layer is working properly.

`nethermind_sync_peers`
every execution layer node must be peered and not lose connection.

`participation_rate`
it measures how effectively the beacon validators, those that validates transactions (not nodes, nodes just keeps the status of the blockchain) are participating in the consensus process, a good partecipation rate is between 90% and 100%.

- **8. beacon API docs**

https://ethereum.github.io/beacon-APIs/#/Node

# Debug tools

## Consensus head of all nodes

```
ansible -i denver/inventory/inventory.ini beacon -m shell -a "curl -s localhost:4000/eth/v1/beacon/headers/head | jq '.data.header.message.slot, .data.root'"
```

Print current head of each node, slot + root

```
denver-lighthouse-nethermind-05 | CHANGED | rc=0 >>
"476"
"0x2b29f765768332bebfd09c87d757bc0ccab0ec21c536583f4fe048c4fb33a62e"
denver-explorer-lighthouse-nethermind | CHANGED | rc=0 >>
"476"
"0x2b29f765768332bebfd09c87d757bc0ccab0ec21c536583f4fe048c4fb33a62e"
denver-lighthouse-nethermind-04 | CHANGED | rc=0 >>
"476"
"0x2b29f765768332bebfd09c87d757bc0ccab0ec21c536583f4fe048c4fb33a62e"
```

## Execution head of all nodes

```
ansible -i denver/inventory/inventory.ini execution -m shell -a "curl -s -X POST --data '{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"latest\"],\"id\":0}' http://localhost:8545 | jq '.result.number, .result.hash'"
```

Print current head of each node, slot + root

```
denver-lighthouse-nethermind-12 | CHANGED | rc=0 >>
"0x0"
"0x203e164cf3b6f6765abf2f0355a4d09e5eaf6a777243bc4407b569431cd95cb3"
denver-lighthouse-nethermind-11 | CHANGED | rc=0 >>
"0x0"
"0x203e164cf3b6f6765abf2f0355a4d09e5eaf6a777243bc4407b569431cd95cb3"
```
2 changes: 2 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ forks = 20
# timeout to something more suitable for the
# environment.
# gather_timeout = 10
#[ssh_connection]

#ssh_args = -o ServerAliveInterval=n
# Ansible facts are available inside the ansible_facts.* dictionary
# namespace. This setting maintains the behaviour which was the default prior
# to 2.5, duplicating these variables into the main namespace, each with a
Expand Down
Loading