Table of contents

There are different ways you can setup your Smartnode:

  • Regular Setup: Setup as per this doc which has the option of a script or manual instructions at the bottom of this doc.
  • dk808 Script: Does the majority of the VPS setup for you, has healthcheck, bootstrap, and add as a service. Only tested on Ubuntu 20.
  • Docker: Quick and easy setup, health check built in, bootstrap option built in. Maintained by Tri, the Raptoreum lead developer.

Smartnode Requirements

  • A VPS with a IPv4 (static) address. At least 1 CPU core, 2GB ram, and 75GB storage. Ubuntu 20 and 22 currently supported.
  • 1.8 million RTM.
  • A fully synced Raptoreumcore wallet.
  • 30-60 minutes of your time.

NOTE: Have your VPS and be logged into it before you start this setup. You also need to know the public ipV4 address. You can get the ipV4 address once logged in by doing:

curl -s ifconfig.me

Collateral Wallet Setup

  • Make sure you have Raptoreumcore fully synchronized.
  • Create a receiving address, labelling it is a good idea, for example Smartnode 01.
  • Send 1.8 million to the address you just created.
  • STOP. I am assuming you have your wallet encrypted, if not you should do that. Also make a backup of the wallet now. File > Backup wallet.
  • Now go to your Transactions page and right click on the transaction you just made. Record the transaction ID.

Build The Protx Command

Now we need to build the command (protx) that will register your smartnode on the network. It will also provide you with your BLS private key which you need for the smartnode setup.

Here is what the protx command looks like:

protx quick_setup "collateralHash" "collateralIndex" "ip:Port" "feeSourceAddress"
  • Collateral Hash: This is the transaction ID you recorded.
  • Collateral Index: This will be "1".
  • ipandport: You should already know your Ip, port will be 10226, for example:
127.0.0.1:10226
  • Fee source address: This must be an RTM address which holds a small amount of RTM to cover the protx transaction. It must be a address from your wallet and it should not be your collateral address. In Window > Console type:
listaddressbalances

Pick an address with a bit of RTM, keep in mind it takes less than 1 RTM for a transaction, you don't need much.

Full protx quick_setup Command Example:

protx quick_setup "8e33a683600f710ecd87f8dcac00c290dd3e017d60f65a526bd12bcdd312e239" "0" "69.420.420.69:10226" "rdS8kMCm2DReiVN4sCi13hucC6aZAzipxT"

Record the operatorSecret, this is the BLS private key you need for your Smartnode VPS setup.

Smartnode VPS Setup (script)

I have created a script which takes care of the VPS setup, it will ask you a couple of question when you run it. If you are not sure answer "y". Have your BLS private key ready. You must be logged in as root to run the script. Some providers such as OVH provide a sudo user instead. To switch to root account do:

sudo su

Run the Smartnode install script:

wget https://raw.githubusercontent.com/lorne-rtm/smartnode-installer/main/smartnode-installer.sh -O smartnode_setup.sh && chmod +x smartnode_setup.sh
./smartnode_setup.sh

0:00
/1:51

Manual Smartnode VPS Setup

You said you wanted to get your hands dirty...

Update OS and install fail2ban:

apt update && apt upgrade -y
apt install fail2ban -y

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

free -h

If no swap it will return:

Swap:            0B          0B          0B

Create SWAP, activate, and set sensitivity (swappiness):

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

Configure UFW:

ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 10226/tcp
ufw enable

Configure fail2ban to protect SSH:

nano /etc/fail2ban/jail.local

Add this:

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

Restart fail2ban:

systemctl restart fail2ban

Add a system user to run the Smartnode under:

adduser <username_here>
su - <username>

Get bootstrap (if you prefer to sync from scratch skip this):

mkdir .raptoreumcore && cd .raptoreumcore
wget -qO- https://bootstrap.raptoreum.com/bootstraps/bootstrap.tar.xz | tar -xzv

Create raptoreum.conf:

nano .raptoreum.conf

Add this to the .conf:

externalip=your_server_ip:10226
rpcuser=replaceme
rpcpassword=replaceme
rpcallowip=127.0.0.1
server=1
dbcache=1024
listen=1
addnode=lbdn.raptoreum.com
rpcport=8484
daemon=1
#smartnodeblsprivkey=

Get latest release:

cd ~
mkdir rtm-latest && cd rtm-latest
wget -qO- https://url-of-latest-release | tar -xzv

Note: To get latest release URL go to the Raptoreum github page and check for latest release on the right side, click it. At the bottom of the release right click the release that matches your server operating system and Copy link address. Use that link in the wget command above.

Start raptoreumd:

./raptoreumd

Give it a couple of minutes and confirm it is running with:

./raptoreum-cli getblockcount

Now you need to go setup collateral and build the protx command, see here: https://learn.raptoreum.com/smartnode-setup/#collateralwalletsetup

Record the operatorSecret, this is the BLS private key you need to complete your Smartnode VPS setup.

Check to see if raptoreumd blockcount matches the explorer (called "Heights" on explorer):

~/rtm-latest/./raptoreum-cli getblockcount

If raptoreumd and explorer are within 5 of each other proceed to next step, if not wait until they are.

Stop raptoreumd:

~/rtm-latest/./raptoreum-cli stop

Add BLS private key to your raptoreum.conf:

nano ~/.raptoreumcore/raptoreum.conf

Delete the # at the start of smartnodeblsprivkey= and add the key after the = (no space).

Start raptoreumd and check smartnode status copy and all 3 lines:

~/rtm-latest/./raptoreumd
sleep 20
~/rtm-latest/./raptoreum-cli smartnode status

If all went according to plan you should see "READY" "READY" for the return. Your Smartnode is operational!