Add a JSON node status command that reads a node's health event
Maintainer thường phản hồi trong vòng 1 ngày
@victrvondoom đang làm issue này rồi.
Từ ngày 19/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- cli, networking
Hướng nghiên cứu
Start with mostro-cli --output json schema to see how existing commands are listed, then read the health event protocol page linked in the issue for the reader rules. Add a node status command that queries the configured relays for kind 38389 and 38385, validates the events, and reports the state. Done when each reader rule has a unit test and docs/commands.md documents the output.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
There is no way to ask mostro-cli whether a Mostro node can do its job right now. mostrod publishes a signed health event (kind 38389, protocol: Health event) every minute, and Semáforo (MostroP2P/semaforo) reads it in the browser. Neither the health event nor the info event (kind 38385) is reachable from the CLI: mostro-cli --output json schema at 0.17.1 lists no command that reads either.
This blocks clients that drive the CLI. MostroP2P/mcp#11 adds a catalog of the trusted nodes listed at mostro.community and lets the user pick one. An agent helping the user choose should be able to say "Argentina is reporting down since 14:10" instead of sending the user to a node that cannot pay out. mostro-mcp does not speak Nostr and must not start: anything it needs from the relays is a mostro-cli command first.
Proposal
A read-only command, mostro-cli node status (contract name node.status), with --output json support.
- Input. One or more node public keys (
--node=<hex|npub>, repeatable). With none, the configuredMOSTRO_PUBKEY. Relays come from the usual configuration (RELAYS), with an optional--relays=override, so a client can check every node of a catalog in one run without changing its configured node. - No identity needed. The command reads public events only. It needs no mnemonic, no trade key and no local database, and never sends anything to a node.
- Reading the health event follows the protocol's What a reader owes as a stateless reader:
- verify the signature,
pubkey,kind=38389,z=health,d=pubkey, and every required tag (intervalwithin 30–3600,expiration=created_at + 3 × interval, no repeated tags or check names); - query every configured relay and keep the valid event with the highest
seq; - ignore an event more than 300 seconds in the future;
- report the state as
unknownwhen no valid event was found, when it has expired, or when it is older than3 × interval. Absence is neverok.
- verify the signature,
- Reading the info event (kind
38385): the instance name,mostro_version,escrow_mode, the fiat currencies, limits and fee it advertises, so a client can show what the node trades.
Output (one document, data.nodes[], one entry per requested key)
| Field | Meaning |
|---|---|
pubkey |
the node, lowercase hex |
name |
from the info event, or null |
state |
ok, degraded, down (the event's status) or unknown (no valid fresh event) |
unknown_reason |
when state is unknown: not_found, expired, stale or invalid; otherwise null |
maintenance_mode |
as reported |
checks |
[{name, state, since}], unknown names passed through, unknown states as unknown |
escrow_mode, lnd_network, lnd_block_height, lnd_synced_to_chain |
as reported; null when omitted |
mostro_version, interval, seq, created_at, expiration, event_id |
from the event used |
relays_answered |
which relays answered the query, so "not found" can be told from "no relay answered" |
independently_verified |
always false in this version (see below) |
info |
the info event fields above, or null |
When no relay answers, the document is an error with a code a client can tell apart from "the node published nothing".
Not in this issue
- The independent block-height cross-check. The protocol says watchers SHOULD compare
lnd_block_heightwith a block explorer or the median of trusted instances, and Semáforo does. Querying block explorers would add HTTP calls to third parties to a CLI that only talks to relays. This version reports what the node says about itself, marks itindependently_verified: false, and leaves the cross-check to a follow-up (a median over the requested nodes that share anlnd_networkwould need no explorer). - Watcher heartbeats published under the same kind.
- History or uptime. That is Semáforo's sampler; this command is a point-in-time read.
Acceptance criteria
-
node statusis listed bymostro-cli --output json schemawith its input and output schemas, as a command that needs no identity. - Each reader rule above has a unit test: bad signature, wrong
d, missing required tag, repeated tag, repeated check name,intervalout of range, wrongexpiration, futurecreated_at, expired, stale, and highestseqacross relays. - A missing, expired, stale or invalid event yields
state: unknownwith the matchingunknown_reason, neverok. - Several
--nodevalues are answered in one run, one entry each, in the order given. - No relay answering is an
erroroutcome distinct from an empty result. - Verified against the scripted relay or the regtest node (mostrod publishes the health event from v0.19.x), with the result recorded in the spec's tasks.
-
docs/commands.mdand the mostro-cli book document the command and its output.
- Ngôn ngữ chính
- Rust
- Star
- 39
- Fork
- 16
- Merge trung bình
- 6 giờ
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MostroP2P/mostro-cli
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
MostroP2P/mostro-cli#272 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
MostroP2P/mostro-cli#242 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Stablecoins as order currencies: check market price against the node's rates, not YadioCó thể đã có người làm @grunch đã nhận 41 ngày trước. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
MostroP2P/mostro-cli#213 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 74/100
MostroP2P/mostro-cli#200 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
MostroP2P/mostro-cli#188 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MostroP2P/mostro-cli
Issue tương tự
-
[Bug]: streaming_end_of_stream_only guardrails rescan the whole stream on every chunk - blocks event loopCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug llm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
build comp-keeper
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/ClickHouse#137202 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ops chore priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jdrouet/tinyobserve#267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Sweep due before phase 95Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
storytold/photocraft#20056 ·
Maintainer thường phản hồi trong vòng 1 ngày