Docker

From Veriblock Wiki
Jump to: navigation, search

Overview

This doc is to help you deploy Dockerized nodecore on Linux.

Public Docker Image Registry

Public Registry: https://hub.docker.com/u/veriblock
Latest NodeCore Image: https://docker.io/veriblock/nodecore

Pre-requisites

docker cli
root access
nc-cli

Deploying docker nodecore with bootstrap

  • DISCLAIMER: all of these commands are assuming you are the root user
  • DISCLAIMER: this will sync to a new wallet.dat file, for syncing your own local files without bootstrap go to the next section.
  • Make directory you want to mount the docker image to - for this example in these steps we will use /root/nc_data
mkdir -p /root/nc_data/mainnet
  • Download the bootstrap
wget -P /root/nc_data/mainnet https://mirror.veriblock.org/nodecore-bootstrap-501000.zip
  • Unzip the bootstrap
unzip /root/nc_data/mainnet/nodecore-bootstrap-501000.zip -d /root/nc_data/mainnet/
  • Add a nodecore.properties config and whitelist docker0 bridge, if this isn't added you cannot connect to nc with nc-cli
touch /root/nc_data/nodecore.properties
echo "rpc.whitelist.addresses=172.17.0.1" >> /root/nc_data/nodecore.properties
  • Start the docker container specifying the mount containing the bootstrap
docker run -d --name nodecore -v /root/nc_data:/data -p 7500:7500 -p 10500:10500 docker.io/veriblock/nodecore
  • Make sure your docker container is running
[root@host ~]# docker ps
CONTAINER ID        IMAGE                                                     COMMAND                 CREATED             STATUS              PORTS               NAMES
b073bb4d00e6        docker.io/veriblock/nodecore                                               "./nodecore -d /data"   51 minutes ago      Up 51 minutes                           nodecore
  • Validating that the Docker nodecore is syncing with docker logs
docker logs nodecore
  • Validating that Docker nodecore is syncing with the nodecore-cli
Run your nc-cli executable from your local directory "./nodecore-cli"
Run connect 127.0.0.1:10500 from the cli
Run getinfo

Deploying docker nodecore by mounting it to synced nodecore

  • Stop all running nodecore processes
  • Locate your directory with the data you would like to mount the image to (it will contain your mainnet folder and your nodecore.properties)
  • For this example we will use
/root/VeriBlock
  • Make sure you have rpc.whitelist.addresses=172.17.0.1 in your nodecore.properties file - This allows nc cli to connect to dockerized nodecore. If your directory is different than the example below please specify it in the command.
echo "rpc.whitelist.addresses=172.17.0.1" >> /root/VeriBlock/nodecore.properties
  • Start the docker container specifying the mount containing the directory
docker run -d --name nodecore -v /root/VeriBlock:/data -p 7500:7500 -p 10500:10500 docker.io/veriblock/nodecore
  • Connect with nc cli to validate that the docker image deployed correctly
Run your nc-cli executable from your local directory "./nodecore-cli"
Run connect 127.0.0.1:10500 from the cli
Run getinfo

Deploying docker nodecore to sync from scratch

  • Choose a directory to mount the docker image to - For this example we'll assume you're using
/root/VeriBlock
  • Add a nodecore.properties config and whitelist docker0 bridge, if this isn't added you cannot connect to nc with nc-cli
touch /root/VeriBlock/nodecore.properties
echo "rpc.whitelist.addresses=172.17.0.1" >> /root/VeriBlock/nodecore.properties
  • Start the docker image
docker run -d --name nodecore -v /root/VeriBlock:/data -p 7500:7500 -p 10500:10500 docker.io/veriblock/nodecore