NEW!!

MNPCOIN MASTERNODE SCRIPT!

Masternode Setup

Single masternode on Linux VPS (Ubuntu 16.04)+ control wallet on local PC (Windows)

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:

-10,000 MNPCoin as collateral (10000 MNPCoin + 1 MNPCoin to cover the transaction fees)

-A local computer running under Windows 7, 8.1 or 10 which will be our control wallet.

-PuTTY, which will be used to setup the server (install the dependencies, the wallet itself, and configure everything) after the initial configuration.

-An Ubuntu server, preferably a Virtual Private Server (VPS)
with 2gb ram or larger (Needed to compile the wallet)

-The IP address of your Ubuntu server

-Port 13371 open to your Ubuntu server

This guide also assumes you will be working from the MNPCoin 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 MNPCoin Qt (GUI wallet) as your local wallet and the Ubuntu machine (VPS) that will host your masternode as your remote wallet.

Plan of action:

1- Buy VPS service and setup Ubuntu (Ubuntu 16.04) on it. You’ll need to have one CPU and at least 2GB of RAM on it to be able to compile and run the wallet.
2 - Download PuTTY here http://www.putty.org/, install it, run it and connect to your server.
3 - Login as root, update Ubuntu and install all the dependencies.
4 - Compile and install the wallet from sources.
5 - Download MNPCoin Windows Wallet from http://mnpcoin.pro/ and set up the installation.
6 - Setup our masternode and our control wallet 🙂

Follow the steps below in order.

Setting up a masternode

Step 1:Install your local Wallet and turn off zeromint
1.Install wallet in your PC (http://mnpcoin.pro/)
2.Pay 10000 MNP to yourself
Make sure you have a little more than 10000 MNP in your balance.
Pay exactly 10000 MNP to yourself. When you make transaction you pay a small fee, this is the reason you need a little more than 10000 MNP.
To make transaction:
a) Go to File -> Receiving Addresses
b) Click on «New» and give label name, something like «For_my_masternode_1» and click «Ok». Select the created address and click «copy».
c) On your main window go to «Send» tab. Paste the copied address to address box. Type 10000 for «Amount» box. Do not select «Subtract fee from amount» checkbox. Send the coin.
Now it will take some time until this transaction is confirmed.

Turn off zeromint in your local wallet

  1. Shutdown your wallet
  2. Go to your data directory and edit mnpcoin.conf
  3. Add the following line, save and start your wallet again:
    enablezeromint=0
    zeromintpercentage=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 genkey, which we’ll use later in the setup):
    masternode genkey
    Write the response down somewhere safe.
    You should see an output that looks like this:
    7gb6HNz8gRwVwKZLMGQ6XEaLjzPoxUNK4ui3Pig6mXA6RZ8xhsn

Step 3: 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 10,000):
    masternode outputs
    Write the response down somewhere safe.
    You should see an output that looks like this:
    {
    “txhash” : “49012766543cac37369cf3813d6216bdddc1b9a8ed03ac690221be10aa5edd6c”,
    “outputidx” : 1
    }
    ]
    The“outputidx” :can be 0 or 1.

Step 4: 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>:13371 <The privkey from Step 2> <The txhash from Step 3> <The outputidx from Step 3>
    Substitute it with your own values and without the “<>”.

Example:
masternode01 139.14.135.195:13371 7gb6HNz8gRwVwKZLMGQ6XEaLjzPoxUNK4ui3Pig6mXA6RZ8xhsn 49012766543cac37369cf3813d6216bdddc1b9a8ed03ac690221be10aa5edd6c 1

Step 5: Install MNPCoin client on your remote wallet

Download PuTTY here http://www.putty.org/, install it then run it. Fill the Host Name field with your server’s IP. Click on the open button to connect and access to the terminal. Use the default port (22). You don’t need to change any option. An error message may appears, ignore it.
Use login details from your VPS provider to access the server, update Ubuntu then install all necessary libraries to either be able to compile the wallet or run it.

Important: in Linux to copy a text we use buttons Ctrl+Insert and to paste Shift+Insert - [Ctrl+C/V won’t work] please use these buttons from now on. Paste into the terminal window following commands and hit Enter to confirm. Commands are in blue font - copy and paste only these into your terminal window.

sudo apt-get update & sudo apt-get upgrade
sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-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 libboost-all-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libevent-dev

Step 6: Create a Swap file and install Wallet

When entering these commands you will get no feedback, just enter them one by one, the changes happen.

cd
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Making Swap file permanent (optional): We have our swap file enabled, but when we reboot, the server will not automatically enable the file. We can change that by modifying the fstab file.

sudo nano /etc/fstab

At the bottom of the file, you need to add a line that will tell the operating system to automatically use the file you created:

/swapfile none swap sw 0 0

Save and exit the text editor. To exit NANO text editor press Ctrl+X and confirm changes. (Optional) You might need to reboot the system if ./autogen.sh command fails to run. Type: reboot and your session will terminate. Reconnect and continue with the guide.

Once we have all dependencies we can download and compile the wallet:

sudo apt-get install git
cd ~
git clone https://github.com/MasterNodesPro/MNPCoin.git
cd MNPCoin
sudo apt-get install automake
./autogen.sh
./configure
make (this can take awhile and some warning messages will be shown it’s perfectly normal)

Step 7: Configure the masternode on your remote wallet

Now we have all the data needed from our control wallet, we need to configure our masternode.

  1. Edit mnpcoin.conf in the data dir
    nano /root/.mnpcoin/mnpcoin.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):13371
masternodeprivkey=(The masternode genkey from Step 2)
addnode=45.76.127.223
addnode=45.32.137.248
addnode=72.161.0.178
addnode=199.223.253.96
addnode=209.250.245.68
addnode=45.77.242.133
addnode=45.77.226.195
addnode=144.202.22.53
addnode=89.39.107.204
addnode=68.12.123.88

Make sure to replace rpcuser and rpcpassword with your own.

  1. Start MNPCoin on your VPS

cd
cd MNPCoin
cd src
./mnpcoind

Verify that the wallet is synching the blockchain:
Run this command every few mins until you see the blocks increasing.

./mnpcoin-cli getinfo

Step 8: 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” : “”
}
Or if you have multiple masternodes and want to start all at once:

startmasternode all 0

  1. Start the masternode on your remote wallet:

./mnpcoind &
./mnpcoin-cli startmasternode local false
A message “masternode successfully started” should appear

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

./mnpcoin-cli masternode status

You should see something like:
{
“txhash” : “49012766543cac37369cf3813d6216bdddc1b9a8ed03ac690221be10aa5edd6c”,
“outputidx” : 1,
“netaddr” : “139.14.135.195:13371”,
“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 mnpcoin.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
./mnpcoin-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 4 from your masternode.conf
  3. Start your wallet again
  4. Your 10,000 MNP will now be unlocked

Allow SSH and MasterNode p2p communication port through the OS firewall:

ufw allow 22/tcp
ufw limit 22/tcp
ufw allow 13371/tcp
ufw logging on
ufw --force enable

If you are running the MasterNode server in Amazon AWS or if additional firewalls are in place, you need to allow incoming connections on port TCP 13371 from any IP address.

Useful commands in ubuntu

./mnpcoind
./mnpcoin-cli stop
./mnpcoin-cli getinfo
./mnpcoin-cli reindex
./mnpcoin-cli mnsync status
./mnpcoin-cli masternode status
./mnpcoin-cli masternode genkey
pkill -9 -f mnpcoind (to Kill the Process)

If you have questions or changes please contact me in Discord!

MNPCoin Discord: https://discord.gg/8memsN3

User:Sido#5191

Cheers!