Node9X Service
  • 🍄MAINNET
    • 🟢Kopi Protocol
      • 💾Service & Snapshot
      • ⚙️Installation
      • ⛓️Upgrade (V11)
      • 🪢Cosmovisor
      • 🛰️Command
  • 🚀Testnet
    • 🧬Explorer
    • 🟢Native
      • ⚙️Installation
    • 🟢XRPL EVM
      • 💾Service & Snapshot
      • ⚙️Installation
      • 🕹️Command
    • 🟢Pipe Network
      • Installation
      • Upgrade
    • 🟢Pell
      • 💾Service & Snapshot
      • ⚙️Installation
      • ⛓️Upgrade (v1.1.1)
      • 🕹️Command
    • 🟢Structs
      • 💾Service & Snapshot
      • ⚙️Installation
      • 🕹️Command
    • 🟢Prysm
      • 🛰️Service & Snapshot
      • ⚙️Installation
      • 💾Command
    • 🟢Zenrock
      • 💾Service & Snapshot
      • ⚙️Installation
      • ⛓️Upgrade ( v6.3.3)
      • 🕹️Cosmovisor
      • 🛰️Command
      • ⚙️Sidecar (✔️Oracle)
        • 🔗Upgrade
    • 🟢Story Protocol
      • 💾Service & Snapshot
      • ⚙️Installation (Odyssey)
      • ⛓️Upgrade (v0.13.1)
        • 🪢Upgrade (v0.13.0)
      • ⛓️Cosmovisor
      • 🛰️Command
    • 🟢0G Chain
      • Service & Snapshot
      • Installation
        • Cosmovisor
      • Commands
      • ☑️0G Storage Node
        • Upgrade (v0.7.3)
      • ☑️0G Storage KV
      • ☑️0G DA Node
        • Update
      • ☑️0G DA Client
    • 🟢Airchains
      • 💾Service & Snapshot
      • ⚙️Installation
        • 🪢Cosmovisor
        • 🔺EVM ZK Rollup
      • 🕹️Commands
      • ⛓️Upgrade
    • 🟢Allora
      • 🔺Workers
        • Create tool and worker wallet
        • Install Worker 1
        • Install Worker 2
        • Troubleshooting
        • Script for checking worker
      • Another method
      • Service
      • Installation By Dock (Recommend)
      • Installation
      • Snapshot & State sync
      • Useful commands
    • 🟢Hedge Block
      • Service
      • Installation
      • Commands
    • 🟢Dill Chain
      • Usage Commands
    • 🟢Fiamma Chain
      • 🥦Services & Snapshot
      • ⚙️Installation
      • 🛰️Usage Command
    • 🟢Elixir Testnet
      • ⚙️Installation
    • 🟢Chainbase
      • ⛓️Installation
    • 🔘AXONE Protocol
      • 💾Service & Snapshot
      • ⚙️Installation
    • 🔘Symphony
      • 🔌Installation
      • 🥦Fresh Peer
    • 🔘Empeiria
      • Installation
      • Usage Command
Powered by GitBook
On this page
  • Manual
  • Auto upgrade
  • Make the script executable:
  • Run the script:

Was this helpful?

  1. Testnet
  2. Airchains

Upgrade

Do not upgrade before 451850

Manual

sudo systemctl stop junctiond
cd $HOME
wget -O junctiond https://github.com/airchains-network/junction/releases/download/v0.3.2/junctiond-linux-amd64
chmod +x $HOME/junctiond
mv $HOME/junctiond $HOME/go/bin/
sudo systemctl restart junctiond && sudo journalctl -u junctiond -f

Auto upgrade

#Create new tmux
tmux new -s junctiond
nano upgrade_airchains.sh
#!/bin/bash

# Kiểm tra quyền root
if [[ $EUID -ne 0 ]]; then
    echo "This script must be run as root!" >&2
    exit 1
fi

# Tải phiên bản mới nhất của junctiond
cd "$HOME" && wget -O junctiond https://github.com/airchains-network/junction/releases/download/v0.3.2/junctiond-linux-amd64

# Hiển thị phiên bản vừa tải
echo "Latest Version:"
chmod +x "$HOME/junctiond" && "$HOME/junctiond" version || echo "Error: Unable to retrieve latest version"

# Hiển thị phiên bản hiện tại
echo "Current Version:"
/usr/local/bin/junctiond version || echo "Error: Unable to retrieve current version"

# Đợi đến block height đạt 451850
echo "Waiting until block 451850..."
for (( ;; )); do
    # Lấy cổng RPC từ config.toml
    rpc_port=$(grep -m1 'laddr = ' "$HOME/.junctiond/config/config.toml" | awk -F':' '{print $3}' | tr -d '"')

    # Nếu không tìm được port, dùng mặc định 26657
    if [[ -z "$rpc_port" ]]; then
        rpc_port=26657
    fi

    # Lấy block height hiện tại
    height=$(curl -s localhost:$rpc_port/status | jq -r .result.sync_info.latest_block_height)

    # Kiểm tra nếu height không hợp lệ
    if [[ -z "$height" || "$height" == "null" ]]; then
        echo "[$(date '+%F %T')] Could not fetch block height from RPC at port $rpc_port. Retrying..."
        sleep 5
        continue
    fi

    echo "[$(date '+%F %T')] Current Block Height: $height"

    if (( height == 451850 )); then
        echo "Target block height reached. Upgrading junctiond..."

        # Di chuyển binary mới vào /usr/local/bin
        mv "$HOME/junctiond" /usr/local/bin/

        # Reload systemd và restart node
        sudo systemctl daemon-reload
        echo "Upgrading junctiond to v0.3.2..."
        /usr/local/bin/junctiond version && echo "✅ Node successfully upgraded to v0.3.2!" || echo "❌ Error: Unable to verify version"

        sudo systemctl restart junctiond
        break
    fi

    # Chờ 5 giây trước khi kiểm tra lại
    sleep 5
done

Make the script executable:

chmod +x upgrade_airchains.sh

Run the script:

sudo ./upgrade_airchains.sh
PreviousCommandsNextAllora

Last updated 1 month ago

Was this helpful?

🚀
🟢
⛓️