ObscureCoins
Cryptocurrency Prices by Coinlib

VPS Setup for Crypto Currency Daemon/Wallet Operation (Masternodes)

The following information is intended for Ubuntu 16.04 however may apply to other versions of Ubuntu and Linux/Debian Distributions on the server side.
The operating system on the user/client side is mostly irrelevant. Examples, if referenced, are for Windows OS on the client side.


Requirements



Essentially Putty and Bitvise function the same.
Both are free to use.
Bitvise is a preference due to its abilty to quickly open additional terminal windows as well as an SFTP window that allows for easy uploads and downlaods directly from the server without the use of additional FTP software.

Considerations when Choosing a VPS Provider/Plan


  • Most Providers offer similar service with small variations.
  • You want to consider payment options and accepted currencies.
  • You want to consider room for growth and expansion.
  • The more CPU cores, RAM and SSD available aides in stable operation and expansion.
  • You want to have access to both IPv4 & IPv6 if possible.
  • Most services include both IP protocols unless you are going for the bargain buys.
  • IPv6 is not neccessary but useful when expanding.
  • Tip: Vultr allows IPv6 to be checked during initial setup at no additional charge. Adding this option after setup may incure a fee.
  • Tip: In general terms for many masternode coins you can run 5 or more nodes on a 1 CPU/1 MB RAM plan w/ a swap file.

Useful Linux Commands


  • cd (Change Directory)
    • cd is used for navigation between directories.
    • cd alone will return you to the home directory.
    • cd path/to/directory will bring you to that location.
    • cd .. will navigate back 1 directory.

  • ls (Lists items in directory)
    • ls -a (Lists all including hidden/sub-directories)
    • ls -al (Lists all with details)
    • ls path/to/directory (View contents of specified location)

  • mv (move file/directory)
    • mv is also used to rename files & directories
    • mv file.txt fileold.txt (example rename in current directory)
    • mv file.txt /usr/local/bin/file.txt (example move file to another location)

  • clear (Clears the terminal window)

  • pwd (Displays your Present Working Directory)

  • df (Displays HD/SSD usage)

  • chmod +x filename (Change file permissions to executable)
    • chmod -R +x directory (Change permissions to executable for entire directory and files within)

    Useful Linux Commands


  • rm filename.txt (Remove/Delete File)
    • rm -Rf path/to/directory (Remove/Delete Directory)
    • Use rm with caution. There is no undelete.

  • cp filename.txt path/to/filename.txt (Copy file to Directory)
    • cp -R directory path/to/directory (Copy Directory to Location)

  • tar xvf filename.tar.gz (unpacks tar file)
  • tar cvf filename.tar.gz file1 file2 file3 (compress files)

  • free -m (Displays RAM/Memory including swap)

  • top (Displays summary Information & Processes)
    • tap Q key to exit top

  • cat filename.txt (Displays contents of Document)
  • nano filename.txt (Opens Document to edit)
    • Ctrl + x then Y then Enter (Save and exit editing)

  • sudo (grants user privileges to run commands)
    • Required if not root user

  • wget https://url.com/to/file.zip (Download from URL)

  • git clone https://url.com/to/file.git (Clone Source)

  • reboot (Restart the VPS)
Content
Content
Content

Getting Started

After you establish a VPS plan. Use the login information provided by your service to connect to your server via the SSH Client.


Upon first successful login you will be prompted about certification of connection.
Accept & Save.
After accepting, a terminal window will open awaiting your commands.


Inside the terminal window run the following commands to ensure the OS is up to date.

apt-get update -y
apt-get upgrade -y

Optional update - May require reboot when complete.

apt-get dist-upgrade -y

Setup Swap File

A swap file uses disk space for memory. View a swap file as "virtual memory" in Windows by comparison. If you have a budget plan, you will certainly benefit and have the ability to operate multiple programs/daemons.
If you desire to get the most from your plan for your money, a swap is highly recommended. Keep in mind that a swap file will use part of your SSD space and you will need to balance for your situation.
Be aware that not all vps providers allow for swap setup, Vultr does, Contabo does, Virmach does Not.

