Skip to content

Conversation

@dmidem
Copy link
Collaborator

@dmidem dmidem commented Sep 18, 2025

See: #82

This PR addresses the same issue but is based on Zebra v2.4.2, which uses the jsonrpsee crate instead of the unmaintained jsonrpc crate. Since jsonrpsee does not provide a health_api server builder method, the implementation uses ProxyGetRequestLayer with layer to expose the health check endpoint. The solution follows the health endpoint example from the jsonrpsee repo:
https://github.com/paritytech/jsonrpsee/blob/master/tests/tests/helpers.rs#L290

The branch for this PR is based on the upstream v2.4.2 version rather than main. This was simpler here because a copy of the v2.4.2 branch already exists in our fork, and it is effectively the same as main in terms of zebra-rpc and jsonrpsee usage.

All other code, including the response structure definition and tests, was copied from the arseni-health-endpoint branch.

Finally, ci-basic.yml was temporarily added to the .github/workflows folder 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 with curl to confirm the health endpoint.

Add health check endpoint via the original RPC server
The endpoint will return this data for any GET request:

curl -s http://127.0.0.1:8232/health

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"
}

Copy link
Collaborator

@seniakalma seniakalma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@PaulLaux PaulLaux marked this pull request as ready for review September 22, 2025 10:51
Copy link

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Added one comment and we can open it for upstream.

Also, for upstream, we need changelog documentation and any other step mentioned it the upstream PR template.

@PaulLaux
Copy link

PaulLaux commented Oct 2, 2025

closed in favor of #90

@PaulLaux PaulLaux closed this Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants