2020-06-26 02:44:24 +00:00
|
|
|
## local testing
|
|
|
|
|
2020-06-26 21:41:19 +00:00
|
|
|
From the "nim-beacon-chain" repo (top-level dir):
|
2020-06-26 02:44:24 +00:00
|
|
|
|
|
|
|
```text
|
2020-06-29 11:38:26 +00:00
|
|
|
make -C docker/shared_testnet NETWORK=witti build
|
2020-06-26 02:44:24 +00:00
|
|
|
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
|
2020-06-27 00:06:59 +00:00
|
|
|
|
2020-06-26 02:44:24 +00:00
|
|
|
# from another terminal
|
|
|
|
docker ps
|
|
|
|
docker stop testnet2
|
2020-06-27 00:06:59 +00:00
|
|
|
|
|
|
|
# when you're happy with the Docker image:
|
2020-06-29 11:38:26 +00:00
|
|
|
make -C docker/shared_testnet NETWORK=witti push
|
2020-06-26 02:44:24 +00:00
|
|
|
```
|
|
|
|
|
2020-06-27 00:08:15 +00:00
|
|
|
## setting up remote servers
|
|
|
|
|
|
|
|
From the "infra-nimbus" repo:
|
2020-06-26 21:41:19 +00:00
|
|
|
|
|
|
|
```text
|
|
|
|
git pull
|
2020-07-01 13:28:35 +00:00
|
|
|
make requirements
|
2020-06-26 21:41:19 +00:00
|
|
|
ansible-playbook ansible/nimbus.yml -i ansible/inventory/test -t beacon-node -u YOUR_USER -K -l nimbus-slaves[5:8]
|
2020-06-27 00:06:59 +00:00
|
|
|
|
2020-06-28 19:40:22 +00:00
|
|
|
# faster way to pull the Docker image and recreate the containers (this also stops any running container)
|
2020-06-28 02:38:11 +00:00
|
|
|
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'
|
2020-06-27 00:06:59 +00:00
|
|
|
|
|
|
|
# build beacon_node in an external volume
|
2020-06-26 21:41:19 +00:00
|
|
|
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'
|
2020-06-28 01:51:00 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### 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:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# 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
|
2020-06-27 00:06:59 +00:00
|
|
|
|
2020-06-28 01:51:00 +00:00
|
|
|
./docker/shared_testnet/validator_keys.sh 0xYOUR_ETH1_PRIVATE_GOERLI_KEY
|
|
|
|
```
|
|
|
|
|
|
|
|
### start the containers
|
|
|
|
|
|
|
|
From the "infra-nimbus" repo:
|
2020-06-27 00:06:59 +00:00
|
|
|
|
2020-06-28 01:51:00 +00:00
|
|
|
```bash
|
2020-06-28 02:38:11 +00:00
|
|
|
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'
|
2020-06-26 21:41:19 +00:00
|
|
|
```
|
|
|
|
|
2020-07-01 13:28:35 +00:00
|
|
|
### restarting the containers
|
|
|
|
|
|
|
|
Periodic rebuilds and restarts are implemented using Cron jobs on the servers:
|
|
|
|
|
|
|
|
```crontab
|
|
|
|
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
|
|
|
|
```
|
|
|
|
|
2020-07-14 01:01:23 +00:00
|
|
|
The same, using Ansible (not normally needed):
|
2020-07-01 13:28:35 +00:00
|
|
|
|
|
|
|
```bash
|
2020-07-14 01:01:23 +00:00
|
|
|
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 --name beacon-node-testnet2-1-build-run beacon_node --build; docker-compose restart -t 60; echo '---'" | sed 's/\\n/\n/g'
|
2020-07-01 13:28:35 +00:00
|
|
|
```
|
|
|
|
|