Skip to content

Run a Node

Nodes are computers or servers that run an application software known as clients to perform essential tasks on a blockchain network. These tasks can include transactions, block creation, consensus, network security, and other operational tasks for the network. The tasks and functionalities a node execute depend on the type of node, with each node having different system requirements and deployment processes. This section will provide details and information on how to run and maintain nodes on the XDC Network.

Masternodes

The XDC Network runs on a globally distributed system of masternodes that participate in a Delegated Proof of Stake (DPoS) consensus mechanism. To enhance network integrity and security, Masternodes are required to complete a KYC process and stake 10,000,000 XDC. Masternodes can be identified as “Validator” or “Standby” Masternodes.

Standby Masternodes

Standby Masternodes (or “Standby Nodes”) are identical in form and function to Validators but do not participate in validating transactions and block creation. These nodes are on standby to fill the role of Validators that drop from network participation.

To host an XDC Masternode/Standby node, there are specific prerequisites that you need to meet in terms of hardware, software, and staking requirements. Below is a detailed list:

Hardware Requirements

To ensure smooth operation and optimal performance of the XDC Masternode, the following hardware specifications are recommended:

  • Processor (CPU): 6 Core
  • Memory (RAM): Minimum 16 GB
  • Storage (SSD): At least 1TB SSD or NVMe (solid-state drive) to accommodate blockchain data
  • Network: Stable internet connection with at least 1 Gbps bandwidth (upstream and downstream)
  • Operating System: Ubuntu 22.04 LTS (recommended)

Software Requirements

Ensure that you have the following software and dependencies installed on your server before proceeding with the XDC Masternode setup:

  • Ubuntu OS (20.04/22.04 LTS)
  • Docker: A containerization tool for deploying and running the masternode environment
  • Golang (Go): For XDC node compilation and execution
  • Git: For cloning necessary repositories
  • Firewall: Properly configured firewall rules (allowing ports such as 30303)

Staking Requirements

To host an XDC Masternode, a certain amount of XDC tokens must be staked. This ensures that the node operator has a vested interest in the security and performance of the network.

  • XDC Token Stake: A minimum of 10 million XDC tokens is required to run a Masternode. These tokens must be locked in your Masternode wallet.

XDC Wallet Setup

You must set up an XDC wallet to manage your funds and staking:

  • XDC Wallet Address: A valid XDC wallet address is needed to stake and manage the 10 million XDC tokens.
  • Backup: Ensure that you have securely backed up your wallet’s private keys or seed phrase to avoid any loss of funds.

Setup XDC Masternode using Bootstrap Script

For Mainnet

Bootstrap Command for XDC Masternode Setup:

sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root

Examples: After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter “mainnet”.

$ sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
[sudo] password for user:
Please enter your XinFin Network (mainnet/testnet/devnet) :- mainnet
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as “Demo_Server.”
Your running network is mainnet
Please enter your XinFin MasterNode Name :- Demo_Server
Your Masternode Name is Demo_Server

For Testnet

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter “testnet”.

sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
Please enter your XinFin Network (mainnet/testnet/devnet) :- testnet
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as “test01”
Your running network is testnet
Please enter your XinFin MasterNode Name :- test01
Your Masternode Name is test01

For Devnet

After running the bootstrap command, the system will prompt you to specify the network. To connect to the Mainnet, simply enter “devnet”.

sudo su -c "bash <(wget -qO- https://raw.githubusercontent.com/XinFinOrg/XinFin-Node/master/setup/bootstrap.sh)" root
Please enter your XinFin Network (mainnet/testnet/devnet) :- devnet
Your running network is devnet
Next, you will be asked to input your XinFin Masternode name. Enter your desired Masternode name, such as “test01”
Please enter your XinFin MasterNode Name :- test01
Your Masternode Name is test01
Generate new private key and wallet address.
If you have your own key, you can change after this and restart the node
Type 'Y' or 'y' to continue:

How to Stake XDC on a Masternode/Standby node

Prerequisites

To stake XDC and run a masternode, you will need the following:

  • XDCPay, XinFin Web Wallet, or a hardware wallet (Trezor supported)
  • 10,000,000 XDC (mainnet tokens) or test XDC (for the Apothem testnet)
  • Your coinbase address (retrievable from your masternode)

Note: You do not need 10,000,000 XDC to run a node solely for RPC queries or accessing live data from the blockchain. This guide covers staking for masternode candidates.

