Docker Installation
ARK Nodes execute many query intensive operations. The most cost-effective approach for running a high-performance node is choosing SSD over HDD. Increasing the total RAM improves cache performance.
Prerequisites to be installed
Install Docker Community Edition
On a fresh OS installation, follow these steps:
Install Docker CE - Ubuntu / Debian
- Preferably use latest stable OS version!
- Uninstall old versions:
1sudo apt-get remove docker docker-engine docker.io containerd runc
- Install prerequisites:
1sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
- Add Docker’s official GPG key:
1curl -fsSL https://download.docker.com/linux/$(grep "^ID=" /etc/os-release | cut -d\= -f2)/gpg | sudo apt-key add -
- Add Docker’s official repository:
1sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(grep "^ID=" /etc/os-release | cut -d\= -f2) $(lsb_release -cs) stable"
- Install Docker CE:
1sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io
- Make Docker usage as a
non-root
user possible:
1sudo usermod -aG docker ${USER}
You’ll have to logout and login again or just open another session in order to activate the last step.
Install Docker CE - CentOS
- Preferably use latest stable OS version!
- Uninstall old versions:
1sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
- Install prerequisites:
1sudo yum install -y yum-utils device-mapper-persistent-data lvm2
- Add Docker’s official repository:
1sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- Install Docker CE:
1sudo yum install docker-ce docker-ce-cli containerd.io
- Start Docker CE:
1sudo systemctl start docker && sudo systemctl enable docker
- Make Docker usage as a
non-root
user possible:
1sudo usermod -aG docker ${USER}
You’ll have to logout and login again or just open another session in order to activate the last step.
Install Docker Compose
Docker Compose Install (Ubuntu / Debian / CentOS Latest Stable Releases)
1sudo curl -sL "https://github.com/docker/compose/releases/download/`curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/docker/compose/releases/latest | sed 's#.*tag/##g' && echo`/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
Using Official ARK Core Docker Image
Getting the Needed Files
1mkdir mainnet &&2cd mainnet &&3curl -sOJ https://raw.githubusercontent.com/ArkEcosystem/core/master/docker/production/mainnet/docker-compose.yml &&4curl -sOJ https://raw.githubusercontent.com/ArkEcosystem/core/master/docker/production/mainnet/mainnet.env
Running the Node
For normal Node operation, make sure TCP port 4001 is accessible from outside.
- If you prefer ARK Core settings other than defaults, please make your changes prior running the Core
(file=mainnet.env)
Starting the Relay
1docker-compose up -d
If you prefer to use custom DB Name, DB User and DB Password simply adjust variables
POSTGRES_PASSWORD
,POSTGRES_USER
,POSTGRES_DB
(file=docker-compose.yml)
andCORE_DB_PASSWORD
,CORE_DB_USERNAME
andCORE_DB_DATABASE
(file=mainnet.env)
correspondingly.
-
In case you want to use a remote PostgreSQL server simply adjust variable
CORE_DB_HOST
in yourmainnet.env
and run only Core container:
1docker-compose up -d core
Troubleshooting
- Make sure your containers are up and running:
1docker ps -a --format "table {{.Names}}\t{{.Status}}"
You should see something similar to:
1NAMES STATUS2core-mainnet Up 4 minutes3postgres-mainnet Up 4 minutes
- If some of the containers status is not
Up
, check docker logs:
1docker logs core-mainnet
1docker logs postgres-mainnet
Maintenance
Monitoring Relay Logs
1docker logs --tail 50 core-mainnet -f
Update
CLI
Docker Live Updates Are Now Possible With- As a preliminary step, installation of development tools is necessary (only needed once, when doing initial update):
1docker exec -it core-mainnet sudo apk add make gcc g++ git python
- We are all set! Run the update and follow instructions:
1docker exec -it core-mainnet ark update
Updates and all changes made to the containers are kept even on container or host restart.
Update is also possible by destroying and running Core container from scratch, so it downloads the latest image
Make sure you destroy only Core container in order to keep your database and avoid syncing the blockchain from zero block. The commands example below does it.
1cd mainnet2docker stop core-mainnet3docker rm core-mainnet4docker rmi $(docker images -q)5docker-compose up -d core
FAQ
How Do I Start With Empty DB?
Just execute the following code:
1docker-compose down -v2docker-compose up -d
How Do I Start Everything from Scratch?
Just stop and trash all containers and images:
1docker stop $(docker ps -aq)2docker rm $(docker ps -aq)3docker rmi $(docker images -q)4docker volume prune -f5docker network prune -f