Skip to content

Instantly share code, notes, and snippets.

@rhazberries
Last active August 20, 2020 19:56
Show Gist options
  • Save rhazberries/41135cfc7540b6b55f4728dbaf75ca1f to your computer and use it in GitHub Desktop.
Save rhazberries/41135cfc7540b6b55f4728dbaf75ca1f to your computer and use it in GitHub Desktop.
Check Harmony endpoint health

New RPCs

hmy_inSync Returns a boolean, indicating whether the node is sync with the shard chain (true) or currently syncing to catch up to the shard chain max height (false)

hmy_beaconInSync Returns a boolean. It is the same as the previous one, but it checks the beacon chain (shard 0) currently on the node.

These RPCs will work for any of our endpoints & any nodes that have open RPC ports!

Example CURL commands:

$ curl --location --request POST 'https://api.s0.t.hmny.io' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "hmy_inSync",
    "params": [],
    "id": 1
}' | jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}

$ curl --location --request POST 'https://api.s0.t.hmny.io' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "hmy_beaconInSync",
    "params": [],
    "id": 1
}'| jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}
@LeoHChen
Copy link

Other two api end points are:

https://api0.s0.t.hmny.io
https://api1.s0.t.hmny.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment