nimbus-eth2/docker/shared_testnet
Ștefan Talpalaru 476568ac59 add "--web3-url" option [skip ci] 2020-07-11 19:00:19 +03:00
..
Dockerfile shared_testnet: fix Dockerfile 2020-06-26 23:42:02 +02:00
Makefile new Docker image for shared testnets 2020-06-26 17:26:18 +02:00
README.md shared_testnet: more docs 2020-07-01 15:28:35 +02:00
altona_validators.sh docker/shared_testnet/altona_validators.sh 2020-06-29 17:22:36 +02:00
entry_point.sh add "--web3-url" option [skip ci] 2020-07-11 19:00:19 +03:00
validator_keys.sh Documentation; 'deposits create' can now ask for a private key 2020-07-10 18:18:14 +03:00

README.md

local testing

From the "nim-beacon-chain" repo (top-level dir):

make -C docker/shared_testnet NETWORK=witti build
mkdir tmp
docker run --rm --mount type=bind,source="$(pwd)"/tmp,target=/root/.cache/nimbus --name testnet2 statusteam/nimbus_beacon_node:testnet2 --build
ls -l tmp/nim-beacon-chain/build
docker run --rm --mount type=bind,source="$(pwd)"/tmp,target=/root/.cache/nimbus --name testnet2 -p 127.0.0.1:8008:8008 -p 9000:9000 statusteam/nimbus_beacon_node:testnet2 --run -- --metrics-address=0.0.0.0

# from another terminal
docker ps
docker stop testnet2

# when you're happy with the Docker image:
make -C docker/shared_testnet NETWORK=witti push

setting up remote servers

From the "infra-nimbus" repo:

git pull
make requirements
ansible-playbook ansible/nimbus.yml -i ansible/inventory/test -t beacon-node -u YOUR_USER -K -l nimbus-slaves[5:8]

# faster way to pull the Docker image and recreate the containers (this also stops any running container)
ansible nimbus-slaves[5:8] -i ansible/inventory/test -u YOUR_USER -o -m shell -a "echo; cd /docker/beacon-node-testnet2-1; docker-compose --compatibility pull; docker-compose --compatibility up --no-start; echo '---'" | sed 's/\\n/\n/g'

# build beacon_node in an external volume
ansible nimbus-slaves[5:8] -i ansible/inventory/test -u YOUR_USER -o -m shell -a "echo; cd /docker/beacon-node-testnet2-1; docker-compose --compatibility run --rm beacon_node --build; echo '---'" | sed 's/\\n/\n/g'

create and copy validator keys

Back up "build/data/shared_witti_0", if you need to. It will be deleted.

From the nim-beacon-chain repo:

# If you have "ignorespace" or "ignoreboth" in HISTCONTROL in your ".bashrc", you can prevent
# the key from being stored in your command history by prefixing it with a space.
# See https://www.linuxjournal.com/content/using-bash-history-more-efficiently-histcontrol

 ./docker/shared_testnet/validator_keys.sh 0xYOUR_ETH1_PRIVATE_GOERLI_KEY

start the containers

From the "infra-nimbus" repo:

ansible nimbus-slaves[5:8] -i ansible/inventory/test -u YOUR_USER -o -m shell -a "echo; cd /docker/beacon-node-testnet2-1; docker-compose --compatibility up -d; echo '---'" | sed 's/\\n/\n/g'

restarting the containers

Periodic rebuilds and restarts are implemented using Cron jobs on the servers:

10 0,6,12,18 * * * PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin'; cd /docker/beacon-node-testnet2-1; docker-compose --compatibility run --rm --name beacon-node-testnet2-1-build-run beacon_node --build; docker-compose restart -t 60

Just the restart, using Ansible (not normally needed):

ansible nimbus-slaves[5:8] -i ansible/inventory/test -u YOUR_USER -o -m shell -a "echo; cd /docker/beacon-node-testnet2-1; docker-compose restart -t 60; echo '---'" | sed 's/\\n/\n/g'