VPS and Hot wallet Setup

These instructions are intended for those that are setting up a MasterNode Hot wallet on a Linux VPS. This wallet and server will run 24/7 and will provide transaction confirmation services to the network. Each time the MasterNode Hot Wallet is used to complete a block, it will be rewarded with a set amount of coins. The Hot Wallet runs with an empty wallet balance, and forwards all MasterNode payouts to the Cold Wallet, reducing the risk of losing the funds if the VPS is comprimised.

Order and Create a Linux VPS

For more detailed instructions on how to create a Linux VPS and how to configure the external firewall, go to the VPS: Order and Create a Linux VPS section of the guide.
  1. Identify a VPS provider and order a Linux Ubuntu 16.04 or 18.04 x64 server. A VPS that meets the following requirements should cost around $5 per month.

    Recommended VPS Providers:

VPS Minimum Requirements:
  • Linux - Ubuntu 16.04/18.04 - 64 Bit OS
  • 1GB of RAM
  • 20GB of disk space
  • Dedicated Public IP Address
  1. Login to the VPS provider website and configure the external firewall to allow SSH port 22 and the Rupaya Wallet TCP port 9050.
  2. Document the IP address of the VPS that you just created. This will be used in the next section to connect to the server.

Connect to and Configure a Linux VPS

  1. Login to the Linux VPS, via SSH, as the root user.

    • When connecting to the Linux VPS, you will need an SSH client, such as Putty, if you want to have copy and paste functionality. Otherwise you will have to type all of the following commands out manually!
    • If you need assistance using SSH, to connect to the VPS, then please refer to the SSH: Getting Started with an SSH client and SSH Keys section of the guide.
  2. Install Linux updates. Run the following commands one at a time:

    apt install make
    apt install aptitude -y
    apt-get update -y
    apt-get upgrade -y
    
  • NOTE: If a pop up window appears asking “What would you like to do about menu.list?” then select the option: keep the local version currently installed
  1. OPTIONAL STEP: Install fail2ban and create modifiable configs for fail2ban and its jail settings. Run these commands one at a time to install basic ssh protection with fail2ban:

    apt-get install fail2ban -y
    cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
    cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
    
  1. OPTIONAL STEP: Install tzdata. Run the following command to install the application that will allow you to select your clock timezone:

    apt install tzdata
    
  2. OPTIONAL STEP: Set your time zone. Run the following command to set your preferred time zone:

    dpkg-reconfigure tzdata
    
  3. Configure a virtual swap space on the VPS to avoid running out of memory:

    fallocate -l 3000M /mnt/3000MB.swap
    dd if=/dev/zero of=/mnt/3000MB.swap bs=1024 count=3072000
    mkswap /mnt/3000MB.swap
    swapon /mnt/3000MB.swap
    chmod 600 /mnt/3000MB.swap
    echo '/mnt/3000MB.swap  none  swap  sw 0  0' >> /etc/fstab
    
  4. Configure the VPS internal firewall to allow SSH port 22 and the Rupaya Wallet port 9050:

    apt-get -qq install ufw
    ufw default deny incoming
    ufw default allow outgoing
    ufw allow 22/tcp
    ufw limit 22/tcp
    ufw allow 9050/tcp
    ufw logging on
    ufw --force enable
    
  5. Reboot the Linux VPS:

    reboot
    
  6. Reconnect to the Linux VPS and login as root.

    • NOTE: It will take 2 to 3 minutes for the VPS to reboot.

Create a New User and Login as rupxmn

OPTIONAL STEP: The following steps (1 - 3) are optional. These steps are strongly recommended for those that want to implement security best practices. These steps are recommended so that the Hot wallet is not installed under the root user account.

  • All further instructions will use rupxmn as the user.
  • This step is necessary for those that want to run more than 1 Rupaya wallet on this VPS.
  1. Create a new user named rupxmn and assign a password to the new user:

    useradd -m -s /bin/bash rupxmn
    passwd rupxmn
    
  • Type in a new password, as you are prompted, two times. Be sure to save this password somewhere safe, as you will need it to manage the MasterNode Hot wallet.
  1. Grant root access to the new user rupxmn:

    usermod -aG sudo rupxmn
    
  2. Login as the new user rupxmn:

    login rupxmn
    

