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

Master-node setup guide for your NORMAL VPS v1.0 WORK IN PROGRESS !

yamada

Member
Hi,

As my first post here is my complete set-up guide for a normal VPS .
It is so far 100% ready to use, but I will add some formatting and comments for people not accustomed at least a small bit to the Linux/Ubuntu Operating System.

This guide is meant for Ubuntu 12.04+ VPS with at least 1 GB of RAM.

Over time I hope to add the procedure to a) let your darcoind run via tor b) Run your master-node via tor & c) harden your VPS against attacks.


More informations to follow.


If somebody is out there who can show me the easiest way to watch my multiple master-node addresses at once ( preferred via a web interface) I would be really really grateful.

#USE THIS GUIDE ON YOUR OWN RISK # #ALWAYS CREATE ENCRYPTED BACKUPS OF YOUR WALLETS#
 
Last edited by a moderator:
Order your VPS and wait until it is set-up.

Then use putty or your favourite SSH client to connect. Immediately change your root password with the command "passwd"

## Then we commence with updating our repos and the system

Code:
apt-get -y update && apt-get -y upgrade
Code:
apt-get -y dist-upgrade

## Then we install all needed software. The -y switch stops the system from asking you if you agree to install the specific applications.

Code:
apt-get -y install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev libminiupnpc-dev nano curl

Code:
apt-get -y install libboost-all-dev libdb5.1 libdb5.1-dev libdb5.1++-dev git ntp make g++ gcc autoconf cpp ngrep iftop sysstat iptraf

### Now we create our working directory for now and download the darcoind stable release.
Code:
mkdir Downloads && cd Downloads && apt-get -y install git && git clone git://github.com/darkcoinproject/darkcoin && cd darkcoin/src

## Now we compile it. This process can take up to 30 minutes on slower machines.

Code:
time make -f makefile.unix "USE_UPNP:=-" "USE_IPV6:=0"


## Here we add the darkcoind to our binaries directory so we can start darkcoind no matter where we are in the directory structure.

Code:
strip darkcoind && cp darkcoind /usr/bin && cp darkcoind /usr/bin && mkdir ~/.darkcoin

# Now we create our darkcoin configuration file.

Code:
cat > ~/.darkcoin/darkcoin.conf << EOF
#CHANGE THE FOLLOWING TO STRONG RANDOM STRING#
rpcuser=RANDOM STRING
rpcpassword= RANDOM STRING
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
# IF YOU PLAN ON RUNNING YOUR MASTER-NODE VIA TOR UNCOMMENT THE FOLLOWING & REFER TO THE TOR GUIDES #
#proxy=127.0.0.1:9050
#--- DO NOT FORGET TO ENTER THE CORRECT PUBLIC IP# Enter[CODE] curl icanhazip.com
at your terminal to find it out.#
externalip='YOUR SERVERS PUBLIC IP'
#--------------------------------------------------
#masternode=0
#masternodeprivkey=
EOF[/CODE]

# We start darkcoind & check its status and wait until the blockchain has been downloaded. ( About 30 minutes maximum right now).
Code:
darkcoind

Code:
darkcoind getinfo

## When you are sure the blockchain is up-to-date we commence with updating our darkcoind to the RC2 with master-node support.

## Download newest Release Candidate

Code:
cd ~/.darkcoin && wget http://www.darkcoin.io/downloads/rc/darkcoind
# Make it executable and stop darkcoind server

Code:
chmod 755 darkcoind && darkcoind stop

# Backup the old darkcoind binary in /usr/bin

Code:
cd /usr/bin && mv darkcoind darkcoind.old

##Create a symlink from your downloaded new binary to the binaries folder.
# You have 2 options now:
# a) you move our local wallet with 1000DRK to the remote VPS or b) you send exactly 1000DRK to the wallet that can be created with
Code:
getaccountaddress 0
while darkcoind is still running.

# for a) to the following first.
Code:
ln -s ~/.darkcoin/darkcoind . && cd ~/.darkcoin && rm wallet.dat

##ON YOUR LOCAL COMPUTER COPY THE ENCRYPTED 1000DRK WALLET TO THE REMOTE MASTER-NODE VPS.

(Install SCP if necessary ,
Code:
sudo apt-get install scp
)
## In the directory where you saved your copy of the 1000DRK wallet destined for the master-node do :

Code:
scp wallet.dat root@YOURVPSIPADRESS:/home/
## yes & root password

## BACK ITO YOUR SSH TERMINAL ON THE REMOTE VPS

## Now you move it to the correct folder.
Code:
mv /home/wallet.dat ~/.darkcoin/wallet.dat && cd ~/.darkcoin/
##Start darcoind again. Check for version information to make sure it is indeed the newest RC.

Code:
darkcoind

## Test if balance for correctness ( 1000DRK)

Code:
darkcoind getbalance
Code:
darkcoind masternode genkey

### Copy output ( when using putty just mark it and it is copied to the clipboard automatically.)

Code:
darkcoind stop

Code:
nano darkcoin.conf

##Change masternode=0 to masternode=1 and paste copied output key ( Remove the # in front of both lines)

masternode=1
masternodeprivkey=

exit with CTRL+X and confirm with "y"
Code:
darkcoind
darkcoind



Code:
darkcoind masternode start *your password for encrypted wallet*



### DELETE BASH HISTORY TO MAKE SURE AN INTRUDER CANNOT GET YOUR PASSWORD FROM IT ##

