@@ -37,21 +37,18 @@ for node_url in $plain_nodes; do
3737 graphql_url=" ${node_url} graphql"
3838
3939 # Test daemon status query using the website script
40- if response=$( bash website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh " $graphql_url " 2> /dev/null) ; then
41- # Extract JSON response (skip curl progress output)
42- json_response=$( echo " $response " | grep " ^{" )
43-
40+ if response=$( bash website/docs/developers/scripts/graphql-api/queries/curl/daemon-status.sh " $graphql_url " 2>&1 ) ; then
4441 # Check if it's valid JSON
45- if echo " $json_response " | jq . > /dev/null 2>&1 ; then
42+ if echo " $response " | jq . > /dev/null 2>&1 ; then
4643 # Check for GraphQL errors
47- if echo " $json_response " | jq -e ' .errors' > /dev/null 2>&1 ; then
44+ if echo " $response " | jq -e ' .errors' > /dev/null 2>&1 ; then
4845 echo " ⚠️ $graphql_url returned GraphQL error:"
49- echo " $json_response " | jq ' .errors'
46+ echo " $response " | jq ' .errors'
5047 # Check for valid data
51- elif echo " $json_response " | jq -e ' .data.daemonStatus' > /dev/null 2>&1 ; then
48+ elif echo " $response " | jq -e ' .data.daemonStatus' > /dev/null 2>&1 ; then
5249 echo " ✅ $graphql_url GraphQL query successful"
53- sync_status=$( echo " $json_response " | jq -r ' .data.daemonStatus.syncStatus // "unknown"' )
54- chain_id=$( echo " $json_response " | jq -r ' .data.daemonStatus.chainId // "unknown"' )
50+ sync_status=$( echo " $response " | jq -r ' .data.daemonStatus.syncStatus // "unknown"' )
51+ chain_id=$( echo " $response " | jq -r ' .data.daemonStatus.chainId // "unknown"' )
5552 echo " Sync Status: $sync_status , Chain ID: ${chain_id: 0: 16} ..."
5653 else
5754 echo " ⚠️ $graphql_url unexpected response format"
0 commit comments