Skip to content

Instantly share code, notes, and snippets.

@ForboleDevelopment
Last active October 5, 2020 14:30
Show Gist options
  • Save ForboleDevelopment/88b69da545a028dddd418025bc11e75a to your computer and use it in GitHub Desktop.
Save ForboleDevelopment/88b69da545a028dddd418025bc11e75a to your computer and use it in GitHub Desktop.
Commands that should be run in order to update from morpheus-8000 to morpheus-10000 seamlessly
#!/usr/bin/bash
# This script allows you to setup your node properly getting it
# ready for the October update.
# It will checkout and build the propery Desmos version, as well
# as setup your Systemd service.
# The only thing you have to do is run it giving it the first
# argument which is the path where you cloned the Desmos
# repository.
# E.g.
# ./morpheus-10000-update.sh ~/desmos
# Get the arguments
DESMOS_PATH=$1
if [ -z "$DESMOS_PATH" ]; then
echo "Specify Desmos installation path using the first argument"
exit
fi
# Create Desmos path if not existing
if [ ! -d "$DESMOS_PATH" ]; then
echo "===> Invalid Desmos folder. Please specify the folder in which you cloned the Desmos repository"
fi
# Stop the currently running node
echo "===> Stopping the node"
{
sudo systemctl stop desmosd
desmosd unsafe-reset-all
} &> /dev/null
# Build Desmos
echo "===> Building the new Desmos version"
{
cd $DESMOS_PATH
git fetch --tags
git checkout tags/v0.12.2
make build
} &> /dev/null
# Remove the current genesis and get the new one
echo "===> Getting the new genesis"
{
rm ~/.desmosd/config/genesis.json
curl https://raw.githubusercontent.com/desmos-labs/morpheus/master/genesis.json > ~/.desmosd/config/genesis.json
} &> /dev/null
# Setup the service file
FILE=/etc/systemd/system/desmosd.service
if test -f "$FILE"; then
echo "===> Setting up the service"
if [ -z "$DAEMON_NAME" ]; then
# The user is NOT using Cosmovisor
{
mv $DESMOS_PATH/build/desmos* $GOBIN
wget -O ./setup-desmos-service https://gist.githubusercontent.com/ForboleDevelopment/4d9448decf415fd77ef6a40d8e140f2f/raw/d2b3b4ac07bc4be2a525cfb61d9269b23c079900/setup-desmos-service.sh
} &> /dev/null
else
# The user is using Cosmovisor
{
mv $DESMOS_PATH/build/desmos* ~/.desmosd/cosmovisor/genesis/bin/
wget -O ./setup-desmos-service https://gist.githubusercontent.com/ForboleDevelopment/6eff34282fcef0341376ecf36bb433c2/raw/85cca0ff3a152a5da16aefd93334e20d12d6d2ef/setup-desmos-service-cosmovisor.sh
} &> /dev/null
fi
{
chmod +x ./setup-desmos-service
./setup-desmos-service
} &> /dev/null
fi
sudo systemctl start desmosd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment