Health status of the fullnode
GET/health
Returns 200 if the fullnode should be considered healthy.
Returns 503 otherwise. The response will contain the components that were considered for the healthcheck and the reason why they were unhealthy.
Returning 503 with a response body is not the standard behavior for our API, but it was chosen because most healthcheck tools expect a 503 response code to indicate that the service is unhealthy.
Optionally, there is a query parameter 'strict_status_code' that can be used to return 200 even if the fullnode is unhealthy. When its value is 1, the response will always be 200.
We currently perform 2 checks in the sync mechanism for the healthcheck:
- Whether the fullnode has recent block activity, i.e. if the fullnode has blocks with recent timestamps.
- Whether the fullnode has at least one synced peer
Request
Query Parameters
Enables strict status code. If set to 1, the response will always be 200.
Responses
- 200
- 503
Healthy
- application/json
- Schema
- healthy
Schema
any
Healthy node
{
"status": "pass",
"description": "Hathor-core v0.56.0",
"checks": {
"sync": [
{
"componentName": "sync",
"componentType": "internal",
"status": "pass",
"output": "Healthy"
}
]
}
}
Unhealthy
- application/json
- Schema
- no_recent_activity
- no_synced_peer
- peer_best_block_far_ahead
Schema
any
Node with no recent activity
{
"status": "fail",
"description": "Hathor-core v0.56.0",
"checks": {
"sync": [
{
"componentName": "sync",
"componentType": "internal",
"status": "fail",
"output": "Node doesn't have recent blocks"
}
]
}
}
Node with no synced peer
{
"status": "fail",
"description": "Hathor-core v0.56.0",
"checks": {
"sync": [
{
"componentName": "sync",
"componentType": "internal",
"status": "fail",
"output": "Node doesn't have a synced peer"
}
]
}
}
Peer with best block too far ahead
{
"status": "fail",
"description": "Hathor-core v0.56.0",
"checks": {
"sync": [
{
"componentName": "sync",
"componentType": "internal",
"status": "fail",
"output": "Node's peer with highest height is too far ahead."
}
]
}
}