sync-status: add cosmos/CometBFT handler (gaiad + cosmos batch)
Cosmos-hub has NO EVM RPC — eth_blockNumber checks don't apply. Add a --cosmos handler that probes the CometBFT /status method: sync_info.catching_up=false => online, else syncing; optional head-gap check vs the drpc reference. sync-status.sh dispatches protocol=cosmos -> check-health.sh --cosmos. eth/starknet/aztec untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -54,7 +54,7 @@ for path in $pathlist; do
|
||||
fi
|
||||
|
||||
case "$protocol" in
|
||||
eth|starknet|aztec)
|
||||
eth|starknet|aztec|cosmos)
|
||||
;;
|
||||
*)
|
||||
# Protocol family known from the registry but no probe support
|
||||
@@ -67,8 +67,10 @@ for path in $pathlist; do
|
||||
|
||||
is_starknet=false
|
||||
is_aztec=false
|
||||
is_cosmos=false
|
||||
[ "$protocol" = "starknet" ] && is_starknet=true
|
||||
[ "$protocol" = "aztec" ] && is_aztec=true
|
||||
[ "$protocol" = "cosmos" ] && is_cosmos=true
|
||||
|
||||
ref=''
|
||||
if [ -n "$2" ]; then
|
||||
@@ -127,6 +129,12 @@ for path in $pathlist; do
|
||||
echo "error"
|
||||
exit 1
|
||||
fi
|
||||
elif $is_cosmos; then
|
||||
# Cosmos/CometBFT: no chainid. Reference by drpc slug (optional — the node's
|
||||
# own sync_info.catching_up is authoritative; ref only adds a head-gap check).
|
||||
if [ -n "$chain_slug" ]; then
|
||||
ref=$($BASEPATH/reference-rpc-endpoint.sh --chain "$chain_slug" 2>/dev/null) || ref=""
|
||||
fi
|
||||
else
|
||||
# Ethereum chain ID detection
|
||||
chain_id_response=$(curl -L --ipv4 -m 1 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' $RPC_URL)
|
||||
@@ -155,6 +163,8 @@ for path in $pathlist; do
|
||||
$BASEPATH/check-health.sh "$RPC_URL" --aztec $ref
|
||||
elif $is_starknet; then
|
||||
$BASEPATH/check-health.sh "$RPC_URL" --starknet $ref
|
||||
elif $is_cosmos; then
|
||||
$BASEPATH/check-health.sh "$RPC_URL" --cosmos $ref
|
||||
else
|
||||
$BASEPATH/check-health.sh "$RPC_URL" $ref
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user