Smartnode Setup

1: Switch to root user, update your server and install Unzip and fail2ban.

Copy

sudo su

Copy

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

2: Add a swap file

See if there's already a swap file:

Copy

swapon --show

If there's no output, it means there is no active swap file. Let's create a swap file:

Copy

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

3: Secure server: Enable UFW, open ports

Copy

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

4: Secure server: Enable UFW, open ports

Open the fail2ban configuration file

Copy

sudo nano /etc/fail2ban/jail.local

Copy and paste the following:

Copy

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

With these settings, Fail2Ban will be active for SSH, monitoring the specified log file for failed login attempts, and after three unsuccessful attempts from the same IP address, it will take appropriate action to block that IP. Next, you will reboot your server:

Copy

reboot

5: Add a system user, create a Keymaker Directory and download the latest daemon

Create a system user:

Copy

sudo adduser new_username

Copy

sudo su new_username

Download and unzip the latest Keymaker daemon:

Copy

mkdir Keymaker

Copy

cd Keymaker

Copy

wget https://github.com/keymakercoin/keymakercoin/releases/download/2.0.0.1/keymaker-win-2.0.0.01-mainnet-.zip

Copy

unzip keymaker-win-2.0.0.01-mainnet-.zip

Copy

sudo chmod +x keymakerd keymaker-cli

Copy

mkdir ~/.keymaker && touch ~/.keymakercore/keymaker.conf

6: Setup wallet locally

This section of the guide is dedicated to setting up your local wallet or control wallet for Keymaker. If you already have the Keymaker wallet running, you may proceed to the next section.

  • Download the latest Keymaker wallet on Github: https://github.com/Keymakercoin/Keymakercoin/releases

  • Begin by opening the wallet and allowing it to complete the syncing process.

  • Next, secure your wallet by encrypting it through the "Settings" menu and selecting "Encrypt Wallet."

  • Generate a new receiving address within the wallet.

  • It is crucial to create a backup of your wallet.dat file. To do this, navigate to "File" and choose "Backup Wallet." Make sure to store this backup in multiple secure locations.

  • Send 600,000 Keymaker to self (this is the current collateral amount for Keymaker masternodes).

  • Wait for 1 confirmation to complete the transaction.

7: Build protx command within your wallet

Below is an example of what the protx quick_setup command should look like. You can copy the example below into a Notepad and edit it with your values.

Copy

protx quick_setup "cfc14de1e1cbe2bf619a6d152a0ade2e4841b6df8817327bbdf8f69e868a553c" "0" "192.168.10.1:2421" "kJ4XMMYGem8AV36yyojdiMfVAp9kEueTmq"

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 the example.

Collateral index: Go to "Tools" > "Debug console." Type "smartnode outputs" to check if it's 1 or 0. Adjust the example command if needed.

Your smartnode server IP and port: Replace the example IP with your Smartnode server. Keep the port as 2421.

Fee address: This should be any address in your wallet that contains enough KEYM to pay the fee (cannot be the address to which you sent the 600,000 KEYM). When you enter the "protx quick_setup" command, it is considered a transaction and requires a small fee. 0.005 KEYM is enough. In the Debug console, use "listaddressbalances" to display all addresses with a balance, choose one, and replace the address in the example command.

  • Execute the "protx quick_setup" command within the Debug console. This action will generate a .conf file for that specific node in the directory where the wallet is currently located. Open the file and copy its contents for further use.

8: Complete Smartnode configuration on VPS

Now we will move our configuration over to our server.

Copy

~/.keymaker-cli stop
nano ~/.keymakercore/keymaker.conf

Paste the contents you copied from the .conf file generated during the execution of the "protx" command. After pasting, save the changes and proceed to exit the file.

Start your daemon:

Copy

~/./keymakerd  

To see if your Smartnode is running successfully, run:

Copy

~/./keymaker-cli smartnode status

Last updated