Add health check endpoint code (jsonrpsee based version) #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See: #82
This PR addresses the same issue but is based on Zebra
v2.4.2, which uses thejsonrpseecrate instead of the unmaintainedjsonrpccrate. Sincejsonrpseedoes not provide ahealth_apiserver builder method, the implementation usesProxyGetRequestLayerwith layer to expose the health check endpoint. The solution follows the health endpoint example from thejsonrpseerepo:https://github.com/paritytech/jsonrpsee/blob/master/tests/tests/helpers.rs#L290
The branch for this PR is based on the upstream
v2.4.2version rather thanmain. This was simpler here because a copy of thev2.4.2branch already exists in our fork, and it is effectively the same asmainin terms ofzebra-rpcandjsonrpseeusage.All other code, including the response structure definition and tests, was copied from the
arseni-health-endpointbranch.Finally,
ci-basic.ymlwas temporarily added to the.github/workflowsfolder to run CI for the PR. This file should be removed if the PR is submitted upstream. The tests pass, but the resulting Zebra node has not yet been built and tested withcurlto confirm the health endpoint.Add health check endpoint via the original RPC server
The endpoint will return this data for any GET request:
response:
{ "status": "healthy", "version": "1.0.0-beta.41", "git_tag": "v1.0.0-rc.1", "git_commit": "75397cd59d0bac4b4c1e71187bb8af7494efb8b4", "timestamp": "2025-09-02T22:35:14.756599+00:00" }