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

delete

I used the code above and improved it a bit...

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 5
./darkcoind
sleep 15
./darkcoind getinfo
sleep 5
echo "########### Master Node status - Active: 1, Inctive: 0"
./darkcoind masternode list | grep $IP

save as update.sh and chomd 755
run from SSH:
./update.sh https://raw.githubusercontent.com/d...es/master/rc/darkcoin-0.10.12.32-linux.tar.gz

link to the new/update tar.gz file will be available on Darkcoin.io

If HOT wallet is used on the MN a new wallet is needed to upgrade to the new RC5.
 
Last edited by a moderator:
echo "########### Restarting the updated Master Node"
sleep 5
./darkcoind
sleep 30
./darkcoind getinfo
sleep 20
echo "########### Master Node status - Active: 1, Inctive: 0"
./darkcoind masternode list | grep $IP

In some cases you will need to increase the "sleep" time to give darkcoind more time to fully load.
 
that is great,
can you please post a final version in the OP ?!
tx
 
...you generally do not have to execute the masternode start command on the remote machine.
Oh, contrariwise; you most absolutely must without exception, always. The new daemon will not know it is an MN in spite of there being such in the config. Without a "masternode start" it will just sit there, never ping the network, become inactive, then drop off the list entirely, and when using start-many, that's a pain to deal with... Ask me how I know this...

Even when you do a "masternode start" it often does not stick and has to be re-issued over and over and over again until you see "last seen" reset on it's own, without issuing the "masternode start" command. Just keep doing "masternode start" until the daemon starts pinging, or you're going to have one hell of a mess and probably be forced to destroy all your VMs, move all your DRK to new addresses, and start over completely.
 
Last edited by a moderator:
my "hat in the ring" version. Note: hardcoded for 64bit linux... YMWV


Code:
#!/bin/bash

GETURL=https://raw.githubusercontent.com/darkcoinproject/darkcoin-binaries/master/

if [ -z $1 ] ; then
    echo "usage: $0 darkcoinversion"
    echo "eg: $0 0.10.16.16"
    exit
fi

version=$1

GETFILE=darkcoin-${version}-linux.tar.gz
GETURL=${GETURL}${GETFILE}

if [ ! -e $GETFILE ] ; then
    wget $GETURL
fi

if [ ! -e $GETFILE ] ; then
    echo "error downloading file"
    echo "tried to get ${GETURL}"
    exit
fi

#unpack it
tar zxvf $GETFILE

#copy it
cp darkcoin-${version}-linux/bin/64/darkcoind ~/.darkcoin/darkcoind-${version}

#remove unneeded
rm -rf darkcoin-${version}-linux

#work it
cd ~/.darkcoin

#stop it
darkcoind stop

#wait it
sleep 5

#clean it
rm -f debug.log peers.dat

#link it
rm darkcoind && ln -s darkcoind-${version} darkcoind

#start it
./darkcoind &

Brittle, could use more error handling... but as long as the directory/filename structures remain consistent... should work until it doesn't.

:)
 
Ok, here is mine :)
Code:
#!/bin/bash
date

if [ $1 ]; then
DARK=darkcoin-$1-linux
wget https://github.com/darkcoinproject/darkcoin-binaries/raw/master/$DARK.tar.gz
tar -xvf $DARK.tar.gz
chmod u+x $DARK/bin/64/darkcoind
else
cd ~/darkcoin/
git pull
cd src/
make -f makefile.unix USE_UPNP=-
fi

darkcoind stop
sleep 5
mv /usr/bin/darkcoind /usr/bin/darkcoind.old

if [ $1 ]; then
mv $DARK/bin/64/darkcoind /usr/bin/
rm -r $DARK*
else
cp darkcoind /usr/bin/
fi

darkcoind

Usage is
Code:
./mn_update.sh 0.10.16.16
to get binaries of exact version or
Code:
./mn_update.sh
to get latest github commit and compile by yourself (you have to have all needed dev libs installed first of course)
 
You only need to issue a masternode start from local assuming the remote masternode isn't offline for too long to drop off the list on protocol bumps. If the protocol stays the same, using anyone of these update scripts to stop the remote masternode for about 30-60 seconds while updating won't require you to load the local wallet up.
 
