Skip to content

Instantly share code, notes, and snippets.

@nmarley
Last active October 1, 2015 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmarley/7f137ccac354dc7a2c17 to your computer and use it in GitHub Desktop.
Save nmarley/7f137ccac354dc7a2c17 to your computer and use it in GitHub Desktop.
Dash upgrade script(s)

Dash upgrade scripts.

Steps:

  1. Update location/file version in script 'prep-dash-release.sh'.
  2. Then distribute prep-dash-release.sh script by executing 'dist.sh'
  3. If any new masternodes are added, add them to dist.sh
  4. Login to individual servers and run:

cd packages; bash prep-dash-release.sh

Follow on-screen instructions.

#! /bin/bash -x
hosts=(mn2 mn3 bc)
for host in ${hosts[*]}; do
scp prep-dash-release.sh "${host}:~/packages/"
done
#! /bin/bash -x
cd ~/packages
PKG_URL="https://www.dashpay.io/binaries/dash-0.12.0.55-linux64.tar.gz"
ASC_URL="${PKG_URL}.asc"
PKG_FN=$( basename "$PKG_URL" )
ASC_FN=$( basename "$ASC_URL" )
echo "PKG_URL=[$PKG_URL]"
echo "PKG_FN=[$PKG_FN]"
echo "ASC_URL=[$ASC_URL]"
echo "ASC_FN=[$ASC_FN]"
echo "Downloading package [$PKG_URL] to [$PKG_FN]..."
wget -O "$PKG_FN" "$PKG_URL"
echo "Downloading signature file [$ASC_URL] to [$ASC_FN]..."
wget -O "$ASC_FN" "$ASC_URL"
if ! gpg --verify "$ASC_FN"; then
echo "Oops! Signature doesn't check out --aborting."
exit 2
fi
VERSION=`echo "$PKG_FN" | sed -e 's/-linux64\.tar\.gz$//'`
echo "V=$VERSION"
MINOR_EXTRACT_DIR=`echo "$VERSION" | sed -r -e 's/\.[0-9]{1,}$//'`
echo "MINOR_EXTRACT_DIR=$MINOR_EXTRACT_DIR"
# move off old dash dir if exists
if [ -d "$MINOR_EXTRACT_DIR" ]; then
RANDO="$$"
mv "$MINOR_EXTRACT_DIR" "${MINOR_EXTRACT_DIR}.old.${RANDO}"
fi
# extract package
gzip -dc "$PKG_FN" | tar xf -
# check if dash running...
psg dash
echo "get ready to run:
~/current_dash/bin/dash-cli stop
cd ~/.dash/ && mv debug.log /tmp
psg dash
~/current_dash/bin/dashd
grep Hot debug.log
~/current_dash/bin/dash-cli masternode status
~/current_dash/bin/dash-cli getinfo
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment