Skip to content

MarkWillems/elrond-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning, there seems to be an official docker container these days.

See https://docs.elrond.com/validators/install/how-to-use-the-docker-image

Elrond Docker

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:

How to use

Prerequisites

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

Installation

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.

1. Configure your nodes

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.

1.1 Import existing key

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'

2.Running

Start all the nodes

./script.sh start

Other commands

Stopping of all nodes

Stop all the nodes

./script.sh stop

How to open termui of Elrond to get some stats of your node

docker exec -it <node-name> ./termui

How to see the logging of a node?

 docker logs <node-name> --follow

How to restart a node?

 docker restart <node-name>

(re)set the github token

./script.sh github

Rebuild the container images

./script.sh rebuild

Clear all nodes data and force a fresh start

./script.sh rebuild
./script.sh clear

About

A docker approach to run Elrond nodes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published