Stakenet (XSN) TPoS on your own VPS

hydranet I German
11 min readApr 1, 2020

Hello and welcome to a Stakenet tutorial! In this up to date-guide, I will explain step by step how to set up Stakenet’s XSN TPoS (Trustless Proof of Stake) on a local Windows wallet with a Linux VPS (Ubuntu).

I. Disclaimer
II. Rent a VPS server
III. Set up your local Windows Stakenet Wallet
IV. Set up your VPS server
V. Install XSN-Core at your VPS
VI. Set up your own TPoS contract at your VPS

I. Disclaimer

1. This guide only works if the XSN wallet for the local wallet and the VPS wallet has been updated to V1.0.26 or higher. You can get the latest version of the wallet from the link below:
https://github.com/X9Developers/XSN/releases

2. This guide works for almost every Linux distribution on your VPS; for almost any Windows, Linux or iOS on your local PC.

3. You need an SSH Telnet client like PuTTY (you will learn how to set up this putty later in this guide).

4. You need a static IPv4 for each TPoS contract that your VPS hosts (so it must have a constant operating time). If you don’t have a VPS, you can get a VPS at e.g. rent Vultr.

5. A unique IPv4 server (VPS) and a unique merchant address per TPoS contract are necessary — you need one for each TPoS contract.

6. The original articles are linked at the bottom, errors are not excluded. If you have any questions, just drop by Discord, Telegram or Twitter.

7. In order to facilitate the understanding of the guide, I have various data here, including private keys, not removed. All IP addresses, private keys, public keys and TXIDs that I used in this manual were created and used only for this manual. They have never been hot and have already been destroyed.

II. Rent a VPS server

Choosing your VPS Provider:

You can purchase your server, otherwise known as a VPS through any VPS provider however; I recommend either of the following:

Vultr:
Vultr is reliable and has a helpful support team should you run into server issues. Your initial deposit will need to be done with a card payment/ PayPal however; after this time, you are able to pay for your servers in bitcoin if this is your desired payment method or you can use the same as your initial payment.

Sign up using the above link and you will receive some free credit to help you run your servers however; you must deposit $10 first.

Evolution Host:

Evolution host is extremely reliable with a friendly customer support team. They will allow you to pay for your servers in XSN should you choose to use this option. They offer either SDD or HDD VPS options, and I have included their comparison below:

Upcloud:
Upcloud is extremely reliable and I have never had an issue of a server going offline for maintenance with them which is an important factor when running a Masternode as any server downtime will impact your earnings and will require you to reset your Masternode. Payment options are Paypal or card.

Sign up using the above link and you will receive $25 free credit to help you run your servers however; you must deposit $10 first.

Once you have signed up and deposit your credit in your VPS hosting account, you will now need to deploy your server.

For the below, I will be showing you how to deploy your server on Vultr for many of the instructions as there is no major difference between Vultr & Upcloud when it comes to deploying a server.

Step 1: Deploy a Server by clicking on the Blue Plus Symbol (Vultr).

Step 1.1: Deploy a Server by using the left-hand menu, Servers -> Deploy a Server (Upcloud). Please note with Upcloud, your first step will be to input a server name i.e. TPoS1 and a short server description TPoS1. With Vultr, this is the last step you do.

Step 2: Choose your server location.

Step 3: Choose your operating system. I recommend Ubuntu 18.04.

Step 4: Choose your server. I recommend using the $5 per month — 1 CPU, 1GB Ram and 25GB SSD.

The current server requirements as at the time of writing this guide is as follows, however; for a TPoS VPS you will be fine to use the minimum specs:

Step 5: Name your server and press deploy. For this step, you have to scroll all the way down at Vultr, if you don’t do it, you can do it later. I haven’t changed it here, so “root@vultr” will appear afterwards.

Step 6: Wait for the installation to complete, on the next screen, click on your server and then click on Manage and take note of the IP Address, username and password:

III. Set up your local Windows Stakenet Wallet

Setting up your Windows Local Wallet

Step 1) Download and install the latest XSN Wallet from the below link:
https://github.com/X9Developers/XSN/releases

Step 2) Once the wallet has been installed on your computer follow the basic video tutorials on how to encrypt, backup, and use your wallet if you don’t know how. These can be found here: https://www.youtube.com/playlist?list=PLiPgD5jh1hS2W_9ToziTsaAiE-lRZA_st

