Developers Forum for XinFin XDC Network

Cover image for [Solved] Masternodes not Gaining Peers
s4njk4n
s4njk4n

Posted on

[Solved] Masternodes not Gaining Peers

Current Issue:

After deploying XDC Masternodes, the blockchain slowly downloads but no peers will connect for any protracted period of time. This has been tested for up to a month and peers remained at 0-1.

No Peers!

To test, we deployed nodes at several different data-centres in different cities with the same result.

ufw was not enabled on mainnet testing nodes and probing ports with nmap revealed that port 30303 was open.

Port 30303 open

How XDC nodes acquire peers:

On starting an XDC node, it initially connects to the peers listed in the bootnodes.list file on your node. The node can then use these peers to find new peers, as well as being discoverable for incoming connections on port 30303.

(Port 30303 is used by mainnet nodes for peer-to-peer networking and node discovery. Note that for the Apothem testnet, this process occurs via port 30304).

bootnodes.list file

The cause of the current issue:

The current inability for new nodes to find peers is caused by an issue with the nodes listed in the current version bootnodes.list file.

The solution:

A solution to this is to replace the bootnodes.list file with a working one. Through developer channels, we have obtained a new bootnodes.list file and have made it accessible to others on our GitHub which is accessed in the solution detailed below.

To implement the solution, start by first connecting to your XDC node server. Remember to replace root in this command with your actual username for the remote server, replace 22 with the actual ssh port number you are using, and replace ip.address with the actual IP address of the remote server:

ssh -lroot -p22 ip.address
Enter fullscreen mode Exit fullscreen mode

Change to the mainnet directory containing the bootnodes.list file:

cd ~/XinFin-Node/mainnet
Enter fullscreen mode Exit fullscreen mode

Stop your node:

./docker-down.sh
Enter fullscreen mode Exit fullscreen mode

Backup your bootnodes.list file by renaming it:

mv bootnodes.list oldbootnodeslist
Enter fullscreen mode Exit fullscreen mode

Download an updated bootnodes.list from our GitHub:

wget -O bootnodes.list "https://raw.githubusercontent.com/s4njk4n/Fix-bootnodes-list/main/bootnodes.list"
Enter fullscreen mode Exit fullscreen mode

Restart your node:

./docker-up.sh
Enter fullscreen mode Exit fullscreen mode

Logout of your node:

logout
Enter fullscreen mode Exit fullscreen mode

Now just wait a little while and then check your node and its peers on either:
The XinFin Network Stats site
or
The XDC Foundation Network Stats site

Congratulations! You should see your peer count climbing normally now.


In case of any technical queries on XDC Network, feel free to drop your queries on XDC.Dev forum.

Quick links:

XinFin.org
XDC Chain Network Tools and Documents
XDC Network Explorer
XDC Dev Forum
Beta — XDC Web Wallet
XDC faucet
XDC faucet - Blocksscan

XinFin — XDC Social Links:

Twitter
GitHub
Telegram
Facebook
LinkedIn
YouTube


Discussion (3)

Collapse
lucksin3 profile image
lucksin3

Awesome Article!!

As an update, an updated bootnode list was merged which should have all the correct bootnodes to getting peers.

github.com/XinFinOrg/XinFin-Node/b...

So by default when a new node is deployed using the official GitHub link: github.com/XinFinOrg/XinFin-Node/t..., the user should see greater number of peers by default.

Collapse
s4njk4n profile image
s4njk4n Author • Edited on

Hi lucksin

Just following up on my last reply.

Yes I can confirm that the current bootnodes.list file is definitely not working. The new node tested still didn't pick up any peers after many hours. Replaced it with the one I've posted on my GitHub and it was fixed near instantly started picking up peers. After even just a short time it was already up to 10 peers.

The one in the official node repo main branch is still not working

Collapse
s4njk4n profile image
s4njk4n Author

Thanks lucksin

The bootnodes.list file on the official github main branch says it was updated last month. We’ve still been encountering the issue within the last 1 week on new nodes (hence the article above). Is the current official GitHub file working presently on your new deployments?

The bootnodes.list file I’ve included in the article above definitely solved the issue for us.

Will do another test run shortly and let u know if we’re still encountering the issue