system_health - JSON-RPC Method
Description
Returns basic health information about the node, including peer count and sync status.
Example Response
{
"peers": 95,
"isSyncing": false,
"shouldHavePeers": true
}
Code Examples
- cURL
- JavaScript
- Python
curl ${S.rpcBase} \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system_health",
"params": [],
"id": 1
}'
const res = await fetch('${S.rpcBase}', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', method: 'system_health', params: [], id: 1 })
});
console.log(await res.json());
import requests, json
url = '${S.rpcBase}'
payload = {"jsonrpc":"2.0","method":"system_health","params":[],"id":1}
print(requests.post(url, headers={"Content-Type":"application/json"}, data=json.dumps(payload)).json()["result"])