Hi,
I have not seen any masternode update script, so I want to share my simple one.
This is for local-remote setup. This script should be run on the remote server for masternode update. You only have to restart masternode on the local machine, when there was a protocol version update.

If you have more than one masternode/server, you can use "superputty" to execute the update command simultaneous on all remote machines: https://code.google.com/p/superputty/

Code:
#!/bin/sh
echo "########### This script will update the Master Node"
sleep 5
VERSION=64
URL=$1
FILE=${URL##*/}
DIR=${FILE%.tar.gz}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dashd stop
sleep 4
rm dashd
cp $DIR/bin/$VERSION/dashd .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd
you need to add the url for the new darkcoin (tar.gz compressed) binary as argument e. g. "sh update.sh https://www.dashpay.io/binaries/dash-0.11.1.26-linux.tar.gz"
place the code inside ~/.dash/update.sh and chmod 755 update.sh
for it to work you need a symbolic link from /usr/bin/dashd to ~/.dash/dashd: "sudo ln -s ~/.dash/dashd /usr/bin/"

cheers,

EDIT: added status message output and "rm peers.dat debug.log db.log" command (thanks DrkMiner)
EDIT2: added superputty advice (thanks oblox)
EDIT3: updated for new name "dash"

Can you please start working on "rebranding" the guide ?!
that would be great and super appreciated
Tx
 
Hi :D I have updated the script but it requires 'bash'
it's a bit of a hacky way so I'm open to how to improve it (I'm not a programmer)

For upgrading to v12.

#!/bin/bash
echo "########### This script will update the Master Node"
sleep 5
URL=$1
FILE=${URL##*/}
DIR=${FILE:0:11}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dashd stop
sleep 5
rm dashd
cp $DIR/bin/dashd .
cp $DIR/bin/dash-cli .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd -reindex

Once on v12 and future updates (provided no more changes in directory structure)

#!/bin/bash
echo "########### This script will update the Master Node"
sleep 5
URL=$1
FILE=${URL##*/}
DIR=${FILE:0:11}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dash-cli stop
sleep 5
rm dashd
cp $DIR/bin/dashd .
cp $DIR/bin/dash-cli .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd
 
BolehVPN THANK YOU! This made my life alot easier! Now I can update all my NM! Meant to update sooner but Ill have to redo all my scripts to get this ball rolling.
 
For all you folks running version 12 on linux:

https://github.com/moocowmoo/dashman

(Read the README, this script places the executables in ~/.dash -- I'll add destination folders eventually.)

dashman-screencap.png


Let me know if you run into any trouble. I'll push bugfixes as we find them. ;)

(32bit install untested, but should work, lmk)
 
Last edited by a moderator:
Hi :D I have updated the script but it requires 'bash'
it's a bit of a hacky way so I'm open to how to improve it (I'm not a programmer)

For upgrading to v12.

#!/bin/bash
echo "########### This script will update the Master Node"
sleep 5
URL=$1
FILE=${URL##*/}
DIR=${FILE:0:11}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dashd stop
sleep 5
rm dashd
cp $DIR/bin/dashd .
cp $DIR/bin/dash-cli .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd -reindex

Once on v12 and future updates (provided no more changes in directory structure)

#!/bin/bash
echo "########### This script will update the Master Node"
sleep 5
URL=$1
FILE=${URL##*/}
DIR=${FILE:0:11}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dash-cli stop
sleep 5
rm dashd
cp $DIR/bin/dashd .
cp $DIR/bin/dash-cli .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd

Thank you. Please tell me, can I add this to autoload and add to crontab?
 
Please tell me about work on Ubuntu?

It will work fine on ubuntu.

It is meant to be run manually.

It expects your dashd and dash-cli be in your ~/.dash folder.
(I'm working on making that part smarter for alternate layouts.)
 
Update script updated (through the power of scripting!)

UPDATES
  • Will now attempt to locate where you've installed your dashd/dash-cli
  • Shows pretty output of what its done (and where it's done it!)
BUGS
  • Probably
  • Still only works on Linuxes
  • Still can't deliver beers on demand
  • Others you haven't told me about yet

screencap.png


get it at https://github.com/moocowmoo/dashman

And let me know if you run into trouble!
 
This update script rocks! Just switched over to this and it went smooth as butter. Now if I can figure out why I can't successfully resync to the network. Block height matches but doesn't show up on the list.
 
Back
Top