First steps: Install PuTTY

This section will tell you how to install a program to run your VPS server, adding a new super user to your VPS, upgrading & updating your VPS, setting up your firewall and so forth.

It might sound daunting, but it will mainly be copy & paste of lines into your VPS.

Step 1) Download and install Putty from the following link: https://www.putty.org/

Step 2) Click on the “download here” link:

Step 3) On the next page, download the correct build for your PC, install it after this.

IV. Set up your VPS server

Now it can really start. Note: Copy the italic commands and paste them into PuTTY with a right click.

Step 1: Log into your VPS with PuTTY: root@“yourVPS-IP

If this is the first time, you login your VPS, you have to accept and add the servers SSH-Key. Just press yes.

If this is the first time you use a linux bash don‘t be confused. You never see your password when writing in a linux OS.

Tipp: If you use Vultr you can copy your password at their homepage and past it into linux with a right-klick. In the same way, you can simply copy the commands and then paste them with a right-click.

Step 2: Set up a super-do user (here: test1)

Commands:

adduser “your_user_name“

usermod -aG sudo “your_user_name“

Confirm information with “Enter” and answer the question with “Y”.

Step 3: Update and upgrade your VPS

Commands:

apt-get update

apt-get upgrade

Answer questions with y + “Enter”.

Step 4: Install a virtual enviroment

Commands:

apt install ufw python virtualenv git unzip pv

ufw allow ssh/tcp

ufw limit ssh/tcp

ufw allow 62583/tcp

ufw logging on

ufw enable

Answer questions again with y + “Enter”.

Step 5: Create a swapfile

Commands:

fallocate -l 5G /swapfile

chmod 600 /swapfile

mkswap /swapfile

swapon /swapfile

Step 6: Mount your swapfile

Commands:

nano /etc/fstab

/swapfile non swap sw 0 0

If this is the first time you use a linux bash don‘t be confused. The nano-command opens an editor. Navigate with the arrow keys to the bottom and write the command /swapfile non swap sw 0 0. To save your modifications, press ctrl+x, followed by y and Enter.

Step 7: Disable root login to protect your VPS

Commands:

nano /etc/ssh/sshd_config

PermitRootLogin no

MaxAuthTries 5

Navigate with the arrow keys to PermitRootLogin and change the yes into a no. Then add the MaxAuthTries line. To save your modifications, press ctrl+x, followed by y.

From now on, you have to use the sudo user from Step 2 to login your VPS.

Step 8: Restart your VPS

Command:

reboot

You have to restart your PuTTY as well.

Step 9: Login your VPS with your superuser-name

V. Install XSN-core at your VPS

Step 1: Create an empty directory and download the wallet

cd ~

mkdir xsncore

cd xsncore/

wget https://github_download_link