The code below will setup a 6GB swap file. The swap file will apply and stay in affect even after server reboot.
This should be run as the root user. If you are not logged in as root, use sudo as needed for your situation.
Adjust count=#### for the desired size in MB. exp: 6000 = 6GB.

dd if=/dev/zero of=/mnt/myswap.swap bs=1M count=6000 && mkswap /mnt/myswap.swap && chmod 0600 /mnt/myswap.swap && swapon /mnt/myswap.swap && echo -e "/mnt/myswap.swap none swap sw 0 0 \n" >> /etc/fstab

To verify the swap file was established run:

free -m


Dependencies

Dependencies are requirements for compiling and operating crypto currency daemons/wallets.
Depending on your provider, some VPS installs may or may not have certain programs preinstalled.
You will notice common programs such as nano, git, unzip and ufw are included in the command below.
We have included these items to assist in your setup. If they are preinstalled, there will be no change.
Copy and run entire command below:

apt-get update -y && apt-get upgrade -y && apt-get install git -y && apt-get install unzip -y && apt-get isntall nano -y && apt-get install ufw -y && apt-get install build-essential libssl-dev libboost-all-dev libqrencode-dev pkg-config libminiupnpc-dev qt5-default qttools5-dev-tools libgmp3-dev -y && add-apt-repository ppa:bitcoin/bitcoin -y && apt-get update -y && apt-get install libdb4.8-dev libdb4.8++-dev -y && apt-get install autoconf -y && apt-get install build-essential libtool autotools-dev pkg-config libssl-dev libboost-all-dev autoconf automake -y && apt-get install libzmq3-dev libminiupnpc-dev libssl-dev libevent-dev -y && apt-get install libgmp-dev -y && apt-get install openssl -y && apt-get update -y && apt-get install git build-essential -y && apt-get install aptitude -y && aptitude install libdb4.8++-dev -y && apt-get install git -y && apt-get install software-properties-common python-software-properties -y && add-apt-repository ppa:git-core/ppa -y && apt-get update -y

As long as everyting installed correctly above, your VPS is ready to compile and/or operate crypto daemons/wallets.
You can now move over to MNSETUP however it is recommended to skim the optional and troubleshooting details below.


Optional

If you are using Ubuntu 16 GUI you may want to operate or compile wallets. The commands below will be run line by line and the final 2 commands will install what is needed to compile the QT/GUI wallet for Ubuntu.
The following commands will include sudo. Under normal circumstances, the Ubuntu GUI install is set with sudo user access. Alternatively you can switch to root user in terminal.
The following commands can be used on the VPS in order to setup QT/GUI compilation of any wallets you work with.

sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo apt-get install libboost-all-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler


Troubleshoot Issues

Not all solutions you may come across can be assumed ahead of time. The items listed here are a few common solutions

If libdb4.8 does not install. Usually this is because you are using Ubuntu 18 or other distribution like Debian.
The repo for these versions is not available so you will need to compile BerkleyDB yourself.


wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
unzip db-4.8.30.zip
cd db-4.8.30
cd build_unix/
../dist/configure --prefix=/usr/local --enable-cxx
make
make install

fix lib1.58 error

apt-get install -y libboost-all-dev

QT error during compile

apt-get install git build-essential cmake qt5-default qtscript5-dev libssl-dev qttools5-dev qttools5-dev-tools qtmultimedia5-dev libqt5svg5-dev libqt5webkit5-dev libsdl2-dev libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack-jackd2-dev libxrandr-dev libqt5xmlpatterns5-dev libqt5xmlpatterns5 libqt5xmlpatterns5-private-dev

Error attempting to run daemon.

apt-get update && sudo apt-get install gcc-4.9 -y && sudo apt-get upgrade libstdc++6 -y && sudo apt-get update && sudo apt-get install libstdc++6 -y && sudo apt-get update && sudo apt-get install -y software-properties-common && sudo add-apt-repository ppa:ubuntu-toolchain-r/test && sudo apt-get update && sudo apt-get install -y curl build-essential supervisor wget libstdc++6 && sudo apt-get upgrade -y