How to Setup an ITALO Service Node

We have a automated Script That will install everything for you, it works only from Ubuntu 18.04+

Hey everyone, this is a quick tutorial on how to setup an Italo Service Node. We will try to make this as simple and easy to understand as possible. If you have any additional questions after this article, let us know so we can improve upon it, thanks!

Tutorial adapted from https://lokidocs.com/ServiceNodes/SNFullGuide/

Service Node Requirements

Table of Contents

  • Getting a Server
  • Prepare Your Server
  • Download Italo
  • Register Node
  • Check Registration
  • Getting a Server

Let’s get started. Choosing where to set up a Service Node is the biggest choice you will make when running a Service Node. There are a number of things to consider. Because you will be locking up funds for 6 weeks at a time, you will want to ensure that your server has:

  • A stable, relatively fast connection to be able to respond to ping requests to avoid being booted off the network
  • At Least a 50GB SSD or Hard disk drive, this will be used to store the block-chain.
  • A stable power supply. If your server goes down during the staking period, you may get kicked off the network, and not receive rewards while your funds are still locked for the remainder of the staking period.

Typically, the easiest and cheapest way to host a server outside of your home is to use a Virtual Private Server (VPS). There are thousands of options when it comes to VPS providers, but for now, just about anyone will do. Harrison and I have been using Digital Ocean and Vultr for all of our server needs and we would recommend their services. You can use our affiliate links to help support the project!

DigitalOcean: https://m.do.co/c/d05b21a8765f

Vultr: https://www.vultr.com/?ref=8162495-4F

Prepare Your Server

Every provider has a slightly different way of issuing you access to your new VPS. Most will send an email with the IP address, root username, and a root password of the VPS.

To access your server, you will need a SSH client for your operating system. Because we’re on Windows today, we’ll download PuTTY, Mac users can also use PuTTY. If you’re a Linux user, you probably don’t want us telling you where to get a SSH client from.

To connect to our VPS we will need to paste the IP address into the SSH client’s “Host Name (or IP address)” input box and click the “Open” button. The Port number can usually just be left as 22.

After connecting, a terminal window will now appear prompting for your log-in details, username(root) and password, which were provided by your VPS provider. When entering your password, nothing will visually appear in the terminal. This is normal. Hit enter when it’s typed or pasted, and you should be logged in to your VPS.

Next, we should update our package lists, the below command downloads the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

Run sudo apt update

You will notice a bunch of package lists were downloaded, once this is complete run the below command to fetch new versions of any packages we currently have installed on the system.

Run sudo apt upgrade

You will be prompted to authorize the use of disk space, type y and enter to authorize.

If you are prompted during the upgrade that a new version of any file is available then click the up and down arrows until you are hovering over install the package maintainer’s version and click enter.

Create a non-root User¶

Best practice when running a public server is to not run your software as the root user. Although it is possible to do everything as root, it is strongly recommended that you create a non-root user on our VPS by running the following command:

run adduser <username>

Replacing <username> with a name you will log-in with. For this user-guide we will use snode as our username.

run adduser snode

The terminal will prompt you for a new password for our newly created user. Use a secure password that is different from the root password.

Once the password has been set, the terminal will prompt you for a few details about the individual running the user. You can just hit enter through each of the inputs as the details are not important for the purposes of running a Service Node.

Once that’s done, run the following two commands to give our new account admin privileges and to change to such account.

usermod -aG sudo snode

su – snode

Before we proceed further, it is advised to close your terminal and reopen PuTTY to set up a saved session with our snode user. Your SSH client will have a load and save session function. For PuTTY we will need to type in our VPS IP address again, on the same screen type snode under “Saved Session”. Click on “Data” under the drop-down menu “Connection”, and type in snode (or your username defined before) into the input box “Auto-login username”. Go back to your session screen, where we entered the IP address, and click “Save”. You can load this session whenever you want to check on your Service Node.

Build Latest Italo

Run sudo apt install wget unzip

Then: sudo apt update && sudo apt install build-essential pkg-config libsqlite3-dev qttools5-dev libcurl4-openssl-dev libsystemd-dev libboost-thread-dev libgtest-dev libboost-serialization-dev libboost-program-options-dev libunbound-dev nettle-dev libevent-dev libminiupnpc-dev libunwind8-dev libsodium-dev libssl-dev libreadline-dev libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler python3

In Order to compile Italo you need at least g++-8 gcc-8

If you don’t have it just install it like so on Ubuntu 18.04

sudo apt-get install g++-8 gcc-8

Then you need to export it before you run make do it like so export CC=gcc-8 CXX=g++-8

Next: git clone --recursive https://github.com/italocoin-project/italo.git italo

Then: cd italo && git submodule init && git submodule update

Then

make release

Finally cd build/Linux/dev/release && mv bin ~/

Run Italo Service Node Daemon

After downloading, you can run Italo daemon directly in your terminal, but this is not a viable approach to running it as a service node: when you close PuTTY the program running inside it will also shut down.

Instead, we will configure the Italo daemon as a system service which makes it automatically start up if the server reboots, and restarts it automatically if it crashes.

Create the itnode.service file. Run
sudo nano /etc/systemd/system/itnode.service
Copy the text below and paste it into you new file
[Unit]
Description=italo service node
After=network-online.target
[Service]
Type=simple
User=snode
ExecStart=/home/snode/bin/italod --non-interactive --service-node --service-node-public-ip YOURSERVERSIP
Restart=always
RestartSec=30s
[Install]
WantedBy=multi-user.target

If you chose a username other than snode, then change snode in the User= and ExecStart= lines to the username you set.

Once completed, save the file and quit nano: CTRL+S -> X -> ENTER.

Reload the systemd manager configuration (to make it re-read the new service file).

Run sudo systemctl daemon-reload

Enable the itnode.service_ so that it starts automatically upon boot.

Run sudo systemctl enable itnode.service

Start the itnode.service.

Run sudo systemctl start itnode.service

Double check that all lines are exactly the same.

The daemon will now start syncing. You won’t be able to do much if it hasn’t synced.

To watch the progress at any time you can use the following command (hit Ctrl-C when you are done watching it). You should see it syncing the blockchain:

sudo journalctl -u itnode.service -af
Alternatively you can ask the daemon to report its sync status using the following command:

~/bin/italod status

Service Node Registration

Let’s get your service node registered! Grab your address from the wallet you would like to be rewarded.

Run ~/bin/italod prepare_registration

Follow the prompted information and when you are finished you will be outputted a command shown here register_service_node ...

Copy that command and paste that into your wallet command line with the necessary funding.

Check your SN key on the explorer.

To get your key run ~/bin/italod print_sn_key

If you want more a detailed Service Node status, you can use the follow command: ~/bin/italod print_sn_status
Twitter
Discord