can anyone please post a tutorial on how to setup masternode on ubuntu ?
I will. This guide will assume you have already built and installed 8bitd for a user on Ubuntu 16.04, and that your blockchain is already synced. If you have not achieved these yet, refer to the guide on pg 263 of this thread.
Start 8bitd:
Allow it some time to once again fully sync. Meanwhile, generate a new bitcoin address under account name "mn"
8bitd -cli getnewaddress mn
Send EXACTLY 112 8bit to this address. If you are sending from Cryptopia, you will need to send 113 8bit, as they have a 1 8bit/tx fee.
Now for the masternode setup.
1. Set a static ip for our computer. There are more than enough Ubuntu guides on this out there, so do a search. Remember the local ip chosen for the computer because it will be needed in a moment. You will need to restart networking or simply reboot after changing the /etc/network/interfaces file for static ip.
2. Make sure the ports you want 8bit to work through are open between the internet and your computer. If you have a router between your machine and the internet you will need to forward the port through your router. You may do this by logging into your router configuration page, by typing your router's local ip address into any web browser connected to the network. For example, I typed "192.168.0.1", some may be "10.0.0.1", etc. (you can run "ifconfig" in terminal to find the "Default Gateway" ip address, same thing). Log in. If you've never logged in before do a search engine search to find the default login credentials specific to your router, mine were username "admin" password "admin", for example. Now that you are in the router config, look for the "Forwarding" or "Port Forwarding" tab/section, and add a new rule to pass the port you choose on to your wallet computer. For the sake of this guide I will choose port 9991. You want to enter your port number into both service port and external port (unless you know what you are doing, I am just simplifying here), and then you want to provide the local ip address of the computer that will be running the masternode. Now open a second port to enable rpc, here I will use port 2222. So you may have forwarded 2 ports of your computer. Make sure to enable these settings in the configuration before exiting. Phewph, that's that.
3. you want to open the actual ports on your Ubuntu machine now, using ufw:
(if you want rpc)
4. Go to whatsmyip.com and get your public ip address if you do not already know it. Write it down.
5. Go back to the terminal and type:
8bitd -cli masternode genkey
Copy the masternode private key, we'll need it shortly.
6. Now we need to edit the 8bit config file to enable the masternode service:
cd ~
sudo nano .8bit/8bit.conf
You want all the following either added or uncommented in your config file:
rpcallowip=127.0.0.1
rpcuser=YourUserName #can be anything
rpcpassword=YourRPCPassword #can be anything
rpcport=2222 #whatever you set it to in router config
server=1
daemon=1
listen=1
staking=0
port=9991 #whatever you set it to in router config
masternodeaddr=YOUR_PUBLIC_IP:9991
masternode=1
masternodeprivkey=KEY GENERATED BY COMMAND masternode genkey
Change the information specific to your needs (public ip, ports, mnprivkey, etc). Save and exit the editor.
7. Now we're going to stop 8bitd:
Give it a few moments to stop and then start it up again:
If you get an error, you probably just did not give it enough time to close fully before restarting.
Let the wallet sync, check if the 112 8bit has arrived yet, and to see if you are fully synced:
The 112 8bit need 16 confirmations in order to successfully start the masternode, you can check on the block explorer or by using the command:
8bitd -cli gettransaction entertransactionhashhere
8. Once the 112 8bit have arrived and are confirmed by at least 16 nodes, only one command remains:
8bitd -cli masternode start
There you go.
You ought to see the following output:
Masternode started successfully
or, oddly, sometimes:
Masternode started remotely
Pat yourself on the back.
8Sq5sDR5mHUEAtsJoJurrjUSu7E3QsCuop