🔄 Story Auto Upgrade

1️⃣ Download the Script

wget -O $HOME/auto-upgrade.sh https://files.mictonode.com/scripts/auto-upgrade.sh
chmod +x $HOME/auto-upgrade.sh

2️⃣ (Optional) Telegram Notification

Create the config file:

nano $HOME/tg.conf

Paste your bot details:

CHAT_ID_ALARM="123456789"
BOT_TOKEN="123456789:ABCdefGhIJKlMNopQRsTUvWXyz"

Test:

source $HOME/tg.conf
curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
  -d chat_id="$CHAT_ID_ALARM" -d text="✅ Telegram is working!"

3️⃣ Start the Upgrade Monitor

Choose one of the following based on what you want to upgrade:


🟦 Only story binary

STORY_PORT="62"
SCRIPT="$HOME/auto-upgrade.sh"
PROJECT="$HOME/.story"

tmux new -s story-upgrade "bash $SCRIPT --binary story --height 4362990 --story-version v1.2.0 --project-home $PROJECT --rpc-port ${STORY_PORT}657"

🟩 Only story-geth binary

STORY_PORT="62"
SCRIPT="$HOME/auto-upgrade.sh"
PROJECT="$HOME/.story"

tmux new -s story-upgrade "bash $SCRIPT --binary story-geth --height 4362990 --geth-version v1.0.2 --project-home $PROJECT --rpc-port ${STORY_PORT}657"

🟨 Both story and story-geth

STORY_PORT="62"
SCRIPT="$HOME/auto-upgrade.sh"
PROJECT="$HOME/.story"

tmux new -s story-upgrade "bash $SCRIPT --binary both --height 4362990 --story-version v1.2.0 --geth-version v1.0.2 --project-home $PROJECT --rpc-port ${STORY_PORT}657"

ℹ️ How It Works

  • GitHub repos (story / story-geth) are cloned into a temp folder

  • Specified versions are checked out

  • Binaries are built into $HOME/tmp-upgrade/bin/

  • When the upgrade block is reached:

    • Binaries are moved into $HOME/go/bin/
    • Services (story, story-geth) are restarted
    • Telegram notification is sent (if configured)

🧠 Tips

  • Detach from tmux: CTRL+B then D
  • Reattach: tmux attach -t story-upgrade
  • Script auto-exits 15 minutes after upgrade