Full Node (Docker version)

We are going to follow these steps to set up an XDC Masternode.

Setting up XDC Network Masternode Docker version

The server or VPS used for the masternode should be directly facing the internet with a public IP and without NAT.

Follow the written steps starting from step 1, or you can watch the video tutorials:

Setting up an XDC Network Masternode via Docker

Step 1

Clone repository

git clone https://github.com/XinFinOrg/XinFin-Node.git

Step 2

Then we change the directory to XinFin-Node

cd XinFin-Node

Step 3

We need to install Docker and Docker-Compose by running the following command:

sudo ./setup/install_docker.sh

Step 4

Create a new .env file and copy the env.example file that exist in the mainnet directory. We will ensure we are in the "mainnet" directory by typing these commands. Once in edit mode for the .env file, name your masternode and use an email address in the respective fields

cd mainnet
cp env.example .env
nano .env                                                            

For Testnet

cd testnet
cp env.example .env
nano .env 

Step 5

Start your Node

For Mainnet run the following commands:

cd mainnet
sudo docker-compose -f docker-compose.yml up -d

At this point you should be able to see your masternode on the list of nodes here or as shown below:

For Testnet run the following commands:

cd testnet
sudo docker-compose -f docker-compose.yml up -d

You should be able to see your node listed on the [Apothem Network] page. Select "Switch to LiveNet" to check LiveNetwork Stats and Select "Switch to TestNet" for TestNetwork.

Your coinbase address can be found in xdcchain/coinbase.txt file.

For troubleshooting purposes, you can stop the node by using the following command on either Mainnet or Testnet:

sudo docker-compose -f docker-compose.yml down

Downloading a Network Snapshot (Mainnet or Apothem)

The following steps are to expedite the syncing process of your node with the XDC Network. If you followed the steps above, your node will take 3-4 days to sync up with the network fully. You can reduce that time by downloading a network snapshot and bringing your node back up after the chain has been downloaded and unpacked.

Mainnet Snapshot

Bring down your node:

sudo docker-compose -f docker-compose.yml down

Remove the old xdchain file from the server

rm -rf xdcchain.tar

Download the snapshot

wget https://download.xinfin.network/xdcchain.tar

Unpack the xdcchain.tar file

tar -xvzf xdcchain.tar

The unpacking will take some time, and it will look like this:

The following command will move the xdcchain/XDC to xdcchain/XDC_backup

mv  xdcchain/XDC xdcchain/XDC_backup
mv XDC xdcchain

Then we are going to remove the old "nodekey" file

rm -rf xdcchain/XDC/nodekey

The last step is to run the bash upgrade.sh command

bash upgrade.sh

This command will bring your node up and it will start syncing to the network. Once up and running, your node will be synced to the network in just a few minutes.

Apothem Snapshot

Bring down your node:

sudo docker-compose -f docker-compose.yml down

Remove the old xdchain file from the server

rm -rf apothem.tar

Download the snapshot

wget https://download.apothem.network/apothem.tar

Unpack the apothem.tar file

tar -xvzf apothem.tar

Move the xdcchain-testnet

mv XDC xdcchain-testnet

Bring up the node

sudo docker-compose -f docker-compose.yml up -d

Last updated