Migration Storage Node to V3 Testnet (Galileo)
You can use All in 1 Command :
Section titled “You can use All in 1 Command :”bash <(wget -qO- https://cdn.bangcode.id/0g/bangcode_0g_storage_tools.sh)
Or Migrate Manually
1. Stop the Node
Section titled “1. Stop the Node”sudo systemctl stop zgs
2. Backup config.toml
Section titled “2. Backup config.toml”cp $HOME/0g-storage-node/run/config.toml $HOME/zgs-config.toml.backup
3. Set New Contract Variables
Section titled “3. Set New Contract Variables”export ZGS_LOG_DIR="$HOME/0g-storage-node/run/log"export ZGS_LOG_CONFIG_FILE="$HOME/0g-storage-node/run/log_config"export LOG_CONTRACT_ADDRESS="0x56A565685C9992BF5ACafb940ff68922980DBBC5"export MINE_CONTRACT="0xB87E0e5657C25b4e132CB6c34134C0cB8A962AD6"export REWARD_CONTRACT="0x233B2768332e4Bae542824c93cc5c8ad5d44517E"export ZGS_LOG_SYNC_BLOCK=1
4. Edit config.toml
Section titled “4. Edit config.toml”sed -i 's|^log_sync_start_block_number = .*|log_sync_start_block_number = '"$ZGS_LOG_SYNC_BLOCK"'|gs|^log_config_file = .*|log_config_file = "'"$ZGS_LOG_CONFIG_FILE"'"|gs|^log_directory = .*|log_directory = "'"$ZGS_LOG_DIR"'"|gs|^mine_contract_address = .*|mine_contract_address = "'"$MINE_CONTRACT"'"|gs|^log_contract_address = .*|log_contract_address = "'"$LOG_CONTRACT_ADDRESS"'"|gs|^reward_contract_address = .*|reward_contract_address = "'"$REWARD_CONTRACT"'"|g' $HOME/0g-storage-node/run/config.toml
5. Delete Old Database
Section titled “5. Delete Old Database”sudo rm -rf $HOME/0g-storage-node/run/db/
6. Restart the Storage Node
Section titled “6. Restart the Storage Node”sudo systemctl restart zgs
7. Check Logs
Section titled “7. Check Logs”tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
8. Monitor Sync Status
Section titled “8. Monitor Sync Status”source <(curl -s https://cdn.bangcode.id/0g/block_checker.sh)