Skip to content

Instantly share code, notes, and snippets.

@zeroFruit
Created July 5, 2022 01:16
Show Gist options
  • Save zeroFruit/723891166e3caa2966092e59a0a743e7 to your computer and use it in GitHub Desktop.
Save zeroFruit/723891166e3caa2966092e59a0a743e7 to your computer and use it in GitHub Desktop.
Cosmos Dev Series: Cosmos-SDK-based Blockchain Upgrade - setup-node.sh
#!/bin/bash
export DAEMON_NAME=simappd
export SIMAPPD_V1_HOME=/path/to/simappd-v1
export SIMAPPD_V2_HOME=/path/to/simappd-v2
export DAEMON_HOME=/path/to/simappd-home
# Tmp cosmovisor directory. In this directory, we are going to
# setup Cosmovisor directory structures and copy this directory
# into $DAEMON_HOME
export TMP_COSMOVISOR_DIR=/path/to/tmp-cosmovisor
# update if needed
export DAEMON_ALLOW_DOWNLOAD_BINARIES=false
export DAEMON_RESTART_AFTER_UPGRADE=true
# setup cored binaries
cd $SIMAPPD_V1_HOME
make build
cp ./build/simappd $TMP_COSMOVISOR_DIR/genesis/bin/
cd $SIMAPPD_V2_HOME
make build
cp ./build/simappd $TMP_COSMOVISOR_DIR/upgrades/v2.0.0/bin/
# setup cored data
cd $SIMAPPD_V1_HOME
ignite chain init --home $DAEMON_HOME
cp -R $TMP_COSMOVISOR_DIR $DAEMON_HOME/
cosmovisor run start --home $DAEMON_HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment