How to activate smartnodes on Linux VPS

1. Update the server

sudo apt update && sudo apt upgrade -y

2. Add 2GB of SWAP

First check to make sure there is not already swap active:

free -h

If the return is 0, you should create and activate the SWAP.
Swap: 0B 0B 0B

Create SWAP and Activate (only if required):

sudo dd if=/dev/zero of=/swapfile bs=1k count=2048k
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo echo "/swapfile swap swap auto 0 0" | tee -a /etc/fstab
sudo sysctl -w vm.swappiness=10
sudo echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf

The return of the echo should be: swappiness = 10

3. Enable firewall & open ports

First check to make sure there is not already swap active:

apt install ufw -y
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 15168/tcp
ufw enable

4. Install Fail2Ban

sudo apt install fail2ban -y
sudo nano /etc/fail2ban/jail.local

Copy and paste the following config into the file:

[sshd]
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry = 3

Restart fail2ban:

sudo systemctl restart fail2ban

Reboot the server:

sudo reboot

5. Bitoreum daemon

You can monitor the activity of the daemon with this command:
mkdir
btm_latest

cd btm_latest
# download latest daemon
wget https://github.com/bitoreum/bitoreum/releases/download/v2.3/bitoreum-v2.3-linux.tar.gz
tar -xvf bitoreum-v2.3-linux.tar.gz

# create config file
cd ..
mkdir ~/.bitoreumcore && touch ~/.bitoreumcore/bitoreum.conf

# set executing permission
chmod +x ~/btm_latest/bitoreum-v2.3-linux/./bitoreumd

# sync with the network
~/btm_latest/bitoreum-v2.3-linux/./bitoreumd --daemon

6. Collateral address

Open your LOCAL wallet.
Create new receiving address.
Send 1,250,000 BTRM to the new receiving address.
Wait transaction confirmation

7. Build protx command for control wallet

Enter the protx command in the Debug console of YOUR LOCAL wallet. This will create a .conf file for that node in the same directory you ran the wallet from.

protx quick_setup [Transaction ID] [Collateral index] [Smartnode server IP:15168] [Fee address]

The structure from left to right is:

  • Transaction ID
    In your wallet go to “Transactions” right click the one you sent yourself earlier and “Copy Transaction ID”. Replace the Transaction ID in example.
  • Collateral index
    Tools > Debug console. Type smartnode outputs to check if 1 or 0. Adjust example command if needed.
  • Smartnode server IP:15168
    Replace example IP with your Smartnode server IP, leave port as is.
  • Fee address
    This is any address in your wallet that contains enough BTRM to pay the fee (cannot be the address to which you sent the 600,000 BTRM). When you enter the protx quick_setup command it is a transaction and needs to be paid for. It is a very small amount of -0.00000479 BTRM. In Debug console do “listaddressbalances” to show all addresses with a balance, choose one, and replace the address in the example command.

Example:

protx quick_setup "c4bbcde9771668fa640c2654gdff688b0f039f7b684e715d92e4012369fea6" "1" "195.222.183.93:15168" "Brxev94ZfueciwVVpHLMdqFayaXAS4sBxP"

 

8. Configure the smartnode

# Stop daemon
~/btm_latest/bitoreum-v2.3-linux/./bitoreum-cli stop

# wait until the daemon is stopped, use top to monitor the processes

# Open .conf file
nano ~/.bitoreumcore/bitoreum.conf

# Paste the configuration from the step 7

# Start the daemon
~/btm_latest/bitoreum-v2.3-linux/./bitoreumd

Wait few minutes and validate the smartnode status:

~/btm_latest/bitoreum-v2.3-linux/./bitoreum-cli smartnode status
How to activate smartnodes on Linux VPS