Skip to main content

๐Ÿฉบ Node Status Reports

A node package can tell the Dappnode dashboard what its client is doing: which sync phase it is in and how far along, what it does before its API answers (for example downloading a snapshot), what keeps running after it reached the head, and which problems it sees. The package declares its nodes in the manifest field nodes, and the service's Docker healthcheck prints a small JSON status report.

info

Today the dappmanager reads status reports from execution clients only: the service declared with role: "execution" and report: "healthcheck" in the package selected as execution client for a network in Stakers. It also calls the JSON-RPC and beacon API on the ports the selected packages declare. The rest of the nodes field is defined but not used yet, see Not used yet.

What the user seesโ€‹

The dashboard shows a card for each staking network, with one row for the execution client and one for the consensus client.

ElementExampleComes from
State badgeSynced, Syncing, Waiting, StalledDappmanager
Badge when the API does not answerStarting, Stopped, Not respondingDappmanager
Sync line, while not syncedDownloading state ยท 42% ยท about 1 h 5 min leftPhase from the report; percentage, distance behind and time left computed by the dappmanager
Progress barMeasured, or a moving bar when nothing can be measuredDappmanager, from the report's progress or position and target
Phase while the API does not answerDownloading snapshot ยท 37% under a Starting badgeReport (state: "starting")
Background line, once syncedIndexing transactions in the backgroundReport background
WarningsLow disk spaceReport issues, plus No peers from the dappmanager
Tooltip on the badgeLatest block, Reports syncing, Package status report: YesDappmanager lines, then the report's details

Who decides whatโ€‹

The package says what its client is doing; the dappmanager decides the status. A report never makes a node show as synced.

QuestionDecided by
Phase and how far along it isPackage
What happens before the API answersPackage
Work that continues after reaching the headPackage
Problems the client reports about itselfPackage
Whether the execution client is synced: its latest block is at most 3 minutes oldDappmanager
Waiting for the consensus clientDappmanager
Stalled: a phase measured in blocks, or the catch-up to the head, has not moved for 5 minutes; or a node that is not synced has no peersDappmanager
Time left, and time and blocks behindDappmanager
Which address to callDappmanager

Declare the nodes in the manifestโ€‹

nodes is keyed by compose service name. Shared fields go in the root dappnode_package.json; each variant manifest adds only network (the SDK merges root and variant manifests recursively).

Root manifest:

"nodes": {
"reth": {
"role": "execution",
"probe": { "kind": "ethereum-execution", "rpcPort": 8545, "enginePort": 8551 },
"report": "healthcheck"
}
}

Variant manifest (package_variants/hoodi/dappnode_package.json):

"nodes": { "reth": { "network": "hoodi" } }
  • The key must be the compose service whose container runs the healthcheck. The SDK does not check it yet; a key that matches no service means the report is never read.
  • network is the dappmanager network name: mainnet, gnosis, hoodi, sepolia or lukso.
  • Use the ports the client really listens on. No hostnames or URLs anywhere.

The full field description is in the manifest reference.

The status reportโ€‹

One JSON object, printed as the last line of stdout of the healthcheck. At most 2,048 bytes. Only version and state are required. Leave out anything you do not know rather than sending null or 0.

FieldType and limitsMeaning
version1Required.
statestarting, syncing, synced or errorRequired. The client's own view. starting: the node's API does not answer yet (start-up, snapshot or checkpoint download, database opening).
phasestring, up to 60 charactersWhat the node is doing, e.g. Downloading state. Sentence case, no trailing period.
progressnumber, 0-100Progress of the current phase as a percentage. Never 100 while the phase is still running: cap at 99.9.
heightintegerLatest block the node serves (number of eth_getBlockByNumber("latest")).
headTimeinteger, Unix secondsTimestamp of that block.
positionintegerFor a phase measured in blocks: the block the phase has reached. May differ from height.
targetintegerThe block the node syncs towards, when the client knows it.
unitstring, up to 20 charactersUnit of height, position and target. Default blocks.
peersintegerConnected peers.
awaitingTargettrueThe client has nothing to sync towards yet. Omit otherwise.
backgroundstring, up to 60 charactersWork that continues after reaching the head, e.g. Indexing transactions.
issuesup to 5 strings, up to 120 characters eachProblems the client reports about itself, e.g. Low disk space.
detailsup to 8 { "label", "value" } objects, label up to 40 characters, value up to 120Extra lines for the tooltip, already formatted.

For an execution client the dappmanager reads state (only starting, see below), phase, progress, position, target, awaitingTarget, background, issues and details. It takes the latest block and peers from the client's JSON-RPC, so height, headTime, peers and unit are not read today; include them anyway, they are cheap and useful for other consumers.

Examples:

{"version":1,"state":"starting","phase":"Downloading snapshot","progress":37.5}
{"version":1,"state":"syncing","phase":"Executing blocks","position":21000000,"target":21500000,"height":20990000,"headTime":1730000000,"peers":25}
{"version":1,"state":"synced","height":21500000,"headTime":1732960000,"peers":31,"background":"Indexing transactions"}

progress or position and targetโ€‹

Measure a phase one way, not both.

The phase isSendThe dappmanager shows
Measured in blocksphase, position, target (with target greater than position)Percentage counted from where it first saw the phase, blocks behind, time left; Stalled after 5 minutes without movement
Measured as a share of its own workphase, progressThe percentage and time left estimated from how fast it moves
Not measurablephase onlyThe phase with a moving bar

The dappmanager tracks progress per phase name, so a new phase value starts a new measurement. Keep phase names stable: no counters or numbers in them. Use the same wording as other clients where it fits, e.g. Downloading block headers, Downloading state, Healing state, Executing blocks, Catching up.

awaitingTargetโ€‹

Send awaitingTarget: true when the client has nothing to sync towards, for example an execution client that no consensus client has driven since it started. The dappmanager then shows the node as Waiting for the consensus client while the consensus client is not at the head, and as Syncing with your phase (or Starting to sync) once it is.

backgroundโ€‹

Work that goes on after the node reached the head. It is shown only while the node is synced, as <background> in the background, so write it as an activity: Indexing transactions, Pruning old receipts.

issuesโ€‹

Short problems the client reports about itself, shown as warnings whether or not the node is synced. Do not report No peers: the dappmanager adds it from the peer count.

detailsโ€‹

Lines appended to the tooltip under the dappmanager's own lines, as label: value. Format values for people (1,234,567, 3 h 5 min); they are shown as plain text.

stateโ€‹

  • starting: while the API does not answer and the container is running, the dashboard shows your phase and progress under the Starting badge. Use it for long pre-start work such as a snapshot download; let the entrypoint leave a marker the script can read (e.g. under /tmp).
  • syncing, synced: the client's own view. The dappmanager ignores synced and decides by itself.
  • error: the client cannot work. The healthcheck exits non-zero, so Docker marks the container unhealthy after retries failed runs. The dashboard does not treat this state specially today: send the reason as an issue.

Healthcheck conventionsโ€‹

