Skip to content

Commit

Permalink
tendermint-http
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Nov 18, 2023
1 parent f901a2f commit b5059f2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@ jobs:
run: |
url="${{ matrix.url }}"
type="${{ matrix.type }}"
response=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' "$url")
if echo "$response" | jq -e .id &> /dev/null; then
response=""
status_check="false"
if [ "$type" = "evm" ]; then
response=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' "$url")
status_check=$(echo "$response" | jq -e '.id' &> /dev/null && echo "true" || echo "false")
elif [ "$type" = "tendermint-http" ]; then
response=$(curl -s "${url}/status")
status_check=$(echo "$response" | jq -e '.jsonrpc' &> /dev/null && echo "true" || echo "false")
fi
if [ "$status_check" = "true" ]; then
echo "✅ $url - Successful"
else
echo "❌ $url - Failed"
Expand Down

0 comments on commit b5059f2

Please sign in to comment.