Setting up a masternode - TeamLoonie/Loonie-coin GitHub Wiki

Setting up a masternode requires a basic understanding of Linux and blockchain technology, as well as an ability to follow instructions closely. It also requires regular maintenance and careful security.

Before you begin

This guide assumes you are setting up a masternode for the first time. You will need:

  • 50000 Loonie
  • A wallet to store your Loonie (e.g. Loonie Core wallet)
  • An Ubuntu server, preferably a Virtual Private Server (VPS)
  • You know the IP of your Ubuntu server

This guide also assumes you will be working from the Loonie Qt (GUI wallet) on your local computer.

Because this guide assumes you will run a masternode from a second machine, being the Ubuntu server, this guide will refer to your existing Loonie Qt (GUI wallet) as your local wallet and the Ubuntu machine (VPS) that will host your masternode as your remote wallet.

Follow the steps below in order.

Setting up a masternode

Step 1: Turn off zeromint in your local wallet

  1. Shutdown your wallet
  2. Go to your data directory and edit Loonie.conf
  3. Add the following line, save and start your wallet again:
enablezeromint=0

Step 2: Generate a masternode key on your local wallet

  1. Open the debug console (Tools > Debug console)
  2. Type the following command (this will be the masternode privkey, which we’ll use later in the setup):
masternode genkey

Write the response down somewhere safe.

Step 3: Generate a masternode address on your local wallet

  1. Open the debug console (Tools > Debug console)
  2. Type the following command:
getaccountaddress YourMasternodeName (e.g. masternode01)

Write the response down somewhere safe.

Step 4: Send 50000 LNI to the masternode address from your local wallet

Still in the local wallet, send 50000 LNI to the masternode address we just generated. Make sure to send exactly 50000 LNI to this new address.

Step 5: Confirm the masternode outputs in your local wallet

  1. Open the debug console (Tools > Debug console)
  2. Type the following command (This gets the proof of transaction of sending 50000):
masternode outputs

Write the response down somewhere safe.

Step 6: Configure the masternode on your local wallet

  1. Shutdown your wallet
  2. Go to your data directory and add the following line to masternode.conf:
<Name of your masternode> <IP address of your remote wallet>:39447 <The privkey from Step 2> <The txhash from Step 5> <The outputidx from Step 5>

Substitute it with your own values and without the “<>”.

Example:

masternode01 139.14.135.195:39447 7gb6HNz8gRwVwKZLMGQ6XEaLjzPoxUNK4ui3Pig6mXA6RZ8xhsn 49012766543cac37369cf3813d6216bdddc1b9a8ed03ac690221be10aa5edd6c 1

Step 7: Install Loonie client on your remote wallet

  1. Install the latest version of the Loonie wallet onto your Ubuntu VPS by running the following commands:
# Go to your home directory
cd ~
# Download the latest version from the Loonie GitHub repository (update this to
# the latest version)
wget https://github.com/TeamLoonie/Loonie-coin/releases/download/v1.0.0/Ubuntu16.04Xenial.tar.gz
# Unzip and extract 
tar -zxvf Ubuntu16.04Xenial.tar.gz.tar.gz
# Go to your Loonie bin directory
cd Loonie/bin
# Note: If this is the first time running the wallet in the VPS, you’ll need to  to start the wallet 
./Loonied &
# Stop the wallet after it initialises
./Loonie-cli stop

Step 8: Configure the masternode on your remote wallet

  1. Go to your data directory and edit Loonie.conf
  2. Add the following lines:
rpcuser=YourRandomUsername
rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
rpcallowip=127.0.0.1
listen=0
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
externalip=(The public IP of your remote wallet)
bind=(The public IP of your remote wallet)
masternodeaddr=(The public IP of your remote wallet):39447
masternodeprivkey=(The privkey from Step 2)

Make sure to replace rpcuser and rpcpassword with your own.

Step 9: Start the masternode

It is important you follow the steps in the exact order.

  1. Start the local wallet

  2. Start the remote wallet

  3. Type the following command in the local wallet debug console:

    startmasternode alias false <Name of your masternode>
    

    The following should appear:

    “overall” : “Successfully started 1 masternodes, failed to start 0, total 1”,
    “detail” : [
    {
    “alias” : “<Name of your masternode>”,
    “result” : “successful”,
    “error” : “”
    }
    
  4. Start the masternode on your remote wallet:

    ./Loonie-cli startmasternode local false
    

    A message “masternode successfully started” should appear

  5. Use the following command on your remote wallet to check status:

    ./Loonie-cli masternode status
    

    You should see something like:

    {
    “txhash” : “49012766543cac37369cf3813d6216bdddc1b9a8ed03ac690221be10aa5edd6c”,
    “outputidx” : 1,
    “netaddr” : “139.14.135.195:55002”,
    “addr” : “WXDiFihvtMq6v8B4wVu8btnGwEdyAGLnTP”,
    “status” : 4,
    “message” : “Masternode successfully started”
    }
    

Congratulations! You have successfully created your masternode!

Now the masternode setup is complete, you are safe to remove “enablezeromint=0” from the Loonie.conf file on your local wallet (reverting the change we made in Step 1).

Stop running a masternode

Step 1: Stop the masternode on your remote wallet

./Loonie-cli stop

Step 2: Remove the masternode configuration from your local wallet

  1. Shutdown your wallet
  2. Go to your data directory and remove the line that was created in Step 6 from your masternode.conf
  3. Start your wallet again
  4. Your 50000 LNI will now be unlocked