Guide to setup a masternode
This guide will work with most coins if you replace the relevant coin specific references. Different coins have different methods in the wallet to get the masternode info and it is possible to get that info by clicking on the wallet buttons, or to execute certain commands in the debug menu. You can use whatever method you chose to get the masternode private key and the collateral address. This guide also assumes little to no knowledge of Linux and provide in-depth step by step commands to enter. I will add further sections on how to run multiple MN on one VPS as well as how to setup a MN on a local Win PC.
When you want to setup a masternode (MN) you have to make an architectural choice between whether you want to run it locally (on a PC) or if you want to run it remotely (on a Virtual Private Server (VPS) in the cloud). I do not recommend running a MN local on a PC due to last mile constraints in many places in the world that could impact your MN reliability. A big advantage of running MN in the cloud and the client on your local PC is that the MN in the cloud will be tapping into a thick reliable pipe to the Net provided by the VPS provider that will improve your MN reliability. This guide therefore focuses on setting up a MN remotely on a VPS and running a local client on your PC where the MN wallet with its coins are kept.
Setting up a MN in the cloud consist of five steps:
1) Rent, setup and prepare the VPS itself
2) Prepare the MN wallet and its config
3) Prepare the local wallet and its config
4) Fund the MN collateral address
5) Start the MN and verify it is working
Step 1 – Rent, setup and prepare the VPSI recommend using Vultr.com (click
here to go to Vultr) for this because they accept Bitcoin for payment. Also, once funded, you can deploy more than one VPS and all of them just tap into the funded amount as time goes by. So signup and rent a basic VPS for BTC equivalent to $5 per month. On a basic VPS you can run about 4-5 wallets. If you have money and want to run even more wallets on a server then rent a bigger one. Assuming you go for the basic server, go to deploy and select the following specs:
- Location – I found New York and Amsterdam to work smooth so pick one of these.
- Select a 64bit OS of latest minus one. I say this because latest is not always the greatest in the beginning. Ubuntu is pretty good and Linux just works smoothly so select Ubuntu 14.10 x64.
- Select the smallest server specs 1 CPU, 768MB, 15GB storage, 1000GB transfer. In general to compile a wallet you need at least 2GB of memory but a server with 768MB memory is sufficient to run it. This guide therefore recommends 768MB of memory for longer term rental and to rent another server of size 2GB memory just for a few minutes to compile the wallet and then destroy the 2GB server afterwards.
- Select optional features “Enable IPv6”. Don’t worry for now on SSH keys for now.
- Give your server a name in the label eg. MN1-US or whatever you like.
- Select “place order”
Now wait a few minutes while your VPS spins up. When it is done it is now time to configure the VPS. Go to “My servers” look for your server and select “manage”. In the next tab click on view console. A black box will appear on the screen with a bunch of first time use messages. Enter “root” for the username and the password on the Vultr management console. If you don’t see the prompt for the username initially, don’t worry, just enter it and if you get the it wrong it will then show you the prompt to enter the username. Once you logged in as “root” execute the following commands without the parenthesis. I will assume from this point forward that your username is “user”, but change it to whatever you want to use to log on the server as and wherever I use “user” substitute with your username.
Command 1: “adduser user” (creates a new user that is not a superuser. Just press enter through all the questions after that. At the password select a proper difficult password.)
Command 2: “sudo adduser user sudo” (Adds your new user to the sudop group that allows the account to assume superuser rights when needed)
Command 3: “logout” (You don’t want to do general stuff on a server as root)
Command 4: Login with your newly created userid and password
Command 5: “sudo ufw enable” (Make sure that the firewall is enabled)
Command 6: “sudo ufw limit 22” (prepare the firewall to allow ssh and scp connections which are needed to get certain files onto the server)
Command 7: “cd ~” (The ~ character is a short character to represent your user’s home directory. It is the same as using /home/user)
Command 8: “mkdir opt” (This creates an opt directory in your user directory where you can store files or do compiling. This directory can also be called something else and it is up to user preference.)
Command 9: “sudo apt-get update” (making sure that the server knows of all the new packages that are available)
Command 10: “sudo apt-get update” (making sure that the packages in the default install are upgraded to the latest versions.)
Command 11: “sudo apt-get install -y qt4-qmake libqt4-dev libminiupnpc-dev libdb++-dev libdb-dev libcrypto++-dev libqrencode-dev libboost-all-dev build-essential libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev git htop zip unzip (this installs a broad bouquet of libraries that you would need in general to compile and/or run dynamic binaries and also includes certain useful utilities. If you made a typo, no worries, just press the up arrow on the keyboard to give you the previous command and you can fix the typo and press enter again)
Command 12: “mkdir ~/.WOC2”