See https://docs.elrond.com/validators/install/how-to-use-the-docker-image
This is a simple setup for Docker and staying as close as possible to using the official scripts.
- Run multiply nodes
- Rootless container
- Autoupdate (containers are updated with the official scripts)
- Every start the containers updates itself if required
There is a docker healthcheck build in the Docker specification which checks for the latest release, that version is validated against the current official release. The healthcheck fails if its not the latest version, which forces docker to restart the node. So its a bit curious but the containers are updating themselves at startup. It is made to fit for Battle of the Nodes in mind, therefore supporting erasing databases etc which is controlled by the official Elrond scripts. This will not make it to the mainnet version.
Alternatives:
- https://github.com/mrz1703/elrond-node
- https://github.com/ElrondNetwork/elrond-go-scripts-v2 (official scripts)
- Have Docker and Docker Compose installed on your server: see https://docs.docker.com/install/
TL;DR for Ubuntu 18.04
apt install -y docker.io
systemctl start docker
systemctl enable docker
curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Execute the commands below. This will install the nodes in /opt/elrond-docker, if desired change the location.
cd /opt
sudo git clone https://github.com/MarkWillems/elrond-docker.git
cd elrond-docker
The data of all the nodes will be stored in the volumes subdirectory.
Run the command below to find out the correct architecure.
uname -m
Then set the ARCH variable in the file elrond-node/Dockerfile (x86_64 -> amd64, aarch64 -> arm64)
Run the command below to initialise your node the first time.
./script.sh setup
First enter the number of nodes you want to and their names, second add the github token if you got this.
It reuses the mechanisme of the official scripts, so it scans for an node-0.zip in the VALIDATOR_KEYS map. If you want to use your own keys than place the node-0.zip in the ./volume/node-name/VALIDATOR_KEYS directory, This directory is created in step 1. The key validatorKey.pem should be placed in this zip file named 'node-0.zip'
Start all the nodes
./script.sh start
Stop all the nodes
./script.sh stop
docker exec -it <node-name> ./termui
docker logs <node-name> --follow
docker restart <node-name>
./script.sh github
./script.sh rebuild
./script.sh rebuild
./script.sh clear