Up until this point, we’ve talked a lot about trading, fundamental analysis, or portfolio management to increase your chances of success. In this chapter, we will focus on passive income. Depending on the market sentiment we are in when you are reading this, you already more or less know why passive income is important.
During a bull run, many people don’t really care much about passive income in general, as it might seem not worth the effort in comparison to trying to catch up with new-gain opportunities literally every ay. It’s only human to feel that way, but what goes up must come down. Hence, ensuring steady passive income, which will help you in hard and inevitable bear market conditions, is important.
The most common forms of passive income today are staking and running masternodes. We will discuss proof-of-stake and therefore staking in every detail in Chapter eight. For the next few pages, we will focus on running a masternode.
Masternodes were first introduced by DASH and became immensely popular over the years. Masternodes were initially introduced as a way to enable various technical features or governance of the network. If you run a masternode, you secure the network and enable it to function properly. For this service, you will get paid a certain number of coins as a reward. This is what makes running a masternode so lucrative, as you will receive some steady payment by keeping your masternode up and running.
6.1 Masternode guide
Although I always try to encourage you to DYOR, as I think it will help you the most, I’ve also tried to make this book as helpful as possible. That’s why, I will try to provide you with all the information needed to set up a masternode by yourself. Since I assume that most of you may be relatively new to the space and don’t have a broad knowledge in programming or Linux, I will start with some explanation of basic commands.
Important: If you don’t have any command line or Linux experience at all, it might be best to start with section 6.2 at first.
There will be some slight variations, depending on your operating system, and you will select the following accordingly. I’ve left out Linux, since you will already know the following commands if you are a Linux user.
If you are a Mac user, there is no need to install a special program to be able to set up your masternode. Just press “command + space” to open the search bar and type in “terminal.” (Clicking on the lens icon in the upper right corner will open up the search bar as well.)
To access your VPS (Virtual Private Server), you will need to download a program called PuTTY. To do so, visit the following website: <https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html>. Install the program, and you are ready for the next steps.
Before we go through every step needed to set up your masternode, it is helpful to know what exactly you are going to type in. Therefore, try to memorize the following basics, as it will help you in various ways:
mkdir make (create) a new directory
tar create/extract archives (zip)
cp copy files or directories
rm remove (delete) certain files
nano start nano text editor
ufw firewall configuration
apt Advanced packaging tool
passwd change password
pwd print working directory
ls list directory contents
ssh Secure Shell (Remote access)
cd change directory
The next step on our list is to set up a suitable VPS. I personally use VULTR, <https://www.vultr.com>, the most. It enjoys a very good reputation and has proven to be very reliable in the past. Of course, there a lot different of providers you can choose from, and you are free to choose the one that simply suits you best. I will guide you through the setup process on VULTR as an example.
After creating an account and adding some credit, you can easily begin setting up your VPS by clicking on the “plus” icon. Now, you will need to choose the geographic location of your new VPS. You can choose it freely, since it doesn’t matter in our case.
The next step is choosing the operating system.
As you can see in the figure above, I’ve chosen Ubuntu and selected version 16.04 x64. Use the same version, and head over to the next step. You will now be required to select the hardware specifications of your soon-to-be-created VPS.
I selected the server for $5/month with 1GB RAM and 25GB storage. Depending on the masternode you would like to set up, different hardware requirements will have to be satisfied. Most are likely to require 2GB RAM, and you will need to upgrade your VPS to stronger server for $10/month. I can confirm that, based on my experience, the $5 version will work fine for most coins (even though they might require stronger servers. But if you start with a less powerful one to try it out, you may need to switch the server later if you encounter any problems. If you would like to stay safe, you can always choose the suitable one out of those provided to meet the requirements.
You do not have to change anything in Steps 4 to 6, and you can finish the setup by entering a server label.
This might be useful in the future if you are going to run different masternodes on Vultr. Therefore, fill in something like: “COINNAME_Masternode01” in both fields, and launch your server.
Your VPS will now be installed, which takes a short moment. After your server is installed, you’ll be able to manage it by clicking the three-point symbol like in the example below.
This enables you to see the server id and login credentials needed for further steps marked in the screenshot below.
Congratulations! Your first VPS is now up and running. You are now one major step closer to running a masternode.
To run a masternode on your freshly installed VPS, you will need to access the server. You will now need to either open your terminal (Mac) or PuTTY (Windows).
If you are using the terminal, you just have to type in the following command after you replace the red “yourserverip” with your actual VPS IP provided by Vultr:
You should see a request to type in your password, popping up. Type in or copy and paste the password from your server information page on Vultr (See the provided screenshot above).
If you are using PuTTY you are required to fill in your IP address in the “Host name” field. Hit the Open button below and start connecting to your VPS. If you see some Alert window popping up, press Yes, and there should be a black terminal window opening up. Login in by typing “root” and the password provided by Vultr (see the screenshot above).
No matter which way you chose to access your VPS, the following steps will be the same for both operating systems.
The first thing you should immediately do is change your root password that you’ve just used as a login to your server:
You will be asked to type in a new password. Choose a strong one (randomly generated, long and with different punctuation marks at best) and store it somewhere safe. Confirm it and create a new user with the following command:
Note: You are free to choose a new username by replacing the *yournewusername* above. Always remove both * too and just type in your new username without them.
You will be asked to confirm your action by typing in your newly created password. Leave all the user information fields blank and type in the following line:
usermod -aG sudo *yournewusername*
This grants your newly generated user a higher level of account privileges. The new user is added to the so-called sudo group, which enables you to execute some administrative commands by using the word sudo. (Otherwise, you need to log in with your root account for some tasks.)
Now we will update the operating system to the newest version. Type in the commands below and confirm by pressing Y followed by Enter:
With the next command, we will install a basic firewall to protect the server:
apt install ufw python virtualenv git unzip pv
Confirm those changes by pressing Y and Enter as well. To restart your server, simply type in “reboot.” A few minutes later, you can log in once again.
Note: The level of security to protect your VPS can be increased. This is only a basic level of protection. But since we don’t store any coins on the server, which can be stolen, I will not go further into details here. There are a lot of easy-to-follow guidelines if you wish to increase your security level. In case of a security breach, you can set up the server once again by following the steps above. Since it is fairly easy to delete and create new server on Vultr and there is no way that a hacker might steal any of your coins by accessing your VPS, you are quite safe even with the basic security level.
We now have a functional VPS running, which we can use to host our masternode. The following steps will differ, depending on the project/coin you chose to run your masternode for. The underlying principle is still the same, and you can follow the steps by just adjusting some parameters.
As an example, we will go through all the necessary steps for running an XSN (Stakenet) masternode. As a disclaimer, I own some coins myself, but this should not be considered an investment advice. As always, try to DYOR before you invest. At the time of writing, there are plenty of solid masternode coins that may be worth investing in. As you should already know at this stage, ROI is not the only thing you need to consider. To set up an XSN masternode, a collateral of 15,000 coins is needed.
The following commands will install some basic packages and libraries to make sure we can install the wallet client properly:
ufw allow ssh/tcp
ufw limit ssh/tcp
ufw allow 62583/tcp
ufw logging on
Hit Y and Enter again and put in:
fallocate -l 4G /swapfile
chmod 600 /swapfile
A new file will open up where you should add the following line at the end:
/swapfile none swap sw 0 0
Close the file by pressing the combination: Control(Ctrl) + X and again Y and Enter to confirm/save the changes you made. Your VPS is now ready to install the coin wallet software needed to start your masternode. Note: The libraries needed to successfully run a masternode on your VPS will differ from project to project. The ones above will therefore be suitable for the XSN masternode. Some other settings, like the port, will most likely differ as well. But as this should only show you the basic principle once again, you can easily adjust those settings by those provided by the project of your choice.
The first thing we need to do now is download the newest version of the wallet client to our normal computer. Go to the official website/github and download the one provided there. Make sure that you are really using the official client. You can search for the project on CMC, for example, and use the provided link over there. Or you can look for the official links provided via Twitter/Telegram. Just make sure to stay safe and use only the official installation files.
Start the wallet and let it sync. You need to make sure that it is properly synced, which may take a while. Make sure to backup your wallet.dat file. (You may want to read the Chapter nine. If you haven’t done so already before carrying on).
As the next step, you will now need to create a new receiving address. Depending on the chosen project, there will be different ways to do so. Some wallets may have a separate receiving tab, which makes it quite easy. Some other ways are right-clicking the taskbar or if you are using a Mac, clicking the bar at the top of your screen. If you created a new address, make sure to label it (Masternode01 or MN1, for example). If your wallet is fully synced, send the exactly needed collateral to your newly created and labeled address. Wait for your transaction to confirm, and carry on with the following steps.
Open up a text file with the editor and head over to your wallet again. You will now need to open the debug console. There might again be different ways to do so. For now, go to “tools,” and you will see it available there. Put in the following commands and copy the corresponding output.
This command above will generate a key often referred to as masternode private key. You will need to execute this step for every new masternode you want to set up. The key used in your configuration should always be unique for each masternode. As noted above, copy the output and paste it in your file.
The command above will generate a collateral output and an index. Especially, take a look at the last number (index). It is either 0 or 1, and it is crucial to copy it with preceding output. Again copy and paste it.
Close your wallet now. Make sure you close it properly because just hitting the “x” in the wallet window will only close only the window and won’t stop the wallet from running. We will now need to access the masternode.conf file. You will find it in the same directory as the wallet.dat file you saved earlier. If you can’t find it, you may need to create it. Just open up a new text file and name it exactly like above. You should see something like this written in it:
# Masternode config file
# Format: alias IP:port masternodeprivkey collateral_output_txid collateral_output_index
# Example: mn1 127.0.0.2:19999 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0
Note: Some basic knowledge, which helps you understand some of the following steps, is the fact that something written behind a hash (#) is regarded as a comment and is not to be considered/executed.
Start a new line in the text file without the # and add your masternode alias at first. You might want to take the same label you’ve already used for your receiving address. In the example above, the alias is *mn1*, which you could use as well. Now, paste the IP of your VPS, followed by a port. I will use the port 62583. You may recognize the number, and I will tell you why. This is the number you already typed in once during your VPS setup. You have to make sure that those numbers are matching for the setup process to work properly. The port will be provided by the team of the corresponding project and can mostly be found quite easily. If you have any doubts, just join Discord or Telegram and ask for it. But in most cases, there will be at least some kind of basic documentation regarding masternodes. Add the port to your IP separated by a *:* and carry on by copying and pasting the masternode private key you generated before. Hit the space bar once and add the collateral output with index number. Your masternode.conf file should now look like the given example above. Make sure to save your changes and close the file. I personally make an extra copy of the file and store it together with the wallet.dat file. This is helpful in case your computer or hard drive dies for whatever reason.
Having the goal in mind, we will now install the wallet of our choice on the VPS. Therefore, you will now need to access your VPS once again. To connect to your prepared server, use the following command:
Make sure to use the username/account you have already chosen during the server setup and not *root*. Since we are going to run an XSN masternode in this example, we will install XSN Core. For another project, you will need to adjust the following command, accordingly:
As you might recognize this command from the early beginning of this guide, this will create an xsn core directory. (You can insert a ~ /tilde symbol by pressing alt+n on a Mac; Windows will have a different combination, depending on your keyboard—may be on the button left to the 1 or with altgr and + simultaneously). Now, access your newly created directory with the “cd” command.
As the next step, we will need to download the latest client available. Use the *wget* command to start downloading the files.
Most projects will have their builds hosted on github, where you can easily download them. Some might host their own website for it or provide a dedicated link to it. You will find the files quite easily on the website or via Telegram or Discord. It will look like something close to this:
The version above is surely outdated but still helpful as an example. If everything is correct, a download should start. This might take a few minutes, but you should be able to see the progress being made.
Since the downloaded file is compressed, we will need to extract the archive. To do so, use the *tar* command:
tar xfvz xsn-1.0.9-linux64.tar.gz
cp xsn-1.0.9/bin/xsnd ~/.xsncore/
cp xsn-1.0.9/bin/xsn-cli ~/.xsncore/
chmod 777 ~/.xsncore/xsn
The first command above will unzip the files, and the following two will move the important files to the directory we created previously. The *chmod 777* command will make the copied files above usable (executable, readable, writable) without restrictions. (This is a very basic explanation.) If you want to remove the unneeded files, you can do so with the *rm* command. Depending on specification and hardware of your chosen VPS, this might help avoid some storage shortage (rm -rf xsn-1.0.9).
For one of the last steps in the setup process, we will need to access the configuration file. In our example, we will do so by using the following line:
Note: The config-file will mostly look somewhat like this: cointicker.conf. If you are going to setup a DASH masternode, for example, you can access it via dash.conf. The config is most likely located in the directory you created previously (like we did in the example above), or it will be created upon the first start of your client on the VPS.
Just to make what you’re doing right now a little easier to understand, I will translate the last command line in plain English:
nano will run the text-editor, and we can open a file by using the following syntax:
As you can see above, we will always use the path were our config-file is located to be able to open and modify it. If the path is right, the configuration file should open up. Type in the following lines:
masternodeprivkey=*your masternode private key*
externalip=*your server ip*
You will need to enter a random combination of numbers and letters in the rpcuser field above. Do the same for the rpcpassword. Any combination will do the trick as long as you make sure to exclude special characters. Next, add the IP address of your VPS to the externalip field above. As the last step, copy your masternode private key, which you generated previously via the masternode genkey command, and paste it in the corresponding field above. Close the file by pressing the combination *Control(Ctrl) + X* once again and save your changes to complete this step. Now, we are only some minor steps away from finally starting our masternode. Make sure that the necessary program (deamon) is running. If it isn’t already running, you can do so with the following command:
You should see some notice that the server is starting right after you executed the command above. If you have any problems, just type in “cd” to get to your home directory and execute the command above once again. With the command above, we simply start up the program (here xsnd), in the directory we created previously. This will work the same way with most other masternode projects out there (for example, the command for DASH would be: ~/.dashcore/dashd). It is important that the blockchain is synced and the client is running on the right block before starting your masternode. This might take some time, and you can check the current block by using the *getwalletinfo* command as you can see below:
You can use your fully synced main wallet to check for the current block or a blockexplorer. The blockexplorer is linked on the main page in most cases. If not, you can check CMC whether one is linked on the corresponding project page. If everything is synced, it is now finally time to start your masternode. Switch back to the main wallet, let it sync, and open up the debug console once again. Type in the following command:
masternode start-alias *Your masternode name*
You should now get the message “Masternode successfully started.”
Congratulations! You’ve just successfully set up and started your own masternode!
Troubleshooting and Tips:
You may want to verify that your masternode is working properly on the VPS. You can do so by using the following command:
~/.xsncore/xsn-cli masternode status
Make sure that you use the right path and the client (-cli) to execute the command.
Some other helpful commands to use may be the following (this time used via the debug console of your main wallet):
– masternode count (lists the total number of mn)
– masternode list (lists every masternode)
– masternode list-conf (lists config-data of your node)
You may need to wait for quite a long time to finally be rewarded with your first reward. Sometimes, waiting periods even up to a week can be normal. So, don’t be too worried about not getting any rewards in the early days. It strongly depends on factors like the total amount of masternodes or the general blocktime. Most projects won’t distribute the rewards randomly, and you will need to wait for your masternode to be in line.
For tracking your masternode or seeing useful statistics, some helpful websites are available. You can see two examples below:
Make sure to always join Discord and other social media channels to keep track of updates related to your project. I personally prefer Discord, as the designated channels make it easier to follow the news. This is really important, since you may have to update your client from time to time. In most cases, the team will provide some guide to follow, and you will find some help on those channels too.
It is always advisable to update the client not only on your vps but also on your main/controller wallet. If they are running different versions, your wallet won’t be able to detect the protocol of your masternode properly. This can lead to an error, and you masternode simply won’t work.
I used various sources in this chapter, the links to which you can find at the end of the book if you want to increase your knowledge further.125–129
Beside setting up and maintaining the masternodes yourself, there are different ways to host a node quite easily as well.
One famous scrypt to run various masternodes was developed by @Marsmensch (https://medium.com/tales-from-the-crypt-o/5-minute-masternode-setup-df4f4cb8c03e). It is quite easy and might be the perfect fit if you prefer something mostly non-technical.
If you don’t want to do anything technical and prefer to have your masternode updated without doing it yourself, you should look for some 1-click installation services.
One of the most famous examples may be:
There are others, but I tried only the one listed above. It worked quite nicely, but as you might expect, I prefer to set up the nodes by myself.
Having your nodes maintained automatically is something really great if you don’t mind the small premium you will have to pay for the service in general.
In general, you will most likely find some masternode guide for nearly every established project out there. Hence, the VPS set up and configuration will vary to a certain extent. Some guides, for example, might not create an extra user upon the initial configuration and simply run every command as root. This will definitely work out fine, but as you have unrestricted rights, you may unintentionally delete some necessary files from the operating system. But you will be fine if you are careful or have some more experience. Following the guide from stakenet (XSN), which is based on the DASH setup guide, I included the ~ (tilde) symbol during the setup process.
Most other guides may not use it at all, which shouldn’t worry you at all, as the masternode will work out just fine if you follow the respective guide carefully. In general, you shouldn’t be too worried if something isn’t working perfectly at first. I know that it can be very frustrating, especially in the beginning, but that’s part of the game. Most of the times, a restart of your masternode or VPS will solve various different problems (as with basically every other electrical device out there).
6.2 Basic command line/Linux skill set
Regardless of whether you would like to increase your command line knowledge or you have some problems setting up your masternode, this section may be the right place for you.130–136 I will try to keep everything as simple as possible, but it still may take a few repetitions to get familiar with the way of using the command line in general. I thought a lot about how to start and structure this paragraph, as there are various different ways to get started. It might be the best option if you start setting up a VPS by using the guide above. Therefore, every command could be directly used/trained in the environment we are generally working with, in the process of setting up a masternode. But as this would require you to access your VPS in the first place, I thought about a more beginner-friendly approach. To understand the very basics, we will therefore start with some of the easiest and most useful commands. The following commands are the same on Linux and macOs. That’s why you are able to simply open up your terminal (by opening the search bar and typing in terminal, for example) if you are using Apple and get started with the first commands below. As a Windows user, you will experience some slight variations. (You can skip the following lines as a Mac user and start with the *pwd* command). The easiest way is using the search function on Windows and typing in “powershell” (previously command prompt). After hitting Enter, You’ll see a new window open up where you can get started. Since I created the following guide to get a basic understanding on using the command line, there is only one exemption where you should pay attention to as a Windows user. The command *touch* is replaced with *New-Item*. The screenshots below are taken on a Mac, since it will look the same using Linux (which will be the operating system of our VPS). You should not have any problems following the guide, even though the screenshots might look slightly different from the ones below. Now let’s start with the first command:
pwd (print working directory)
The command above is very useful if you ever get lost during your learning process or if you are using Linux in general. It will tell you exactly in which directory you are currently in. If you just open up your terminal and use the command above, you should see something like this:
You now know exactly in which path you are working in. Now let’s have a look at the next command:
ls (list directory contents)
The command above is nice to “visualize” the contents of your current directory. You should see something like this if you use the command:
As you can see, I’ve just opened up the terminal and used the *ls* command to print all the folders of your current directory. The next step is crucial for nearly everything you are doing in Linux.
cd (change directory/path)
With this command, you are able to navigate between paths very easily. As for everything you are learning, it is best to try it out yourself. Try to navigate to your desktop using the *cd* command like I did below.
Now let’s try the *pwd* command once again. You should see your current directory and would now be able to see all the contents on your desktop by using *ls*. Since we are just about to get comfortable with the *cd* command, you should try to type in *cd ~* too (“~” is typed by simultaneously pressing “alt + n” on a Mac). This command will literally always bring you home. No matter where in which path you currently are, typing in this command will bring you to your home directory (using *cd* without defining a destination after it can be used as well). Try it out and take a look at the next command.
mkdir (create/make directories)
The command above is very useful, since it allows you to make directories (folders) very easily. We will now create a folder called crypto, which should help you understand the command line further. This step was actually some sort of an eye-opening experience for me in the early beginning. Use the *cd* command to navigate to your desktop and create the said folder by using *mkdir crypto*. A folder should now have been created on your desktop. Try to find it by using your mouse. To get used to the commands, try creating the following directories in the crypto folder: masternode, bitcoin, satoshi. Use the *ls* command and navigate to one of the new folders, followed by the *pwd* command. The *mkdir -p* command will make creating more than one directory very easy. Head over to your desktop again and use the following command:
mkdir -p satoshi/bitcoin/crypto/masternode
Now use your mouse again to navigate to your desktop and open up the newly created folder satoshi. You will notice another folder called bitcoin (which includes crypto and masternode, respectively) in it. Head over to your terminal and navigate to the folder masternode. Type *pwd* and head back home again with the *cd ~* command. Now try the following command to navigate to the masternode folder once again:
Type *pwd* again, and you should see the same path you already used before heading back home. Have a look at the next command.
The command above will bring you one folder back in your pathway. This is very helpful, since we are now going to practise the overall handling a little bit further by using the command below:
rmdir (remove directory)
Navigate to the masternode folder and go back into the preceding crypto folder, using the commands above. Type in the *ls* command, which should take you to the masternode folder. Now delete (remove) the masternode folder by typing *rmdir masternode* and type *ls* again. You should see something like this:
As an exercise, try to remove every folder, including the satoshi folder. As you may have already expected at this point, you are able to delete the whole pathway by typing *rmdir -p satoshi/bitcoin/crypto/masternode*.
touch (creating empty files)
The command above will let you create empty (text) files, which can be opened by your editor. Try navigating to the masternode folder and create a file by using *touch configuration*. Navigate there with your mouse, and you should find an empty text file—configuration—in your masternode folder. If you now head one folder back and try to delete the masternode folder, you should get an error message. To remove the newly created file again, use the *rm* command.
cp (copy files/directories)
The *cp* command is something you will definitely encounter during your process of setting up a masternode on Linux. Head over to your masternode folder again, and copy the configuration file from the last step by typing *cp configuration wallet*. Use the *ls* command, and you should see something like this:
By using the command above, you’ve copied the configuration file and pasted a copy of this file—wallet—in the same masternode folder. Find the created files by navigating with your mouse and make some more copies of the file as an exercise. Now, head over to your satoshi folder. Create a file called data and try the following:
cp data bitcoin/
Now type *ls* followed by *ls bitcoin/*. Navigate to the Bitcoin folder and use the *ls* command again. It should look like this:
So, what did we learn in the last exercise? We’ve advanced the usage of the *ls* command further, by now listing the contents of a folder without the need of navigating into it (You can add arbitrary directories by using “/”). In addition, you’ve learned how to copy files and paste them in other directories. Especially the last step can be very useful, since you won’t need to open up the whole pathway to actually paste a file to its final destination.
Besides the commands we discussed above, there are a few other commands that may be worth looking into:
cat (“concatenate”; view file content)
mv (move/rename files and directories)
grep (search text inside file)
xargs (execute command lines)
less (view files)
We will not get into detail with the commands above, but there is a broad range of free resources available to further broaden your knowledge. With some additional practice, you should gain some better understanding of command line usage in addition to some basic Linux skills. I really hope that the explanation above has helped to further understand the masternode guide and that you are now capable of setting up one by yourself. Always remember that there is no shame in asking for help if you get stuck with a certain problem. Nearly every dev team or community is generally very helpful if they notice that you have been already trying to solve the problem by yourself. As already mentioned, many projects will have their own masternode setup guide. They are always worth looking into and will definitely help you set up the respective masternode.
Always remember to join the social media channels related to the project (preferably, Discord) to stay updated. This is really important, since you will have to update your VPS client from time to time. This most probably will be a very easy process, where you’ll just have to execute some few lines given by the dev team and do some copying and pasting.
You may be required to restart your masternode after updating, which can lead to some loss of rewards. But as all masternode holders are required to restart too, you may receive your rewards faster than after the initial setup. If you encounter any serious problem, a restart of your VPS may help as always. In the worst-case scenario, you might have to set up the whole VPS from scratch. This may be annoying but shouldn’t be much of a problem at this stage. Always remember that your keys, and therefore your coins, are safe, since they’ve never left your controller wallet. No matter what is happening to your VPS, you will be safe as long as everything is stored in your main wallet.
Based on my personal experience, I would advise against updating on the very first day of a new software release. You will always have a period of a week or two to have your masternode updated. Very early releases may contain bugs and won’t work properly in some cases. If you update after a few days, the risk of reward loss can be decreased significantly. Remember to monitor your masternodes regularly to make sure that everything is working fine. If so, just lean back and enjoy your rewards!