NagyZoltanPeter 6d135b0d1b
chore: Separation of node health and initialization state from rln_relay (#2612)
* Separation of node health and initialization state from rln_relay status. Make (only) health endpoint avail early and install others in the last stage of node setup.

* Proper json report from /health, adjusted and fixed test, added convenient script for checking node health

* Stop wakunode2 if configured rest server cannot be started

* Fix wakuRlnRelay protocol existence check

* Fix typo

* Removed unused imports from touched files.

* Added missing /health test for all
2024-04-23 18:53:18 +02:00

16 lines
438 B
Nim

when (NimMajor, NimMinor) < (1, 4):
{.push raises: [Defect].}
else:
{.push raises: [].}
import
chronicles, json_serialization, json_serialization/std/options, presto/[route, client]
import ./types, ../serdes, ../responses, ../rest_serdes, ../../waku/node/health_monitor
logScope:
topics = "waku node rest health_api"
proc healthCheck*(): RestResponse[HealthReport] {.
rest, endpoint: "/health", meth: HttpMethod.MethodGet
.}