Masternode setup manual


Create single transaction with 50,000 Urals

In the windows wallet open debug window by navigating to Tools->Debug Console

Inside debug console run the following commands

# generate a new address
getnewaddress mn01

# you can send Urals from the wallet UI on the 'send' tab 
# or using the following command in the debug console:
sendtoaddress "UralsAddressFromPrevCommand" 50000
                    

Generate masternode key

Save the output from the following commands into a text file to use later

# this is the private key for the masternode
masternode genkey

# this has the transaction_id and the vout
masternode outputs
                    

Create and configure a VPS (you can use any VPS, Linode just for sample)

Go to Linode.com and create an account.

Once in your account do the following:

  1. Add a new linode by finding Add a Linode link under the Linodes tab
  2. Choose the Linode 1024 Nanode Instance ($5 plan), choose a location and click Add this Linode
  3. Once created go to the Dashboard for that linode
  4. Click Deploy an Image
  5. Select Ubuntu 16.04 LTS from the Image dropdown
  6. You can use defaults for the other options but make sure to set a strong root password
  7. Back on the Linode Dashboard select Boot to start the linode
  8. Navigate to the Remote Access tab and note the ssh command from SSH Access. This is how you will log in to the server

SSH into the linode using Putty (from Windows)

Use Putty to ssh into your Linode

SSH with putty

Create urals user

# run the adduser command and follow onscreen prompts to create new user
# make sure to use a strong password
adduser urals

# add urals to sudo group
usermod -aG sudo urals
# switch to urals user
su urals
                    

Install necessary dependencies

sudo apt-get install -y build-essential libtool autotools-dev autoconf automake \
    libssl-dev libevent-dev libboost-all-dev software-properties-common \
    git wget ntp make g++ gcc autoconf cpp sysstat unzip vim

# add bitcoin repository
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install libdb4.8-dev libdb4.8++-dev
sudo apt-get -y install miniupnpc*-dev
                    

Install up to date Urals Wallet on VPS

Option 1 (recommended):

Download a precompiled wallet from the github repository. Right click on the latest linux_x64.tar.gz and Copy link address to use in the wget command below

On the Linode VPS:

# wget the latest version
wget https://github.com/JohnMnemonick/UralsCoin/files/1691752/urals-ubuntu-16.04_x64.tar.gz

# extract the tarball file
tar -xvf urals-ubuntu-16.04_x64.tar.gz

# move the urals files to /usr/sbin so we can run them from anywhere (optional)
sudo mv urals-cli uralsd -t /usr/sbin
                    

Option 2

Install from source

# Create swapfile
sudo fallocate -l 512M /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo su -
echo '/swapfile none swap defaults 0 0' >> /etc/fstab

# Clone URALS wallet
git clone https://github.com/JohnMnemonick/UralsCoin.git; cd UralsCoin
sudo apt-get install pkg-config bsdmainutils

# Build wallet from source
./autogen.sh
./configure
make

### Move urals-cli and uralsd to /usr/sbin to be runnable anywhere (optional)
sudo mv src/urals-cli src/uralsd -t /usr/sbin
                    

Turn on ntp service for time synchronization

update-rc.d ntp enable

Create or modify urals.conf in ~/.urals/

nano ~/.urals/urals.conf

rpcuser=uralsrpcuser
rpcpassword=enteryourpasswordhere
rpcallowip=127.0.0.1
maxconnections=256
listen=1
server=1
daemon=1
masternode=1
promode=1
# use the key from the genkey command on the Windows wallet
masternodeprivkey=genkey here
# here specify the ip address of your vps instead of x
externalip=xxx.xxx.xxx.xxx:7444
                    

Create cronjob to start urals

Run crontab -e and put the following text at the bottom of the file to make sure the wallet is restarted on reboot

@reboot /usr/sbin/uralsd -shrinkdebugfile
*/20 * * * * /usr/sbin/uralsd
                    

Start Urals daemon

Log out and log back in to the urals user.

exit
su urals
                    

Start the urals daemon by running uralsd

While we wait for the blockchain to sync we can configure the masternode in the Windows wallet


Create masternode.conf file for Windows wallet

In Windows navigate to the Urals folder C:\Users\username\AppData\Roaming\Urals create a file called masternode.conf

Put the following information in one line using the genkey, transaction_id and vout that we gathered when we created the new address for the masternode.

alias ip:7444 masternodegenkey transaction_id vout

Example:

mn01 45.33.55.181:7444 7rHEfbvyztZbQFG45jrYtTrG5jE5EjFo5EYgoZxetvqnNEqYzgz 84eef4959b6e685b6736bc58e0082d7aa58c82928ce5ce56bf2d008b42302f14 0
                    

After creating the masternode.conf file restart the wallet

Unlock transaction

We will need to unlock our large transaction in order to start the masternode. Navigate to Settings->Options and go to the Wallet tab.

  1. Find the enable coin control features and make sure it is enabled
  2. ❍ [x] Enable coin control features
  3. Go to the Send tab in the main wallet.
  4. Click on the down arrow on the transaction that has the 50,000 Urals.
  5. Right click and select Unlock Unspent

Start the masternode

Navigate to the debug console again: Tools->Debug Console

Run the following command to start the masternode:

masternode start-many

Test masternode is running

In the Windows wallet debug console run:

masternodelist

Make sure your ip address shows up in the list


On the VPS:

cd ~/.urals/
cat debug.log | grep "CActiveMasternode"
# look for a line that looks like this:
CActiveMasternode::EnableHotColdMasterNode() - Enabled! You may shut down the cold daemon.
                    

You are now done. You can close your Windows wallet and the masternode will continue to run.