There are three types of upgrades

  1. Upgrade the story geth client
  2. Upgrade the story client manually
  3. Schedule the upgrade with Cosmovisor

Upgrade the story geth client

# Stop the services
sudo systemctl stop story
sudo systemctl stop story-geth

# Download the new binary
wget ${STORY_GETH_BINARY_URL}
sudo mv ./geth-linux-amd64 story-geth
sudo chmod +x story-geth
sudo mv ./story-geth $HOME/go/bin/story-geth
source $HOME/.bashrc

# Restart the service
sudo systemctl start story-geth
sudo systemctl start story

Upgrade the story client manually

# Stop the service
sudo systemctl stop story

# Download the new binary
wget ${STORY_BINARY_URL}
sudo mv story-linux-amd64 story
sudo chmod +x story
sudo mv ./story $HOME/go/bin/story

# Schedule the update
sudo systemctl start story

Schedule the upgrade with Cosmovisor

The following steps outline how to schedule an upgrade using Cosmovisor:

  1. Create the upgrade directory and download the new binary
# Download the new binary
wget ${STORY_BINARY_URL}

# Schedule the upgrade
source $HOME/.bash_profile
cosmovisor add-upgrade ${UPGRADE_NAME} ${UPGRADE_PATH} \
  --force \
  --upgrade-height ${UPGRADE_HEIGHT}
  1. Verify the upgrade configuration
# Check the upgrade info
cat $HOME/.story/story/data/upgrade-info.json

The upgrade-info.json should show:

{
  "name": "v1.0.0",
  "time": "2025-02-05T12:00:00Z",
  "height": 858000
}
  1. Monitor the upgrade
# Watch the node logs for the upgrade
journalctl -u story -f -o cat

Note: Cosmovisor will automatically handle the binary switch once the specified block height is reached. Before the upgrade, confirm that your node is fully synced and has enough disk space available.

Use Cosmovisor While running Story Node

This guide is for people who are running story without using cosmovisor, but still want to use cosmovisor to schedule the upgrade.

  1. Install Cosmovisor
# Install Cosmovisor
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@1.6.0

cosmovisor version

You will see the version of cosmovisor.

cosmovisor version: v1.6.0
Error: failed to run version command: DAEMON_NAME is not set
DAEMON_HOME is not set
DAEMON_DATA_BACKUP_DIR must not be empty
  1. Set the environment variables
# Set daemon configuration
export DAEMON_NAME=story
export DAEMON_HOME=$HOME/.story/story
export DAEMON_DATA_BACKUP_DIR=${DAEMON_HOME}/cosmovisor/backup
sudo mkdir -p $DAEMON_HOME/cosmovisor/backup $DAEMON_HOME/data


# Persist configuration
echo "export DAEMON_NAME=story" >> $HOME/.bash_profile
echo "export DAEMON_HOME=$HOME/.story/story" >> $HOME/.bash_profile
echo "export DAEMON_DATA_BACKUP_DIR=${DAEMON_HOME}/cosmovisor/backup" >> $HOME/.bash_profile
echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=false" >> $HOME/.bash_profile

If you have any permission issues, you can run the following command to fix it.

sudo chown -R $USER:$USER $HOME/.story
  1. Setup the cosmovisor
# Create the cosmovisor directory
mkdir -p $HOME/.story/cosmovisor/genesis/bin

# Copy the new binary to the cosmovisor directory
cp $HOME/go/bin/story $HOME/.story/cosmovisor/genesis/bin/
  1. Add cosmovisor to the systemd service
sudo tee /etc/systemd/system/cosmovisor.service > /dev/null <<EOF
[Unit]
Description=Cosmovisor
After=network.target

[Service]
Type=simple
User=$USER
Group=$GROUP
ExecStart=${which cosmovisor} run run \
--api-enable \
--api-address=${API_ADDRESS}
Restart=on-failure
RestartSec=5s
LimitNOFILE=65535
Environment="DAEMON_NAME=$DAEMON_NAME"
Environment="DAEMON_HOME=$DAEMON_HOME"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_DATA_BACKUP_DIR=$DAEMON_HOME/cosmovisor/backup"
WorkingDirectory=$DAEMON_HOME

[Install]
WantedBy=multi-user.target
EOF
# Enable the cosmovisor service
sudo systemctl enable cosmovisor
sudo systemctl daemon-reload

sudo systemctl stop story


# Start the cosmovisor service
sudo systemctl start cosmovisor

# Check the status of the cosmovisor service
sudo systemctl status cosmovisor

sudo journalctl -u cosmovisor -f -o cat

Check the status of the cosmovisor service

cosmovisor version

You will see the version of cosmovisor.

cosmovisor version: v1.6.0
12:16AM INF running app args=["version"] module=cosmovisor path=${DAEMON_HOME}/cosmovisor/genesis/bin/story
Version       v1.1.3-stable
Git Commit    38313e8
Git Timestamp 2025-04-11T04:24:27Z
  1. Schedule the upgrade
# Download the new binary
wget ${STORY_BINARY_URL}

# Schedule the upgrade
source $HOME/.bash_profile
cosmovisor add-upgrade ${UPGRADE_NAME} ${UPGRADE_PATH} \
  --force \
  --upgrade-height ${UPGRADE_HEIGHT}