• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

TAO'S MASTERNODE SETUP GUIDE FOR DUMMIES (UPDATE GUIDE UPDATED FOR 13.0)

For updating the remote daemons, use the update script:

nano update.sh

Code:
#!/bin/sh
echo "########### This script will update the Master Node"
sleep 5
VERSION=64
URL=$1
FILE=${URL##*/}
DIR=${FILE%.tar.gz}
IP=$(hostname -I)
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./darkcoind stop
sleep 7
rm darkcoind
cp $DIR/bin/$VERSION/darkcoind .
chmod 755 darkcoind
rm $FILE
rm -rf $DIR
rm .darkcoin/peers.dat
echo "########### Restarting the updated Master Node"
sleep 30
./darkcoind
sleep 15
./darkcoind getinfo
sleep 20
echo "########### Master Node status - Active: 1, Inactive: 0"
./darkcoind masternode list | grep $IP

chmod 755 update.sh

Then to update:

./update.sh https://raw.githubusercontent.com/darkcoinproject/darkcoin-binaries/master/rc/darkcoin-0.10.15.13-linux.tar.gz

^^ or whatever is the latest release in *.tar.gz format.

You are correct, sir!

Correct, but not quite for dummies....You really love this nano thing, don't you?

Thanks for your contribution! Respect.
 
Tao, I finally got round to attempting this. I have got to the final command, masternode start. When I run this, I get a message saying...

you must set masternode=1 in the configuration

I have a darkcoin.conf in the correct location and it does have, on line 9, masternode=1. Can you help..?

EDIT: Tao, I restarted my machine and the masternode started successfully. Thanks so much for taking the time to do this. Will send you some coins over to show appreciation...
 
Last edited by a moderator:
Tao, I finally got round to attempting this. I have got to the final command, masternode start. When I run this, I get a message saying...

you must set masternode=1 in the configuration

I have a darkcoin.conf in the correct location and it does have, on line 9, masternode=1. Can you help..?

EDIT: Tao, I restarted my machine and the masternode started successfully. Thanks so much for taking the time to do this. Will send you some coins over to show appreciation...
calnaughtonjnr Great, I'm glad my guide helped you to build the Darkness! As far as gratuities, they are always appreciated.... Welcome to the MN club!
 
WITHDRAWING FUNDS FROM MASTERNODE WALLETS:

Q. "Hey Tao, I want to show you some DASH love! How can I send DASH from my node without messing it up?"

A. "You are going to need a feature called "Coin Control". This will allow you to specify where your withdrawals come from, so you will not touch your 1,000VIN."

Here's how you set it up:

Start your wallet.

Go to Settings, Options, and click on the 4th tab named "Display"

Check the box that says "Display Coin Control features (experts only)
That's right, you're now an expert! :grin:

Click OK, and you are ready to use the feature next time you send.

Sending without touching the 1,000VIN:

Go to your Send tab.

Click on the button that says "Inputs"

You will see a box with your wallet balance next to it. Click on the little arrow next to the box.

You will see all the deposits to your wallet, and your 1,000VIN should be at the top.

To send your full non-masternode affecting balance, click on the boxes next to ALL OTHER deposits.

Or, you could just click on as many as you need for a particular transaction.

Please note: Be careful not to select the 1,000VIN!

Please click OK.

You will be back to the main Send window.

The total number of selected deposits will show, as well as the total DRK amount.

Send anything up to and including the MAX amount that you saw in the previous step, making sure to uncheck the "Darksend" checkbox.

That's it! Your Masternode lives another day!:grin:

Thanks for using my guide,

Tao Of Satoshi

To return to the Masternode guide, click here:
https://darkcointalk.org/threads/taos-masternode-setup-guide-for-dummies.2680/
 
Last edited by a moderator:
Thank you for the guide! I seem to be having one issue though. I don't see any output when I enter "grep HotCold .darkcoin/debug.log" in my terminal in putty, and my node shuts down if I close my local wallet. What could be the issue?
 
Thank you for the guide! I seem to be having one issue though. I don't see any output when I enter "grep HotCold .darkcoin/debug.log" in my terminal in putty, and my node shuts down if I close my local wallet. What could be the issue?
Thanks for helping to build the Darkness! I'm sorry you're having issues. When you enter the HotCold command, what happens?
 
Vultr is a great choice! You can copy instances live to deploy new masternodes with minimal effort. If you're good with iptables, you can deploy 3 masternodes per instance by getting 3 IPs.
Example's please! You can't tease us with this goodness and then hold out the tables!
 
Absolutely nothing! A new command line appears.
Please stop your darkcoind on your remote server, wait a minute or two, restart it and then start on your local wallet. Then, run the line ./darkcoind masternode list / grep YOUR IP. Does your node show up there? If so, the HotCold command should work. Post your reply.
 
I did a full reinstall using your guide and got it to work, thank you for your help. I believe part of the problem was my local wallet not loading the .conf file - I realized this after starting over. :) Thank you again.
 
Ok, I've borrowed heavily from chaeplin's 5 MN setup guide:
https://darkcointalk.org/threads/ec2-multiple-remote-nothing-mn-max-5.1660/

You should refer to his guide for details on how to setup your user spaces ('ubuntu' and 'ubuntu2' in the iptables script below) and darkcoin.conf.
The following iptables script is useful on VULTR and currently works for 2 IPs. It's straightforward to see how to extend it to 3 IPs.

NOTE: Be sure to install the connection tracking module, conntrack. Like this:
$ sudo apt-get install conntrack

Copy the code below into a file called firewall_2ips.sh. Then change permissions to be executable.
$ chmod 755 firewall_2ips.sh

Then run the script as sudo:
$ sudo ./firewall_2ips.sh

Code:
#
IIP=`/sbin/ifconfig eth0 |sed --silent 's/.*inet addr:\(.*\) \ Bcast.*/\1/p'`
IIP2=`/sbin/ifconfig eth0:1 |sed --silent 's/.*inet addr:\(.*\) \ Bcast.*/\1/p'`
IPTABLES="/sbin/iptables"
echo "Activating firewall for $IIP and $IIP2"
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 -P INPUT DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -P OUTPUT DROP

# Add your spoofed IP range/IPs here
SPOOF_IPS="0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3"

#Accept loopback packets always
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A OUTPUT -o lo -j ACCEPT

# Filter out message fragments
$IPTABLES -A INPUT -f -j DROP
# Drop XMAS packets
$IPTABLES -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
#DROP null packets
$IPTABLES -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
# Drop packet that claiming from our own server on WAN port
$IPTABLES -A INPUT -i eth0 -s $IIP -j DROP

## Drop all spoofed
for ip in $SPOOF_IPS
do
$IPTABLES -A INPUT -i eth0 -s $ip -j DROP
$IPTABLES -A OUTPUT -o eth0 -s $ip -j DROP
done

#
$IPTABLES -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -m conntrack --ctstate INVALID -j DROP

$IPTABLES -A INPUT -p tcp --dport ssh -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 443 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 9998 -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -p tcp -m tcp --dport 9997 -j REJECT --reject-with tcp-reset
#
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP2 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP2 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j REJECT --reject-with tcp-reset
#
$IPTABLES -A INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 9999 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 9999 -j  ACCEPT
#
#
$IPTABLES -A OUTPUT -p udp -o eth0 -j ACCEPT
$IPTABLES -A OUTPUT -p icmp -o eth0 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport ssh -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport 443 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport 9999 -m conntrack --ctstate NEW -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport 9999 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --dport 9999 -j ACCEPT
#$IPTABLES -A OUTPUT -j ACCEPT
#COMMIT
#-----
#
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu  -p tcp --dport 9999 -j SNAT --to-source $IIP
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu2 -p tcp --dport 9999 -j SNAT --to-source $IIP2
#
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu  -p tcp --dport 443 -j SNAT --to-source $IIP
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu2 -p tcp --dport 443 -j SNAT --to-source $IIP2
#
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu  -p tcp --dport ssh -j SNAT --to-source $IIP
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu2 -p tcp --dport ssh -j SNAT --to-source $IIP2

Note that this script opens up the https port (port 443). This enables you to update masternode software easily. You may not want this port to be open. If that's the case, just comment out the lines with port 443 and those packets won't be accepted.
 
Last edited by a moderator:
I did a full reinstall using your guide and got it to work, thank you for your help. I believe part of the problem was my local wallet not loading the .conf file - I realized this after starting over. :) Thank you again.
Great, I'm happy this guide was able to help you out! Welcome to the MN Club!
 
Ok, I've borrowed heavily from chaeplin's 5 MN setup guide. You should refer to his guide for details on how to setup your user spaces ('ubuntu' and 'ubuntu2' in the iptables script below) and darkcoin.conf.
The following iptables script is useful on VULTR and currently works for 2 IPs. It's straightforward to see how to extend it to 3 IPs.

NOTE: Be sure to install the connection tracking module, conntrack. Like this:
$ sudo apt-get install conntrack

Copy the code below into a file called firewall_2ips.sh. Then change permissions to be executable.
$ chmod 755 firewall_2ips.sh

Then run the script as sudo:
$ sudo ./firewall_2ips.sh

Code:
#
IIP=`/sbin/ifconfig eth0 |sed --silent 's/.*inet addr:\(.*\) \ Bcast.*/\1/p'`
IIP2=`/sbin/ifconfig eth0:1 |sed --silent 's/.*inet addr:\(.*\) \ Bcast.*/\1/p'`
IPTABLES="/sbin/iptables"
echo "Activating firewall for $IIP and $IIP2"
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 -P INPUT DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -P OUTPUT DROP

# Add your spoofed IP range/IPs here
SPOOF_IPS="0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3"

#Accept loopback packets always
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A OUTPUT -o lo -j ACCEPT

# Filter out message fragments
$IPTABLES -A INPUT -f -j DROP
# Drop XMAS packets
$IPTABLES -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
#DROP null packets
$IPTABLES -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
# Drop packet that claiming from our own server on WAN port
$IPTABLES -A INPUT -i eth0 -s $IIP -j DROP

## Drop all spoofed
for ip in $SPOOF_IPS
do
$IPTABLES -A INPUT -i eth0 -s $ip -j DROP
$IPTABLES -A OUTPUT -o eth0 -s $ip -j DROP
done

#
$IPTABLES -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -m conntrack --ctstate INVALID -j DROP

$IPTABLES -A INPUT -p tcp --dport ssh -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 443 -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 9998 -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -p tcp -m tcp --dport 9997 -j REJECT --reject-with tcp-reset
#
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP2 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 8 --connlimit-mask 24 --connlimit-saddr -j REJECT --reject-with tcp-reset
$IPTABLES -A INPUT -i eth0 -p tcp -m tcp -d $IIP2 --dport 9999 --tcp-flags FIN,SYN,RST,ACK SYN -m connlimit --connlimit-above 2 --connlimit-mask 32 --connlimit-saddr -j REJECT --reject-with tcp-reset
#
$IPTABLES -A INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 9999 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 9999 -j  ACCEPT
#
#
$IPTABLES -A OUTPUT -p udp -o eth0 -j ACCEPT
$IPTABLES -A OUTPUT -p icmp -o eth0 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport ssh -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport 443 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport 9999 -m conntrack --ctstate NEW -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --sport 9999 -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -m tcp --dport 9999 -j ACCEPT
#$IPTABLES -A OUTPUT -j ACCEPT
#COMMIT
#-----
#
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu  -p tcp --dport 9999 -j SNAT --to-source $IIP
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu2 -p tcp --dport 9999 -j SNAT --to-source $IIP2
#
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu  -p tcp --dport 443 -j SNAT --to-source $IIP
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu2 -p tcp --dport 443 -j SNAT --to-source $IIP2
#
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu  -p tcp --dport ssh -j SNAT --to-source $IIP
$IPTABLES -t nat -A POSTROUTING -m owner --uid-owner ubuntu2 -p tcp --dport ssh -j SNAT --to-source $IIP2

