Repository navigation
fix: run the mainnet bootstrap probes without the OpenClaw gateway container #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Mainnet service monitoring | ||
|
|
||
| `mainnet-services.py` runs on `ubuntu-server-2` every 60 seconds | ||
| (`dash-mainnet-services.timer`) and writes its results to | ||
| `/var/lib/dash-mainnet-services/samples.json`. The mainnet observer on the same | ||
| host forwards that file to the console as `serviceChecks`, and the console shows | ||
| the rows under Mainnet. The probes only read. Nothing here changes mainnet. | ||
|
|
||
| The observer deployed on the host has the forwarding code; | ||
| `deploy/mainnet-observer.py` in this repository does not have it yet. | ||
|
|
||
| ## What is checked | ||
|
|
||
| | Id | Check | | ||
| |---|---| | ||
| | `quorums` | The quorum API's hash set equals the `llmq_100_67` list of the host's own mainnet Core | | ||
| | `insight` | Insight is synced, within 6 blocks of Core, serves a block and a transaction, and agrees with Core on the block hash | | ||
| | `seed-1`, `seed-2`, `seed-3` | Trusted TLS with more than 36 hours left, then a `@dashevo/dapi-client` bootstrap through that seed alone | | ||
| | `bootstrap` | A `@dashevo/dapi-client` bootstrap with the client's default seeds | | ||
| | `quorums-tls`, `insight-tls` | Trusted TLS with more than 36 hours left | | ||
| | `observer` | The console's mainnet report is younger than 4 minutes and Core answered | | ||
| | `core`, `platform`, `chainlocks` | The stall and ChainLock-age signals in that report | | ||
|
|
||
| A check that has no reference to compare against reports `reference-unavailable`, | ||
| never a success. A check that throws reports `probe-failed`. | ||
|
|
||
| ## What it needs on the host | ||
|
|
||
| - Python 3, standard library only. | ||
| - Docker, and the mainnet Core container `dashmate_dbb2a15d_mainnet-core-1` for | ||
| the reference chain and quorum list (`docker exec … dash-cli`). | ||
| - The npm tree from `mainnet-services-runtime/` in | ||
| `/opt/dash-mainnet-services/runtime`. Each bootstrap check runs it in its own | ||
| `docker run --rm` container from a Node image pinned by digest: read-only, | ||
| non-root, no capabilities, with the tree mounted read-only. | ||
|
|
||
| Until 2026-11-22 the bootstrap checks ran with `docker exec` inside the OpenClaw | ||
| gateway container. When that container was stopped, the four checks reported | ||
| `probe-failed` every minute without testing anything. A container per probe | ||
| leaves nothing that can be stopped. | ||
|
|
||
| ## Install | ||
|
|
||
| ```sh | ||
| install -d /opt/dash-mainnet-services/runtime | ||
| install -m 0644 deploy/mainnet-services-runtime/package.json \ | ||
| deploy/mainnet-services-runtime/package-lock.json /opt/dash-mainnet-services/runtime/ | ||
| docker run --rm -v /opt/dash-mainnet-services/runtime:/work -w /work \ | ||
| "$(sed -n "s/^NODE_IMAGE = '\(.*\)'$/\1/p" deploy/mainnet-services.py)" \ | ||
| npm ci --omit=dev --ignore-scripts | ||
| install -m 0644 deploy/mainnet-services.py deploy/test_mainnet_services.py /opt/dash-mainnet-services/ | ||
| (cd /opt/dash-mainnet-services && python3 -m unittest test_mainnet_services.py) | ||
| install -m 0644 deploy/dash-mainnet-services.service deploy/dash-mainnet-services.timer /etc/systemd/system/ | ||
| systemctl daemon-reload | ||
|
ktechmidas marked this conversation as resolved.
Resolved
|
||
| systemctl enable --now dash-mainnet-services.timer | ||
| ``` | ||
|
|
||
| To replace the script: stop `dash-mainnet-services.timer`, wait until | ||
| `dash-mainnet-services.service` is inactive, copy `mainnet-services.py` and | ||
| `test_mainnet_services.py` into `/opt/dash-mainnet-services/`, run the tests | ||
| there (`python3 -m unittest test_mainnet_services.py`), then start the timer. | ||
|
|
||
| ## Paging | ||
|
|
||
| The script also holds a notifier (`mainnet-services.py notify`). It pages Slack | ||
| `C0AMAE6E82F` once per issue after three consecutive failed samples and keeps | ||
| its receipts in `alerts.json`. It does not run: its timer, | ||
| `dash-mainnet-alerts.timer`, is disabled on the host since 2026-10-31, and its | ||
| unit files are not in this repository. It sends through the OpenClaw gateway | ||
| container, so it could not deliver while that container is stopped. | ||
|
|
||
| ## Limits | ||
|
|
||
| - The probes and the observer share one host. If the host is lost, the only | ||
| signal is the console marking the mainnet report stale. | ||
| - The seed checks cover the three managed seed hostnames. `bootstrap` covers | ||
| what a default client sees, which includes seeds this team does not run. | ||
| - Disk and memory of the quorum and Insight hosts are not checked here. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [Unit] | ||
| Description=Read-only Mainnet public service functional probes | ||
| After=docker.service network-online.target | ||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/bin/python3 /opt/dash-mainnet-services/mainnet-services.py | ||
| TimeoutStartSec=120 | ||
| StateDirectory=dash-mainnet-services | ||
| StateDirectoryMode=0700 | ||
| UMask=0077 | ||
| NoNewPrivileges=yes | ||
| PrivateTmp=yes | ||
| ProtectSystem=strict | ||
| ProtectHome=yes |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [Unit] | ||
| Description=Check Mainnet services every minute | ||
| [Timer] | ||
| OnBootSec=20s | ||
| OnUnitActiveSec=60s | ||
| AccuracySec=2s | ||
| [Install] | ||
| WantedBy=timers.target |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.