Author Topic: Linux Masternode !! In work - Please read Windows Setup  (Read 1083 times)

limxdev

  • Administrator
  • Jr. Member
  • *****
  • Posts: 64
    • View Profile
Linux Masternode !! In work - Please read Windows Setup
« on: April 22, 2015, 04:20:01 PM »
PREPARATION OF REMOTE / LINUX SERVER:

Create a Vultr.com account & login. Bitcoin payment accepted!

Click Deploy New Instance
Select server type: Performance
Select datacenter location: any you wish, if you have more than one try to spread them around the world.
Select OS: I recommend ubuntu 14.04, 64-bit! Precompiled limecoinxd and limecoinx-qt binaries work on all LTS 64-bit ubuntus (but not on CentOS 6/5)...
Select server size: minimum configuration (1 CPU / 768MB RAM) for $5/month works perfectly.

It will take 30 seconds for server to come online. Click “My Servers” tab, and “Manage” button server is active, click “View Console”, and login with supplied root password (listed below). Note, that you also see IP address for the server here.








First thing to do is change the root password, and create a new user under which limx daemon will run (for example limx123456789):

passwd root

adduser limx

passwd limx123456789

In order to be able to copy/paste into server, I suggest you now connect to server via PuTTY or other SSH client.

Login with newly created normal user, then enter:
su –

 to become root, then secure your server.

At minimum, use IPTABLES to close inbound ports with exception of 22 and 9999. To do this use the VI editor with this command:

vi firewall.sh

For help google VI editor commands (ESC+key sequences) Copy/paste the following code into file. :
-----
IIP=`/sbin/ifconfig eth0 |sed --silent 's/.*inet addr:\(.*\) \ Bcast.*/\1/p'`
IPTABLES="/sbin/iptables"
echo "Activating firewall for $IIP"
echo 0 > /proc/sys/net/ipv4/ip_forward
$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F
$IPTABLES -X
$IPTABLES -t nat -X
$IPTABLES -t mangle -X
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP

$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A OUTPUT -o lo -j ACCEPT
$IPTABLES -A INPUT -s $IIP/32 -j ACCEPT
$IPTABLES -A OUTPUT -s $IIP/32 -j ACCEPT
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

$IPTABLES -A INPUT -d $IIP/32 -m multiport -p tcp --ports "22,8886" -j ACCEPT
$IPTABLES -A OUTPUT -s $IIP/32 -m multiport -p tcp --ports "22,8886" -j ACCEPT
-----

And run it:
chmod +x firewall.sh
./firewall.sh

Later, when everything is running, you can for additional security do the following:
* If you have static IP at home, you can leave port 22 (ssh) open only for your static IP (google it how).
* If you dont have static IP, I suggest you install something like knock (http://www.zeroflux.org/projects/knock).
* Or you can even close the port 22 completely, as you can always reach machine thru vultr’s web management, with View Console.

Enter:
exit
to go back to normal user.

download the file to linux http://sourceforge.net/projects/limx/files/limx-linux64.zip/download


uncompress in home folder and copy the limecoinxd daemon binary into your home directory, and make it executable:

mv limx-linux64/bin/64/limecoinxd .
chmod +x ./limecoinxd

Create new file .limecoinx/limecoinx.conf file:

vi .limecoinx/limecoinx.conf

and paste the following in it:
---------
rpcuser=enter-new-LONG-RANDOM-STRING-fisjfijyou_should_change_this
rpcpassword=enter-new-LONGER-RANDOM-STRING-fissjfijyou_should_change_this
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
masternodeprivkey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
addnode=85.214.68.75

------------
But substitute the long XXXXXXXXXXXXXXXXXXXXXXXX string, with your privkey (obtained from windows local machine.

Make it read only for additional security:
chmod 444 limecoinx.conf

run limecoinxd daemon:
./limecoinxd


run:
./limecoinxd getinfo

Repeat command, until you see that daemon synced itself with limecoinx network (should take a few minutes). Compare block number of getinfo output with last block number listed here: http://blockexperts.com/limx



Once your linux shows the same block number as the website, you have completed the linux part. You can leave console/putty open, but in order to complete setup, you need to enter come commands on your Windows PC. With commands there, you will initiate connection from your funded wallet (5000 LIMX balance), which will enable masternode on linux.

Now go to linux console/putty again, and issue the command:
grep HotCold .limecoinx/debug.log

if you see a line with Enabled in string, then linux masternode is enabled (activated from funded windows wallet!).
Now you can check whether your linux server is listed in list of active masternodes, with command:
./limecoinxd masternode list | grep YOURIP

And if your IP is listed with :1 at the end, then you are up and running, and should expect first masternode payment soon! :D