JSON_PORT=8545 # replace with the port you want to use
BLOCKCHAIN_RPC_ENDPOINT="http://$(wget -qO- eth0.me):$JSON_PORT"
sed -i 's|^blockchain_rpc_endpoint = ".*"|blockchain_rpc_endpoint = "'"$BLOCKCHAIN_RPC_ENDPOINT"'"|' $HOME/0g-storage-node/run/config.toml
echo "export BLOCKCHAIN_RPC_ENDPOINT=\"$BLOCKCHAIN_RPC_ENDPOINT\"" >> ~/.bash_profile
echo "BLOCKCHAIN_RPC_ENDPOINT: $BLOCKCHAIN_RPC_ENDPOINT"
# List all logs avialble on your machine
ls ~/0g-storage-node/run/log/
# Monitor the latest log available (auto-fetch date)
tail -f ~/0g-storage-node/run/log/zgs.log.$(date +%Y-%m-%d)