Download and Configure the Rupaya Hot wallet

  1. Download Rupaya wallet:

    wget https://github.com/rupaya-project/rupx/releases/download/v5.2.0/rupaya-5.2.0-x86_64-linux-gnu.tar.gz
    
  2. Extract the wallet binaries:

    tar -xvf rupaya-5.2.0-x86_64-linux-gnu.tar.gz --strip-components 2
    
  3. Delete the unneccessary file:

    rm rupaya-5.2.0-x86_64-linux-gnu.tar.gz
    
  4. Move the rupayad and rupaya-cli files to the /usr/local/bin/ directory:

    sudo mv rupayad rupaya-cli /usr/local/bin/
    
  5. Start the Hot wallet service. When the service starts, it will create the initial data directory ~/.rupayacore/:

    rupayad -daemon
    
  6. Generate the MasterNode private key (aka GenKey). Wait a few seconds after starting the wallet service and then run this command to generate the masternode private key:

    rupaya-cli masternode genkey
    
  7. Copy and save the MasterNode private key (GenKey) from the previous command to be used later in the process. The value returned should look similar to the below example:

    87LBTcfgkepEddWNFrJcut76rFp9wQG6rgbqPhqHWGvy13A9hJK
  8. Stop the Hot wallet with the rupaya-cli stop command:

    rupaya-cli stop
    
  1. Copy the following rupaya.conf template, paste it into a text editor, and update the variables manually. All variables that need to be updated manually are identified with the <> symbols around them:
  • Use the following template for IPv4 IP Addresses:

    rpcuser=rupayarpc
    rpcpassword=<alphanumeric_rpc_password>
    rpcport=7050
    rpcallowip=127.0.0.1
    rpcconnect=127.0.0.1
    rpcbind=127.0.0.1
    maxconnections=512
    listen=1
    daemon=1
    masternode=1
    externalip=<public_mn_ip_address_here>:9050
    masternodeaddr=<public_mn_ip_address_here>
    bind=<public_mn_ip_address_here>
    masternodeprivkey=<your_masternode_genkey_output>
    
  • Use the following template for IPv6 IP Addresses:

    rpcuser=rupayarpc
    rpcpassword=<alphanumeric_rpc_password>
    rpcport=7050
    rpcallowip=127.0.0.1
    rpcconnect=127.0.0.1
    rpcbind=127.0.0.1
    maxconnections=512
    listen=1
    daemon=1
    masternode=1
    externalip=[<public_mn_ip_address_here>]:9050
    masternodeaddr=[<public_mn_ip_address_here>]
    bind=[<public_mn_ip_address_here>]
    masternodeprivkey=<your_masternode_genkey_output>
    
  • Update the variable after rpcpassword= with a 40 character RPC rpcpassword.

  • You will need to generate the rpcpassword yourself.

  • Use the ifconfig command, on the Linux VPS, to find out your Linux VPS IP address. It is normally the address listed after the eth0 interface after the word inet addr:

  • Save your Linux VPS IP address as we are going to use this IP again in the Cold wallet setup

  • Update the variable after externalip= with your Linux VPS IP. Ensure that there are no spaces between the IP address and the port :9050

  • Update the variable after masternodeaddr= with your Linux VPS IP

  • Update the variable after bind= with your Linux VPS IP

  • Update the variable after masternodeprivkey= with your MasterNode private key (GenKey)

  • Once all of the fields have been updated in the text editor, copy the template into your clipboard to be used in the next steps.

  1. Edit the MasterNode Hot wallet configuration file ~/.rupayacore/rupaya.conf:

    nano ~/.rupayacore/rupaya.conf
    
  2. Paste the updated template into the rupaya.conf configuration file on the Linux VPS.

    • You can right click in Putty to paste the template into the configuration file.
    • The rpcpassword, IP address (199.247.10.25 in this example), and masternodeprivkey will all be different for you.
  • This is an example of a rupaya.conf file, using IPv4 addresses:

    rpcuser=rupxuser
    rpcpassword=someSUPERsecurePASSWORD3746375620
    rpcport=7050
    rpcallowip=127.0.0.1
    rpcconnect=127.0.0.1
    rpcbind=127.0.0.1
    maxconnections=512
    listen=1
    daemon=1
    masternode=1
    externalip=199.247.10.25:9050
    masternodeaddr=199.247.10.25
    bind=199.247.10.25
    masternodeprivkey=87LBTcfgkepEddWNFrJcut76rFp9wQG6rgbqPhqHWGvy13A9hJK
    
  • This is an example of a rupaya.conf file, using IPv6 addresses. The brackets [] around the IPv6 addresses are required:

    rpcuser=rupxuser
    rpcpassword=someSUPERsecurePASSWORD3746375620
    rpcport=7050
    rpcallowip=127.0.0.1
    rpcconnect=127.0.0.1
    rpcbind=127.0.0.1
    maxconnections=512
    listen=1
    daemon=1
    masternode=1
    externalip=[2001:19f0:5:5e83:5400:01ff:fedf:1]:9050
    masternodeaddr=[2001:19f0:5:5e83:5400:01ff:fedf:1]
    bind=[2001:19f0:5:5e83:5400:01ff:fedf:1]
    masternodeprivkey=87LBTcfgkepEddWNFrJcut76rFp9wQG6rgbqPhqHWGvy13A9hJK
    
  1. Save and exit the file by typing CTRL+X and hit Y + ENTER to save your changes.

  2. Restart the Hot wallet with the rupayad -daemon command:

    rupayad -daemon
    

