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

Automated Masternode Install

Shaan

New member
Hi guys new to forum.


I figured I will share this script to help with Masternode installs for new masternoders and or current ones.

without further delay..

open favourite editor copy and paste, chmod +x installmn.sh && ./installmn.sh URL_HERE_FOR_DARKCOIN_BINARIES

Code:
#!/bin/sh
# Automated Masternode Install By Shaan @ Darkcointalk
echo 'Masternode Install Starting!'
sleep 5
VERSION=64
URL=$1
FILE=${URL##*/}
DIR=${FILE%.tar.gz}
IP=$(hostname -I)
wget $URL
tar xzvf $FILE
mv $DIR/bin/$VERSION/darkcoind .
chmod 755 darkcoind
rm $FILE
rm -rf $DIR
# Configuration file inputs
echo 'Input rpcuser ( Can be random characters ): '
read rpc1
echo 'Input rpcpassword ( Can be random characters ): '
read rpc2
echo 'Input masternodeprivkey ( DOUBLE CHECK!! ): '
read priv
mkdir .darkcoin
cat > .darkcoin/darkcoin.conf <<EOF
rpcuser=$rpc1
rpcpassword=$rpc2
rpcallowip=127.0.0.1
listen=1
server=1
daemon=1
logtimestamps=1
maxconnections=256
masternode=1
masternodeprivkey=$priv
addnode=23.23.186.131
EOF
chmod 444 .darkcoin/darkcoin.conf
./darkcoind
sleep 30
./darkcoind getinfo
echo 'Your Masternode has been installed, Confirm Blocks'
sleep 5
 
Last edited by a moderator:
Looks good but you'll probably want to stick a delay between starting darkcoind and running getinfo or it'll give you an 'unable to connect to server' - 20 secs is usually fine for an update but you might need a bit longer than that with a fresh install.

I think you can also run masternode genkey on the server and email it or whatever to the user, but you'd need to initially have masternode=0 in the conf then change it again after.
 
Back
Top