services:
reth:
healthcheck:
test: ["CMD", "/usr/local/bin/node-status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
RuleWhy
Exactly one JSON object as the last line of stdout, nothing else on stdout.The dappmanager parses only the last non-empty line.
Diagnostics, if any, go to stderr, are short and are written before the report.Docker stores stdout and stderr together, at most 4,096 bytes per run.
Exit 0 for starting, syncing and synced; non-zero only for error or when nothing could be determined.A syncing node must not be unhealthy.
Answer before the node's API is up: report starting, with a phase for long pre-start work.The report is the only way to show what the client does before its API answers.
Every network call has its own 2-3 s timeout; stop after the first call that fails.A run that exceeds the healthcheck timeout records no report.
Call only 127.0.0.1 or localhost. Write nothing to the data directory.The script runs every interval inside the client's container.
Never print credentials or secrets.Docker stores the output, and the report's strings are shown in the dashboard.
POSIX sh; depend only on curl and jq.The images are Alpine or Debian based.

Make the script executable for the user the container runs as. Docker ADD from a URL creates files with mode 600:

ADD ${STAKER_SCRIPTS_URL}/node_status_tools.sh /etc/profile.d/
COPY node-status.sh /usr/local/bin/node-status
RUN chmod +r /etc/profile.d/node_status_tools.sh && chmod +rx /usr/local/bin/node-status

Missing, stale or invalid reportsโ€‹

A report can only add detail. Whatever the report says, the dappmanager decides from the client's own API whether it is synced.

SituationWhat the dappmanager does
No nodes declaration, or no report: "healthcheck"Does not read the healthcheck output. The tooltip shows Package status report: No.
No reportJudges the client from its JSON-RPC alone: Waiting if the consensus client is not at the head, otherwise Catching up, measured by how fast the latest block's timestamp closes on the clock.
Latest healthcheck run older than 3 intervals (90 s with a 30 s interval)Treats it as no report.
Last line not JSON, over 2,048 bytes, version not 1 or unknown stateTreats it as no report.
A field with a wrong type or a negative numberDrops that field and keeps the rest. Unknown fields are ignored.
Strings too long or with control charactersRemoves control characters and cuts them to the limits. progress is clamped to 0-100.
state: "synced" but the latest block is older than 3 minutesShows the node as syncing, waiting or stalled.

Shared helpers for staker packagesโ€‹

Staker packages use the helpers in node_status_tools.sh from dappnode/staker-package-scripts. Each package keeps its client-specific logic in its own script; the helpers call the local node with short timeouts, read Prometheus metrics and print a report that respects the limits above. Their full reference is in the repository README.

FunctionUse
ns_rpc <method> [params]Calls the JSON-RPC on 127.0.0.1:${NS_RPC_PORT:-8545} and prints the result. Exit 1 when the node does not answer.
ns_http_get <url>GETs a local URL (http://127.0.0.1 or http://localhost only).
ns_metric <name> [label=value ...]Reads Prometheus text on stdin and prints the value of a metric.
ns_hex_to_dec, ns_json_getConvert a hex quantity; read a field of a JSON document.
ns_block_headPrints height=<n> headTime=<n> of the latest block, to pass unquoted to ns_emit.
ns_emit <state> [key=value ...]Prints the report as one JSON line. Repeat issue=<text> and detail=<Label>:<Value>. Exit 0 for starting, syncing and synced, 1 for error.

NS_TIMEOUT sets the timeout of every request (default 3 s). ns_emit drops empty and invalid values, caps progress at 99.9 unless the state is synced, and drops details, then issues, until the line fits in 2,048 bytes. It cuts detail labels to 40 characters and values to 120, the same limits the dappmanager applies.

Example for an execution client (the snapshot marker and the metric are illustrative):

#!/bin/sh
. "${NS_TOOLS:-/etc/profile.d/node_status_tools.sh}"

# The JSON-RPC does not answer yet: say what the entrypoint is doing
if ! syncing=$(ns_rpc eth_syncing); then
if [ -f /tmp/snapshot-progress ]; then
ns_emit starting phase="Downloading snapshot" progress="$(cat /tmp/snapshot-progress)"
else
ns_emit starting
fi
exit $?
fi

head=$(ns_block_head)
peers=$(ns_json_get "$(ns_rpc net_peerCount)" .)

if [ "$syncing" = "false" ]; then
# shellcheck disable=SC2086 # head holds two key=value arguments
ns_emit synced $head peers="$peers"
exit $?
fi

current=$(ns_json_get "$syncing" .currentBlock)
highest=$(ns_json_get "$syncing" .highestBlock)
awaiting=""
[ "$highest" = "0x0" ] && awaiting=true
# shellcheck disable=SC2086
ns_emit syncing $head peers="$peers" phase="Downloading blocks" \
position="$current" target="$highest" awaitingTarget="$awaiting"
exit $?

Test a script locallyโ€‹

Make the helpers' path overridable (the example above reads NS_TOOLS), stub curl with a shell function that returns canned replies, run the script in a subshell and check the output with jq:

#!/bin/sh
NS_TOOLS=../staker-package-scripts/scripts/node_status_tools.sh

# Replies by JSON-RPC method; any other call fails like a refused connection
curl() {
case "$*" in
*eth_syncing*) printf '%s' '{"jsonrpc":"2.0","id":1,"result":{"currentBlock":"0x10","highestBlock":"0x20"}}' ;;
*eth_getBlockByNumber*) printf '%s' '{"jsonrpc":"2.0","id":1,"result":{"number":"0x10","timestamp":"0x6553f100"}}' ;;
*net_peerCount*) printf '%s' '{"jsonrpc":"2.0","id":1,"result":"0x5"}' ;;
*) return 7 ;;
esac
}

out=$(. ./node-status.sh)
printf '%s\n' "$out" | tail -n 1 | jq -e '.version == 1 and .state == "syncing" and .position == 16'

Run it under the shell of your image (busybox ash on Alpine, dash on Debian), and cover every phase, the API not answering, the background note and the exit codes.

On a Dappnode, check what the dappmanager will read:

docker exec <container> /usr/local/bin/node-status; echo "exit $?"
docker inspect --format '{{json .State.Health}}' <container> | jq -r '.Log[-1].Output' | tail -n 1 | jq .

Not used yetโ€‹

These parts of the nodes field are defined so packages can declare them now, but the dappmanager does not use them yet. Do not rely on any behaviour from them.

PartStatus
probe.kind and probe.enginePortRequired, but not read yet. The dashboard reaches the selected clients through the Stakers aliases execution.<network>.dncore.dappnode and beacon-chain.<network>.dncore.dappnode (see DNS), on the declared probe.rpcPort and probe.apiPort, or on 8545 and 3500 when a package declares none.
Reports from consensus clientsNot read: the consensus client's status comes from its beacon API alone.
probe.kind: "status-report" and maxHeadAgeSecondsReserved for nodes that are not Ethereum clients, judged from their report.
role: "node" and role: "validator"Reserved.
report: { "http": { "port", "path" } }Reserved: the report served over HTTP by the same service.
requires, validatorServiceReserved.
Choosing clients from the declarationThe Stakers UI still uses its own list of client packages.