Repository navigation
feat: add node status helpers for package healthchecks - #12
Merged
Merged
Conversation
Shared shell helpers for the healthcheck scripts that print a node's status report: JSON-RPC calls, Prometheus metric lookup and report printing with the contract's limits.
This was referenced Nov 30, 2026
Merged
Open
Open
This was referenced Nov 30, 2026
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
Node packages will report what their client is doing through their Docker healthcheck, as one small JSON line (a "status report"). The dappmanager reads it from Docker's health log and uses it for the phase and percentage on the dashboard, while deciding by itself whether the node is synced. The dappmanager side is in dappnode/DNP_DAPPMANAGER#2520.
Each execution client package holds its own client-specific script. This PR adds the shared helpers those scripts use, so five packages don't each re-implement JSON-RPC calls, Prometheus parsing and report printing.
Approach
scripts/node_status_tools.sh: a POSIXshlibrary that only defines functions and needs onlycurlandjq(1.6 or later).ns_rpc <method> [params]: JSON-RPC call to127.0.0.1:${NS_RPC_PORT:-8545}with a short timeout; prints theresult.ns_http_get <url>: GET for local URLs only.ns_metric <name> [label=value ...]: value of a Prometheus sample read from stdin.ns_hex_to_dec,ns_json_get,ns_block_head: small conversions and the latest block.ns_emit <state> [key=value ...]: prints the report as one JSON line, drops empty or invalid values, enforces the length limits and the 2,048 byte cap, and returns 0 forstarting,syncingandsynced.test/node_status_tools_test.sh: plainshtests with a stubbedcurl..github/workflows/test.yml: runs the tests on pull requests under dash and in Alpine (busybox ash).The release workflow needs no change: it already publishes every file in
scripts/and appendscommon_tools.shto each. A test sources the combined file to confirm there are no name clashes.Release
The five execution client packages pin
STAKER_SCRIPTS_VERSION: v0.1.3in their PRs, so this needs to be released asv0.1.3before their images can build.Test instructions
sh test/node_status_tools_test.sh(130 checks). Passes under dash, busybox ash (Alpine, jq 1.8) and Debian bookworm with jq 1.6.-s sh) is clean.Not tested against a live client here; the package PRs do that.