Skip to main content

Smartnode Setup

note

For the following part of the guide you need to be root. depending on your VPS provider they may have only provided you with a "sudo" user. You can change to root by doing:

sudo su

Guide

1. Update Server

apt update && apt upgrade -y
apt install unzip fail2ban -y
Unzip is required to unpack the bootstrap.

2. Add 4GB of SWAP

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

free -h
note

If no swap it will return:

Swap:            0B          0B          0B

Create SWAP and Activate:

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

3. Enable UFW & Open Ports

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

4. Configure Fail2Ban

As I am not bothering with setting up SSH login with keys rather then password based login need to keep something from the bots and kiddies brute forcing our SSH service.

Setup jail for bad guys hitting SSH, and set it to ban after three failed logins to SSH:

nano /etc/fail2ban/jail.local

Copy and paste the following into the file:

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

Reboot the server:

reboot

Add a system user to run yerbasd:

adduser <username_here>

Get Yerbas wallet / daemon and bootstrap:

wget https://github.com/The-Yerbas-Endeavor/yerbas/releases/download/v3.1.2.6/yerbas-ubuntu20-v3.1.2.6.tar.gz
tar -xvf yerbas-ubuntu20-v3.1.2.6.tar.gz
mkdir ~/.yerbascore && touch ~/.yerbascore/yerbas.conf
echo "daemon=1" >> ~/.yerbascore/yerbas.conf
cd .yerbascore
wget https://github.com/The-Yerbas-Endeavor/yerbas/releases/download/v3.1.2.6/powcache.dat
cd ~/yerbas-build
./yerbasd
Info

You should see Yerbasd server starting. You can confirm it is running top -c it will be using 100% CPU (1 core). This shows you it is working, we will return to it later.

Local Wallet Setup

note

This part of the guide is to get your local wallet or control wallet setup. If you already have Yerbas core wallet running you can skip to next section.

1. Install and Sync Local Wallet:

For this step, you will need the YerbasCore wallet installed.

Follow our YerbasCore Wallet guides for detailed instructions on how to do this.

To speed up the synchronization, use our POWCache or Bootstrap packages: Using Powcache & Bootstrap

Grab bootstrap from github release and unpack in the above directory (highly recommended as reduces sync time drastically)

note

If you already have a Yerbas wallet remove the following folders before using the bootstrap (make sure wallet is closed before using bootstrap) blocks chainstate evodb llmq To use the bootstrap right click > unzip. Copy contents to the new directory you created above.

  • Start wallet and let it finish syncing.
  • Encrypt wallet (Settings > Encrypt Wallet)
  • Create new receiving address
  • Backup wallet.dat (File > Backup Wallet). Store in multiple locations.
  • Dump private key for receiving address (this should be printed and stored offline in multiple locations):
walletpassphrase password time (in seconds)
dumpprivkey "address" (address is the receiving address you sent the 28000 YERB to)
  • Send 28,000 YERB to self (this is current collateral amount)
  • Wait for 2 confirmations
note

The private key only allows you to restore the matching receiving address. If you setup multiple nodes you should dump the private key for each collateral receiving address.

2. Build protx command for control wallet

Here is an example protx quick_setup command:

d7898f44c6bdc39a49b0917d5c6bcb61455270ddb9e7eb1168a6b745434daf26 1 194.113.73.87:15420 yaDfcdCupB1T5YoVRjYr8fXCvB8U5AuNX8

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.
  • Your smartnode server IP and port. Replace example IP with your Smartnode server IP, leave port as is.
  • Fee address: This is any address in your wallet which contains enough YERB to pay the fee (cannot be the address which you sent the 28,000 YERB to). When you enter the protx quick_setup command it is a transaction and needs to be paid for. It is a very small amount 1/2 an YERB is more than enough. In Debug console do "listaddressbalances" to show all addresses with a balance, choose one and replace address in example command.
info

Enter the protx quick_setup command in Debug console. This will create a .conf file for that node in the same directory you ran the wallet from. Open it and copy the contents.

Final steps

Back to the smartnode server:

~./yerbas-cli stop
nano ~/.yerbascore/yerbas.conf

Paste in what you copied from the .conf file made during the protx command, save and exit.

When done with this, run yerbasd from the terminal:

~/./yerbasd

When this is done, wait a couple minutes until running ~/./yerbas-cli smartnode status to check the status of your smartnode. This should return: Ready Ready

Success!

Your Smartnode should now be running!

Video guides