How to setup a Machinecoin Masternode

Machinecoin Masternode Server Center

How to setup a Machinecoin Masternode

Please backup your wallet before doing any of the steps below.
First of all, make sure the requirements for setting up a Masternode are meet
1

Make sure you’ve your 25000 MAC colleteral at your local wallet

2

Make sure your wallet is updated to the latest version (min. 0.16.0)

3

Make sure your wallet is fully synced with the network

The guide is splitted into 3 parts
Step 1.1 — Create a text file with the given layout
Masternode:

Private Key:
Address:
Transaction:
Output:
IP:
Step 1.2 — Generate a private key for your Masternode

Open up the console by clicking on “Help” → “Debug window” → “Console”.

Into the console, enter:

masternode genkey

which should output a long string (as you can see on the image on the left).

This is your Masternodes private key, please write it down to your text file into the “Private Key” field.

Step 1.3 — Get the public address of your Masternode

You should still have the console window opened from Step 1.2

Now enter into the console:

getaccountaddress "mymasternode1"

which should output a Machinecoin address (prefixed with a “3” or “9”.

(Feel free to rename “mymasternode1” to anything else)

This is your Masternodes public address, please write it down to your text file into the “Address” field.

Step 1.4 — Transfer your 25000 Machinecoins

Please proceed this step carefully!

You should still have the console window opened from Step 1.2

Now enter into the console:

sendtoaddress "address" 25000

which should output a transaction ID (long string).

(Make sure to replace “address” by the address obtained from Step 1.3)

This is your colleteral transaction ID, please write it down to your text file into the “Transaction” field.

Step 1.5 — Find the right output of your transaction

You should still have the console window opened from Step 1.2

Now enter into the console:

masternode outputs

which should output a list of transaction IDs and a number behind them (long strings).

(You may need to wait for 1 confirmation)

You’ll need to locate your transaction ID from Step 1.4 inside the list and get the number written behind it.

This is your colleteral transaction output, please write it down to your text file into the “Output” field.

Step 2.1 — Setup your remote server

There are many sites out there to rent a server.

I’m going to use a server from Scaleway in this guide with

  • 2 GB RAM
  • 2 CPU cores (x64)

Please make sure to setup a server using Ubuntu Xenial (16.04) as operation system if you want to follow this guide 1:1, since setup instructions can be different for other Linux systems.

Step 2.2 — Obtain the servers IP

Your servers IP address is most likely displayed on it’s dashboard or in the server overview.

For me it’s display in both.

The IP should gave a format like “XXX.XXX.XXX.XXX” or “XX.XX.XXX.XXX”.

Please write it down to your text file into the “IP” field.

Step 2.3 — Connect to your server using SSH

In order to connect to your server, you’ll need a SSH client.

I’m going to use PuTTY in this guide.

(At Scaleway, server authentification is done using SSH keys, but other server providers most likely sent you a mail containing the servers password)

Open up PuTTY and enter the IP obtained in Step 2.2 into the “Hostname / IP” field.

Now click “Open” and you should end up with a black window and a output similar too:

[email protected]:~#

(If you get asked for a username, it’s most likely “root” or provided inside the mail)

Step 2.4 — Prepare the server to compile Machinecoin core

Into the SSH shell (this is how the black window is called), enter the following commands in a row:

Those should all work without any errors.

sudo apt-get update
sudo apt-get install git nano python-virtualenv build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 software-properties-common
 sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev

(Most of those command require to press enter or decide for Yes or No [y/n] followed by an ENTER)

Step 2.5 — Add another user for running Machinecoin

Into the SSH shell, enter the following commands in a row:

adduser machinecoin

(This will prompt you to enter a password for the new user “machinecoin”, everything else asked for can get skipped with an ENTER)

su - machinecoin

(This will switch the user to “machinecoin“)

Step 2.6 — Get & compile Machinecoin core

You should now be logged in as user “machinecoin“.

Into the SSH shell, enter the following commands in a row:

git clone https://github.com/machinecoin-project/machinecoin-core
cd machinecoin-core
./autogen.sh
./configure --disable-tests --disable-bench
make

followed by

echo "export PATH=$PATH:/home/machinecoin/machinecoin-core/src" >> /home/machinecoin/.profile && source /home/machinecoin/.profile

(This process is going to take some time until it’s finished, so order some Pizza, drive to KFC, fire up a hookah or take a nap meanwhile)

Step 2.7 — Edit the Machinecoin config file

You should still be logged in as user “machinecoin“.

Into the SSH shell, enter the following commands in a row:

mkdir -p /home/machinecoin/.machinecoin
nano /home/machinecoin/.machinecoin/machinecoin.conf

and fill it with the following content:

# Auth #
rpcuser=XXXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1

# General #
listen=1
server=1
daemon=1
maxconnections=24

# Masternode #
masternode=1
masternodeprivkey=XXXXXXXXXXXXXXXXXXXXXXX
externalip=XXX.XXX.XXX.XXX

Make sure to edit the fields using the content of your text file.
Also change the value of “rpcuser” and “rpcpassword” to something secret.

(Navigation in the editor is done using the keyboard arrows)

Then save the file by pressing “CTRL + X“, followed by an “Y” and an ENTER.

Step 2.8 — Start up Machinecoin and wait until it’s synced

You should still be logged in as user “machinecoin“.

Into the SSH shell, enter the following command:

machinecoind

which should output:

Machinecoin Server starting

To track the progress of the blockchain download, you can go ahead an run:

watch -n 5 machinecoin-cli getblockchaininfo

and check it until the number of “blocks” isn’t changing (or changes very very slow) anymore.

(You can also compare the amount of blocks with the amount of blocks over here)

If you want to exit “watch”, go ahead and press CTRL + C.

If the block number is even, you’re ready to proceed to the next step.

Step 2.9 — Setup sentinel

You should still be logged in as user “machinecoin“.

Into the SSH shell, enter the following commands in a row:

cd /home/machinecoin && git clone https://github.com/machinecoin-project/sentinel && cd sentinel
virtualenv ./venv
./venv/bin/pip install -r requirements.txt

which downloads and install sentinel.
Then add a cronjob to execute sentinel each minute by running:

crontab -l | { cat; echo "* * * * * cd /home/machinecoin/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1"; } | crontab -
Step 3.1 — Edit your local Masternode config file

You should now be back at your local PC.

Depending on your operation system, you’ll need to find your Machinecoin Masternode config file.

  • Windows — %appdata%\Machinecoin\masternode.conf
  • Linux — ~/.machinecoin/masternode.conf
  • MacOS — ~/Library/Application Support/Machinecoin/masternode.conf

(Create the file if it doesn’t exist)

Into the file, you’ll need to enter your Masternode details using the following format:

mymasternode1 IP:40333 PRIVATE_KEY TRANSACTION OUTPUT

Example:

mymasternode1 51.15.240.197:40333 6zkQfwtTG8WH56ecgGHMLCXAF9oXEfnwr4DuqVsZGYb8FEmqNxo df3fce788a60a213a02507314b4f337b6a06665ff4727cc785003a80db484a58 1

Save & close the file.

Step 3.2 — Start your Masternode

You should still be back at your local PC.

Open up Machinecoin Core:

(Make sure the Masternode tab is activated by going to “Settings” → “Options” → “Wallet” and tick the according checkbox)

Now close the options window and went over to the Masternodes tab inside the wallet.

You should see your Masternode inside the list with the status “MISSING“.

Go ahead and right-click the entry, and select “start-alias“.

 

And that’s it, your Masternode is ready to go!

(You should frequently keep monitoring the status of your Masternode using your local wallet)

Related posts

Leave a comment

two + 10 =