Download the Bootstrap from a Linux VPS Using a Bash Script

OPTIONAL STEP: This section is intended for those that want to install the bootstrap on a Linux VPS using a bash script, which will automate the process.

  1. Login to the Linux VPS as the user that will be running the wallet.
  2. Run the following commands, one at a time, to download and run the bash script:
  • For those running the wallet as the user rupxmn, use the following commands:

    wget https://raw.githubusercontent.com/BlockchainBrain/Rupaya_Bootstrap/master/rupxmn-bootstrap.sh
    bash rupxmn-bootstrap.sh
    
  • For those running the wallet as the user root, use the following commands:

    wget https://raw.githubusercontent.com/BlockchainBrain/Rupaya_Bootstrap/master/root-bootstrap.sh
    bash root-bootstrap.sh
    
  1. Verify that the wallet is running and that the block count is above 177000:

    rupaya-cli getinfo
    
  • NOTE: It may take a few minutes for connections to begin to establish. Don’t be alarmed if the initial output shows “blocks”: -1

Download the Bootstrap Manually from the Linux VPS

OPTIONAL STEP: This section is intended for those that want to manually install the bootstrap on a Linux VPS. YOU DO NOT NEED TO REPEAT THIS STEP IF YOU ALREADY INSTALLED THE BOOTSTRAP USING THE BASH SCRIPT.

  1. Login to the Linux VPS as the user that will be running the wallet.

  2. Close the Rupaya wallet:

    rupaya-cli stop && sleep 10
    
  3. Run the following commands to delete the old rupayacore files and folders:

    cp ~/.rupayacore/rupaya.conf .
    sudo rm -rf ~/.rupayacore
    mkdir ~/.rupayacore
    mv rupaya.conf ~/.rupayacore/.
    
  4. Run the following command to download the bootstrap:

    wget https://rupaya.ams3.cdn.digitaloceanspaces.com/bootstrap/rupx-bootstrap.tar.gz
    
  5. Extract the bootstrap folders and files into the .rupayacore folder:

    tar xf rupx-bootstrap.tar.gz -C ~/
    
  6. Restart the wallet:

    rupayad -daemon
    
  7. Delete the bootstrap.zip file:

    rm rupx-bootstrap.tar.gz
    

Verify the Hot wallet is synchronizing with the blockchain

  1. Run the rupaya-cli getinfo command to make sure that you see active connections:

    rupaya-cli getinfo
    
  • NOTE: It may take a few minutes for connections to begin to establish. Don’t be alarmed if the initial output shows “blocks”: -1
  1. Run the rupaya-cli getblockcount command every few minutes until you see the blocks increasing:

    rupaya-cli getblockcount
    
  • NOTE: If your block count is NOT increasing then you will need to stop the Hot wallet with the rupaya-cli stop command and then reindex with the rupayad -reindex command.
  • NOTE: If you did the reindex and you continue to have issues with establishing connections then check that the VPS provider external firewall is setup correctly to allow TCP port 9050 from anywhere. If that is not setup correctly then you will not be able to proceed beyond this step.

If your block count is indeed increasing, then you can proceed to the next step to setup the Cold wallet.