Note that this script opens up the https port (port 443). This enables you to update masternode software easily. You may not want this port to be open. If that's the case, just comment out the lines with port 443 and those packets won't be accepted.

HinnomTX Thanks for this, I'm going to try it when I get a chance....
 
I'm considering to change the location of my VPS, by staying with Vultr but choosing another city in the world.
Is there an easy way to restart the masternode from another server (different IP, etc.)? In particular, can I keep the same wallet.dat?
Thanks again for your guide, Tao, and to everyone who contributed so far! It's been so useful already :)
 
I'm considering to change the location of my VPS, by staying with Vultr but choosing another city in the world.
Is there an easy way to restart the masternode from another server (different IP, etc.)? In particular, can I keep the same wallet.dat?
Thanks again for your guide, Tao, and to everyone who contributed so far! It's been so useful already :)
Cheers, dude! I'm happy my guide was useful to you! I recommend creating another address in the same wallet, sending your DRK there, and generating another MN key. Then, just follow the steps again from the VULTR post. (post 2). Any issues, please post back here!
 
calnaughtonjnr Great, I'm glad my guide helped you to build the Darkness! As far as gratuities, they are always appreciated.... Welcome to the MN club!

Hey Tao, I need your help, forget about my message above. I have tried to update my masternode but it still says after I restart the local computer that I need to put 1 in the Darkcoin.conf even though it already says masternode=1. What is wrong??

Also:
when do I need to put in the --reindex option in the updating process
Do I need to revert back to that saved darkcoind.old to get my masternode running again?

Well damn, I just checked again and it says it's still on the old version - 10.15.17 and I cannot find it with the ./darkcoind masternode list / grep xxxxxxx and is still saying when i try to start the masternode that i need to enter 1 into the Conf.

Please help Tao!
 
Last edited by a moderator:
Hey Tao, I need your help, forget about my message above. I have tried to update my masternode but it still says after I restart the local computer that I need to put 1 in the Darkcoin.conf even though it already says masternode=1. What is wrong??

Also:
when do I need to put in the --reindex option in the updating process
Do I need to revert back to that saved darkcoind.old to get my masternode running again?

Well damn, I just checked again and it says it's still on the old version - 10.15.17 and I cannot find it with the ./darkcoind masternode list / grep xxxxxxx and is still saying when i try to start the masternode that i need to enter 1 into the Conf.

Please help Tao!
I'll help you on Twitter.
 
I'll help you on Twitter.
Hey thanks again for the help Tao.
Now I'm looking to set up about 4-5 more masternodes, can you make a guide on how to make additional masternodes on 1 pc, with the option to make 2 masternodes on 1 vultr instance?

Keep up the great work - Tips are on the way! when I get paid a bit more...
 
Hey thanks again for the help Tao.
Now I'm looking to set up about 4-5 more masternodes, can you make a guide on how to make additional masternodes on 1 pc, with the option to make 2 masternodes on 1 vultr instance?

Keep up the great work - Tips are on the way! when I get paid a bit more...
Refer to the HinnomTX's post above to see how to get multiple IPs on a single instance.

To use another wallet on your local PC, you need to create a .bat file on your PC to have the wallet created in another folder.

Create folder c:\darkcoin2.

The .bat file has to be in the same folder as your darkcoin-qt.exe file. (c:\darkcoin) and your wallet info will be created in your c:\darkcoin2 file. Also, when you make your .conf file, you will make it in this darkcoin2 folder.

Create a new notepad file. Enter the following:

darkcoin-qt.exe -datadir=c:\darkcoin2

Save as a .bat file. Ensure it is in your darkcoin folder with the QT.

Double click the .bat file.

This will open the wallet with your wallet info in the darkcoin2 folder.

When you do your .conf, this is how it should look in your CMD line (you should now make a .bat file with this info as well for ease of future use):

darkcoin-qt.exe -datadir=c:\darkcoin2 -conf=c:\darkcoin2\darkcoin.conf

Good luck! As far as gratuities, they are always appreciated....
 
Back
Top