Upgrade Storage Node
Stop service && backup config.toml
Section titled “Stop service && backup config.toml”sudo systemctl stop zgs && cp $HOME/0g-storage-node/run/config.toml $HOME/0g-storage-node/run/config.toml.backupUpdate
Section titled “Update”cd $HOME/0g-storage-nodegit stashgit fetch --all --tagsgit checkout 27979c2git submodule update --initcargo build --releaseUpdate config.toml
Section titled “Update config.toml”mv $HOME/0g-storage-node/run/config.toml.backup $HOME/0g-storage-node/run/config.tomlZGS Service Restart
Section titled “ZGS Service Restart”sudo systemctl restart zgsLog Check
Section titled “Log Check”tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)Block Sync Check
Section titled “Block Sync Check”while true; do response=$(curl -s -X POST http://localhost:5678 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"zgs_getStatus","params":[],"id":1}') logSyncHeight=$(echo $response | jq '.result.logSyncHeight') connectedPeers=$(echo $response | jq '.result.connectedPeers') echo -e "logSyncHeight: \033[32m$logSyncHeight\033[0m, connectedPeers: \033[34m$connectedPeers\033[0m" sleep 5;done