Step-by-Step Process to Stake Your XDC Node

1. Access the Staking Platform

  • Visit XinFin Masternode page.
  • Select either the Mainnet (for real staking) or Apothem (for testnet staking).

2. Log In to Your Wallet

  • Click on the Login button on the masternode page.
  • You’ll be presented with multiple login options, including XDCPay, WalletConnect v2, Private Key/Mnemonic, Ledger Wallet or Trezor.
  • For this guide, we’ll use XDCPay:
  • Open XDCPay and ensure you are connected to either the Mainnet or Apothem network.
  • Log in to your wallet using XDCPay.

3. Become a Masternode Candidate

  • Once logged in, click the Become a Candidate button on the dashboard.
  • A new screen will appear where you will enter your KYC (Know Your Customer) information.
  • KYC Process:
    • Upload your required KYC documents (you can find downloadable templates linked in the form).
    • Once uploaded, the system will show a “KYC True” status, indicating your KYC has been approved.

4. Enter Your Coinbase Address

  • After completing KYC, input your Coinbase address. This address is specific to your masternode and can be retrieved by logging into your node.

5. Confirm and Apply for Staking

  • Click on Apply to stake your XDC and become a masternode candidate.
  • Your XDCPay wallet will prompt you to sign the transaction. Review the details and click Confirm.

6. Transaction Confirmation

  • After confirming, your staking transaction will be processed. Once successful, you’ll receive a notification in the bottom-right corner of the screen.
  • To verify the transaction, navigate to your XDCPay wallet, click on Transactions, and look for the Propose event. This event confirms your candidacy as a masternode.

Setup XDC Masternode/Standby node using One-Click Installer

Method 1: Setup XinFin’s XDC Masternode One-click Installer

To qualify for Masternode on XinFin Network, you need at least 10,000,000 XDC, for the long term.

Operating System:

  • Apple Mac
  • Windows
  • Linux - Ubuntu

Step 1:

Download XDC One-Click Installer (to setup Masternode) for Windows, Linux, and Mac OS and Install on your local machine.

Step 2:

Now Run the One Click Installer, Make sure you read the Terms properly then click on I Agree button.

  • “C:\Program Files\XinFin-Network” this will be your destination folder and this “C:\Users...\AppData\Roaming\XDCChain” will contain your Keystore folder.
  • Make sure, you create a backup of your Keystore folder.
  • Now click on “XinFin Network” One click installer.
  • You can see the address of One Click Installer in left side, Also you can change the Network.
  • For changing the Network, click on “Develop” then select “Network” (XinFin - Main Network/ XinFin Apothem Network)
  • You can check the Node status under the stats.xinfin.network

Step 3: Create a wallet for Masternode

  • Create your wallet address with Mnemonic Phrase or with Keystore. We always recommend to use Keystore for running a Masternode.
  • Enter a strong password while creating the wallet.
  • Don’t lose your Keystore file
  • Don’t share it with anyone
  • Always take a backup of your Keystore file.
  • If you lose it, all your funds will get locked.
  • After creating backup, Download your Keystore file.
  • Now Access your wallet with Keystore and enter a valid password properly to access your wallet.
  • If you are hosting a Masternode on Testnet then copy the Wallet address and paste it on XDC Faucet for the Testnet XDC

Step 4: Host your Masternode

  • For hosting the Masternode, you need to copy the private key and login the Masternode.
  • For uploading the KYC, click on the “Become a Masternode”
  • Check the KYC criteria, the KYC file should be in pdf format only.
  • Once you upload your KYC, you need to enter the “Coinbase Address” which is in One Click Installer after that click on Apply button.
  • Now you will be notify with sucessful toaster i.e “You have successfully applied for Masternode”
  • You can check all the status regarding your Masternode here: master.apothem.network.

Setup XDC Masternode/Standby node using Docker

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.

Operating System: Ubuntu 20.04 64-bit or higher

Should be facing internet directly with public IP & without NAT

Tools: Docker, Docker Compose(1.27.4+)

Setup (For Ubuntu 20.04 64-bit or higher Operating System)

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

Step 1: Clone repository

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

Step 2: Change directory

Then we change the directory to XinFin-Node

cd XinFin-Node

Step 3: Install docker

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:

node-sync

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:

img

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.

node_upgrade

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