(Right now you should use this: https://github.com/X9Developers/XSN/releases/download/v1.0.26/xsn-1.0.26-x86_64-linux-gnu.tar.gz)

Step 2: Unzip the downloaded files

tar xfvz xsn-1.0.26-x86_64-linux-gnu.tar.gz

Step 3: Move your xsn-files to a secure place, change their permissions and clean up

mkdir ~/.xsncore

cp xsn-1.0.26/bin/xsnd ~/.xsncore/

cp xsn-1.0.26/bin/xsn-cli ~/.xsncore/

chmod 777 ~/.xsncore/xsn*

rm xsn-1.0.26-x86_64-linux-gnu.tar.gz

rm -r xsn-1.0.26/

Keep in mind: If you downloaded another version of the wallet, your files might have another name. Example: wallet 2.0.3 file names were: xsn-2.0.3*

Step 4: Edit your xsn.conf file and enter these lines:

Commands:

nano ~/.xsncore/xsn.conf

Then copy & paste these lines:

rpcallowip=127.0.0.1

listen=1

server=1

daemon=1

maxconnections=24

externalip= yourVPS-IP:62583

don’t get confused, here is the private key from another demo attempt

After entering, press Ctrl + X, “Y” and Enter. After that:

~/.xsncore/xsnd

Step 5: Give your wallet on your server a few minutes to start syncing to the blockchain. You can monitor the progress with the following command:

~/.xsncore/xsn-cli getblockchaininfo

Once the numbers in Blocks = Headers, then your VPS is fully sync’d. But you can already go on with the next steps.

Step 6: At your VPS: create your Merchant Address

Command:

~/.xsncore/xsn-cli getnewaddress “alias” legacy

A legacy address always begins with “X …”. The “Alias” parameter is used to define the name of your TPoS address. You can name it anything.

Save this new address in a local editor like Notepad. You need it in the 7th step.

Step 7: At your VPS: Show the private key of the merchant address

Commands:

~/.xsncore/xsn-cli dumpprivkey “Legacy adresse from step 6“

~/.xsncore/xsn-cli dumpprivkey “Legacy adresse from step 6” “AuthorizationCode”

Warning: do not share this result with anyone, even if you e.g. are written in Discord. That person is then probably a scammer.

Step 8: Edit your xsn.conf file and enter this Private Key:

~/.xsncore/xsn-cli stop

Commands:

nano ~/.xsncore/xsn.conf

Then copy & add these lines:

merchantnode=1

merchantnodeprivkey=Merchant_Private_Key

After entering, press Ctrl + X, “Y” and Enter. After that:

~/.xsncore/xsnd

VI. Set up your own TPoS contract at your VPS

Foreword: Every command is executed at your VPS. There will be only one step, you need to execute at your cold wallet. This is the only moment your cold-wallet needs to be online for a few seconds.

Step 1: At your cold wallet: setup a tpos contract

Use the address form Step V 6. Set the commission as low as possible, because you are your own merchant!

Step 2: At your VPS: show your tpos contract

Command:

~/.xsncore/xsn-cli tposcontract list

Save the txid at a local editor, like Notepad. You need it in Step 3 and Step 7.

Step 3: At your VPS: edit the merchantnode.conf

Commands:

nano ~/.xsncore/merchantnode.conf

name ip:62583 privatkey txid

After entering, press Ctrl + X, “Y” and Enter.

Step 4: At your VPS: restart your server

Commands:

~/.xsncore/xsn-cli stop

~/.xsncore/xsnd

Step 5: At your VPS: start the merchantnode

Command:

~/.xsncore/xsn-cli merchantnode start-alias “merchantnode_name“

Step 6: At your VPS: show the merchantnode config

Command:

~/.xsncore/xsn-cli merchantnode list-conf

After 15 - 30 minutes, the status changes from PRE_ENABLED to ENABLED.

Step 7: At your VPS: start the tpos contract

After your PRE_ENABLED status switch into ENABLED you can run these command. Without this command, your merchantnode will not start staking.

Command:

~/.xsncore/xsn-cli setgenerate true 1 true “txid from step 2“

To double check if the staking is active, input the below command:

~/.xsncore/xsn-cli getstakingstatus

Check the output from the above command that it shows “staking status: true” as per below.

Congratulations! You are now staking your XSN via the Stakenet Innovation TPoS! If you have any questions, just drop by Discord, Telegram or Twitter.

If you don’t want to be your own merchant, have a look at Discord at our #tpos-marketplace, there you will find various community members who like to run the merchant node against a fair % commission.

If you found this guide helpful and would like to show your appreciation, please send a tip:

XSN Stakenet Adresse (Jonathan): XsuH1mSHthEa9zgEXSQzZ8LCWeCfCZcpDW

ETH Addresse (Kuosumi): 0x3E999eD5bf85cfe4c89E1191FcFe69914910A6B8

ATTENTION: no Stakenet team member will write to you personally. Be extra careful with: merchantnodeprivkey = “dumpprivkey” getnewaddress “result”: don’t share this result with anyone, even if you e.g. are written in Discord. That person is then probably a scammer.

// Disclaimer: All rights do belong to Jim Starhead( jstarhead) and Kuosumi (@ thminer89), this article was created with the authors’ kind permission. Original articles: https://medium.com/@jstarhead/stakenet-xsn-tpos-on-your-own-vps-guide-349d229dd030 and https://medium.com/@ethminer89/stakenet-xsn-tpos-merchant-setup-guide-e4931b274cec . Author: Jonathan Park //

--

--

hydranet I German

/ Deutscher Stakenet-Medium Account. Alle Rechte liegen bei Stakenet und den Autoren. Deutsche Versionen: Jonathan Park. https://medium.com/@stakenet.platform /