DECENTR Testnet node setup

We’re doing another testnet, surprise, surprise 😉

This time we’re helping out the good folks over at DECENTR, which is an awesome project, definitely worth checking out if you don’t know it.

This guide is a compressed version of the original medium post by DEC, you can find that here, and information from the telegram channel and some additional touches by myself.

Get yourself an Ubuntu 20.04 VPS from your favorite VPS provider conforming to the minimum requirements. Start putty and connect with the information provided by your VPS provider.

Remember, pasting in putty is done with Right-Click of the mouse, copying you do by selecting the text with your mouse (nothing else, just selecting).

Ok, here we go:

  1. Update the system:
sudo apt-get update
sudo apt-get upgrade
  1. Install Go:
sudo apt install snapd
sudo snap install go --classic
export PATH=$PATH:/root/go/bin
echo 'export PATH=$PATH:/root/go/bin' >> ~/.bashrc
  1. Install Decentr testnet node:
sudo apt install git
git clone -b v1.1.0
cd decentr/
sudo apt install make
make install
  1. Initialize & configure your node:

Now we need to initialize the node, replace <NODE_NAME> below with a name of your choosing, just make sure it doesn’t have any spaces:

decentrd init <NODE_NAME>
  1. Change config.toml:
sudo nano ~/.decentrd/config/config.toml

find the seeds line down near the end of the document and replace it with this:

seeds = ",,,,"

Save and exit from nano (Ctrl-X and then Y). We’re almost done.

  1. Download the genesis.json:
wget -O $HOME/.decentrd/config/genesis.json

And start your node:

decentrd start

If everything went ok you should mostly see stuff like this:

It will take a little bit for the node to catch up, but that’s no problem. You can cancel the node with Ctrl-C and restart it with decentrd start again.

  1. To make things a bit easier you can also set the node up as a service:

First we’ll create the service file:

sudo nano /lib/systemd/system/dec_node.service

Paste this and save and exit again (Ctrl-X, Enter and Y):

Description=Decentr Testnet Node
ExecStart=/root/go/bin/decentrd start

Now all we need to do is enable and start it:

sudo systemctl enable dec_node
sudo systemctl start dec_node

To check if the service has started correctly use:

sudo journalctl -u dec_node.service -f

And that’s it. You’re running a Decentr testnet node. Make sure to check in the telegram channel regularly for any updates: DecentrBetaTesters & Node Runners

p.s. If you see your node crashing with this error:

This should be fixed in the current v1.1.0 version, so if it does occur please let the team know.

CONSENSUS FAILURE!!! module=consensus err="enterPrecommit: +2/3 prevoted for an invalid block: wrong Block.Header.AppHash.  Expected A0B2CF50C30F794BABAD5BD00BD5301F18F29EF000D4F01E4FA34D403DA301F8, got C69AB2F98B5A9BFE3466CC80847567715C9DB741359A3A3B78EC1FD7BA997255"

This is a know error, but will crash your node currently. To fix this you’ll need to reset your node and resync.

First, if you haven’t already, stop the node service:

sudo systemctl stop dec_node

Then reset the node:

decentrd unsafe-reset-all

If you get a ‘command not found’ error run the following again:

export PATH=$PATH:/root/go/bin
echo 'export PATH=$PATH:/root/go/bin' >> ~/.bashrc

Now we can start the node again and let it sync:

sudo systemctl start dec_node

p.p.s. here’s some useful links during testnet:

Leave a Reply