Code:
cd ~/ && ln -sf /dev/null .bash_history && history -c && exit







tail -f ~/.darkcoin/debug.log




###UPDATE PROCEDURE

darkcoind stop
cd ~/.darkcoin && rm -r chainstate/ && rm -r blocks/ && rm darkcoind && cd /usr/bin && mv darkcoind darkcoind.old && cd ~/.darkcoin && wget http://www.darkcoin.io/downloads/rc/darkcoind
chmod 755 darkcoind && cd /usr/bin && ln -s ~/.darkcoin/darkcoind .

cd ~/.darkcoin && darkcoind

darkcoind getinfo

darkcoind masternode start *your password for encrypted wallet*
 
Why did you leave amazon? Can this be used on a home node that's running a Linux distro? Or would the hardware FW be an issue?
 
Did anybody have issues with wallet.dat not being recognised by masternode? i.e. ./darkcoind masternode start secretpass
Receive message: not capable masternode
I substituted wallet.dat with a test wallet I created and the masternode works fine. Any ideas guys?
BTW, here is a dummies guide to adding Config Server Firewall to harden your server: http://ozziecoin.com/?page_id=1466
 
I think it's great that you are putting some time and effort into this guide to help out others. My only concern is that you are giving people an insecure server and has a high chance of the wallet being stolen. I can see you intend to include hardening the server later but you should be building a secure server first and then put coins on it.
 
Im kind of stuck now and need help, i secured my server etc im used to setup dedicated servers...
When i download the newsest RC from http://www.darkcoin.io/downloads/rc/darkcoind its still shows me the github version when i compiled.
Code:
darkcoind getinfo
"version" : 90411,
"protocolversion" : 70015,
"walletversion" : 60000
Should it not be showing v0.10.8.11?
When i run the command darkcoind masternode genkey i get this error.
Code:
error: {"code":-1,"message":"masternode list|count|current|votes> passphrase\n"}

Thanks
 
Last edited by a moderator:
This sentence makes no sense, it includes "download" and "compiled". Not sure which version you are using. If you compiled it, you have 9x which does not support running a masternode yet. If you downloaded the RC version, you have 10x which is required to run a masternode.
In the tutorial above hes says this.
Code:
## When you are sure the blockchain is up-to-date we commence with updating our darkcoind to the RC2 with master-node support.
I first loaded it via git and than downloaded the RC, than the tutorial does not make sence. How he describes it... download first the stable version via git update the blockchain, than update to RC masternode version and this is probably the mistake. I may have to delete everything again, because it just doesnt recognize the RC version.
 
Last edited by a moderator:
You might also want to check this out http://serverfault.com/questions/363741/how-can-i-block-all-but-three-ports-in-ubuntu after working a bit I successfully got my VPS blocking all ports except my ssh port (non-standard not 22) and 9999
Yeah this is pretty standard, but if you are new to linux you can mess around with iptables that you are not able to login via ssh again, if you have no local access ^^. :)
Digital Ocean has a good libary with tutorials for beginners aswell.
https://www.digitalocean.com/commun...p-a-basic-ip-tables-configuration-on-centos-6
ps: i deleted everything downloaded again http://www.darkcoin.io/downloads/rc/darkcoind it still shows
"version" : 90411,
"protocolversion" : 70015,
"walletversion" : 60000,
 
Last edited by a moderator:
In the tutorial above hes says this.
Code:
## When you are sure the blockchain is up-to-date we commence with updating our darkcoind to the RC2 with master-node support.
I first loaded it via git and than downloaded the RC, than the tutorial does not make sence. How he describes it... download first the stable version via git update the blockchain, than update to RC masternode version and this is probably the mistake. I may have to delete everything again, because it just doesnt recognize the RC version.
not sure why chaeplin recommends the github version at all. just dont use the open source version, go straight for the RC version.
 
I am working to finalize the guide this weekend !

Sorry but I have been very busy on other project .
 
Now it works! Yamada you really have to remove the part with downloading the git, because you will get version 90411 without masternode support even if you later replace it with the rc darkcoind. On debian you need glibc if someone has issues like this.

Code:
./darkcoind: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by ./darkcoind)
./darkcoind: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./darkcoind)

http://stackoverflow.com/questions/10863613/how-to-upgrade-glibc-from-version-2-13-to-2-15-on-debian
 
I think it's great that you are putting some time and effort into this guide to help out others. My only concern is that you are giving people an insecure server and has a high chance of the wallet being stolen. I can see you intend to include hardening the server later but you should be building a secure server first and then put coins on it.
Well, my guide is an improvement on what the original guide provided, so I'm not sure what you mean?
 
Yeah this is pretty standard, but if you are new to linux you can mess around with iptables that you are not able to login via ssh again, if you have no local access ^^. :)
Digital Ocean has a good libary with tutorials for beginners aswell.
https://www.digitalocean.com/commun...p-a-basic-ip-tables-configuration-on-centos-6
ps: i deleted everything downloaded again http://www.darkcoin.io/downloads/rc/darkcoind it still shows
"version" : 90411,
"protocolversion" : 70015,
"walletversion" : 60000,
You should be closing ALL ports other than 9999 on your MN. Using CSF to do that is so easy. Leaving an open SSH port even if port number is changed is asking for trouble. That's what happened to Reda.
 
Can you provide this for Centos 6.5 minimal? It would be greatly appreciated as there is a need to document hardening steps for Linux based on Centos 6.5 Minimal but it does not currently seem to compile with errors.
 
Back
Top