Repository navigation
Conversation
The healthcheck prints a status report that says whether the node is synced and what it is doing, declared in the manifest `nodes` field with the status-report probe.
Contributor
|
Dappnode bot has built and pinned the built packages to an IPFS node, for commit: c57972f This is a development version and should only be installed for testing purposes.
Hash: (by dappnodebot/build-action) |
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
The dappmanager dashboard is gaining a status card for every node package, not only Ethereum staking clients. For a node it has no built-in knowledge of, the package itself says whether the node is synced, how far along it is and what it is doing, through its Docker healthcheck. The dappmanager adds what is the same for every chain: stall detection, time left and waiting on a required node. The contract and the dappmanager side are in dappnode/DNP_DAPPMANAGER#2520; the shared shell helpers are released in
staker-package-scriptsv0.1.3 (dappnode/staker-package-scripts#12).The dappmanager does not display
status-reportnodes yet: #2520 reads reports from Ethereum execution clients only. This package ships the declaration and the healthcheck ahead of that, which is safe: current dappmanagers ignore both.Approach
nodesdeclares thenearservice as anodeon networknearwith thestatus-reportprobe,maxHeadAgeSeconds: 120andreport: healthcheck.neard_image/node-status.shreads the JSON-RPCstatusandnetwork_infoand, while syncing, the metrics on the same port, and prints one JSON line. It exits 0 while starting or syncing.start_near.shleaves a marker under/tmp/node-statuswhile it initialises the node and while it runs the snapshot step, so the healthcheck can say what is happening beforeneardserves its RPC. The marker is trusted only while that script's process is alive, and what the script does is unchanged.node_status_tools.shfrom the v0.1.3 release and the script as/usr/local/bin/node-status.What it reports
Checked against the nearcore source at 2.14.1.
starting, with "Initializing node" or "Downloading snapshot"syncedsync_info.syncingis false and the latest block is at most 120 s oldsyncing"Waiting for peers", "Downloading epoch sync proof", "Downloading block headers", "Downloading state" or "Applying state", "Downloading blocks"near_sync_statusgauge, withnear_state_sync_stageper shard and the header head as the target for block downloadsyncing"Catching up"Blocks come about every 0.6 s and neard's own
/healthfails after 20 s without one; 120 s leaves a margin for short stalls.Test instructions
sh test/node_status_test.sh(220 checks). Passes under dash, bash,bash --posix, busybox and inside the built image.starting, and Docker showed the container healthy.statusandnetwork_inforeplies from the public mainnet RPC (2.14.1) and reportedsyncedwith height and peers.Not run against a local synced node:
neardcrashes with "Illegal instruction" on the development machine, whose CPU has no AVX.Found on the way, not changed here
DOWNLOAD_SNAPSHOT=truehas no effect and a new node syncs from scratch.neard ping --protocol-version 76is below the minimum supported version.ACCOUNT_IDempty, init gets--account-id=.pool.near.