original source: https://denariustalk.org/index.php?/topic/129-dnr-masternode-setup
if you already have a secure box and a user, just skip right now down to section "masternode setup"
passwd rootapt-get update
apt-get upgrade
apt-get install ufw python virtualenv git unzip pv make
git clone https://github.com/pyramation/mn-setup-scripts.git
cd mn-setup-scripts && ./install.shmake sure /root/.ssh/authorized_keys exists first! If you used DigitalOcean or similar, should already be there ;)
mn-setup-init-user <username>Write down the username it creates! Added randomness for extra security.
mn-setup-firewalls
rebootLog back in, then switch to root (or can use sudo):
su - root
apt-get install build-essential libssl-dev libdb++-dev libboost-all-dev libminiupnpc-dev libqrencode-dev
then type exit if root, to go back to regular user:
cd ~/
git clone https://github.com/carsenk/denarius
cd denarius
git checkout masternodes # CAREFUL THIS STEP MAY BE DIFFERENT WHEN IN PRODUCTION!
cd src
make -f makefile.unix
mkdir -p ~/.denarius
mn-setup-init-configor if using testnet,
TESTNET=1 mn-setup-init-configcd ~/denarius/src
./denariusdcd ~/denarius/src
mn-setup-update-configif using testnet,
TESTNET=1 mn-setup-update-config
Now, open another shell, and navigate to the src/ dir
cd ~/denarius/src
./denariusd getaccountaddress 0
>> 8aEgCZRJcmSUymnd8mLsQqE9SfWAnGYZrBSend 5000 DNR to the address it returns
First, wait until you are sync'd and have coins!
cd ~/denarius/src
./denariusd getbalance
>> 5000.00testnet: tail -f ~/.denarius/testnet/debug.log
mainnet: tail -f ~/.denarius/debug.log
if you see not a lot of action, or something like 02/02/18 02:55:31 No valid UPnP IGDs found, then:
./denariusd addnode denarius.win addWhen ready, generate the config:
cd ~/denarius/src
MN_ALIAS=pyramation mn-setup-init-masternode-configor for testnet,
MN_ALIAS=pyramation TESTNET=1 mn-setup-init-masternode-configIn one shell,
./denariusd stopthen in the original one running ./denariusd, hit ctl+c, then
./denariusd./denariusd masternode startTo ensure the masternode is running properly you can use the debug command:
./denariusd masternode debugIf you receive masternode input must have at least 15 confirmations error when starting, you'll simply have to wait.
If you receive masternode is stopped error, just try to start again:
./denriusd masternode startIn case of a failure, this will create a service that starts up on reboot:
run as root
mn-setup-masternode-service dnr /home/myuser-d0cf0ccc5b/denarius/src/denariusd myuser-d0cf0ccc5btest it ;)
reboot nowAs an extra security precaution, in case you entered a passphrase or other sensitive information via the command line, this line will completely erase all of your bash history:
cat /dev/null > ~/.bash_history && history -c