Expand description
Wire types for the loopback admin JSON-RPC surface (appendix-local-admin-http.md).
Shared between the daemon (which implements AdminRpcServer over a
local cache + peer table) and the user CLI (which speaks
AdminRpcClient from decdn node …). jsonrpsee’s
#[rpc(server, client)] macro consumes the source AdminRpc trait
and emits separate AdminRpcServer / AdminRpcClient traits in its
place; the original AdminRpc name is not a linkable rustdoc item,
hence the bare backticks.
DTO fields are deliberately wire-only: no engine handles, no
peer-table types, no daemon runtime types. They use simple owned
values (String, u64, primitive arrays). Pulling decdn-common
into the CLI does not pull the daemon runtime.
The helper parse_hash_arg returns Hash from the
decdn-config-types leaf crate (the same leaf the typed config
fields DecompressMode, RetryPolicy, OriginUrl, PinnedHashes
come from). That keeps decdn-cache/iroh-blobs out of the publisher
CLI’s dependency tree (#578); the daemon’s evict handler converts
the leaf hash to the blob-store hash at its boundary via
decdn_cache::to_store_hash. The parser is used only by that
handler today.
Structs§
- Bucket
Stat - Per-bucket fill stat for
admin_v1_status(issue #741). One entry per non-empty Kademlia k-bucket — empty buckets (the vast majority of the 256-bucket keyspace on a small network) are omitted so the snapshot stays compact. The bucket capacity is the same KademliaKfor every bucket and so lives once onRoutingHealth::bucket_capacityrather than being repeated here. - Buyer
Lane Snapshot - One lane the node pays on, as the buyer’s own store records it
(
admin_v1_pools). The buyer-side mirror ofLaneSnapshot: where that reports what a lane has accrued against this node, this reports what this node has already promised to pay a provider. - Buyer
Pool Snapshot - One
PaymentPooldeposit the node’s buyer leg tracks (admin_v1_pools). - Buyer
Pools Response - Snapshot of the node’s buyer-side
PaymentPoolstate (admin_v1_pools). - Drain
Request - Request body for
admin_v1_drain(issue #244). Required, as is its one field: a caller states which shutdown ordering it wants. - Drain
Response - Response body for
admin_v1_drain(issue #244).initiated: truereports that the trigger fired;wait_admin_honoredreports whether the server actually plans to keep admin alive throughrouter.shutdown(issue #604). The trigger is first-writer-wins, so await_admin: truerequest that loses the race to an earlier drain without it getsfalsehere. Thedecdn node drain --waitclient then refuses to enter the polling loop instead of treating the imminent ECONNREFUSED as drain completion. Atrueack covers admin-RPC races only: a SIGINT/SIGTERM that wins the runtime’s shutdown select still closes admin early. - Evict
Preview - Pre-evict snapshot returned inside
EvictResponse::preview. Mirrors the cache engine’sEvictionPreviewminus the engine-internalservedfield (folded intoEvictResponse::was_present). - Evict
Request - Request body for
admin_v1_evict(issue #279). - Evict
Response - Response body for
admin_v1_evict. - Health
Response - Response body for
admin_v1_health. Shared between the server (serializes) anddecdn node health(deserializes via the generated client). Intentionally minimal: this method exists so an operator script can answer “is this admin port the node I think it is, and has it been up since I started watching?” with one RPC call. - Lane
Snapshot - JSON view of one lane this node provides against a
PaymentPool, emitted byadmin_v1_lanes(issue #749). A lane is keyed by(pool_id, signer, provider)—decdn_incentive::LaneKey. Defined separately fromdecdn-incentive’s internalLaneStateso the replay-criticallast_*accessors, theU256money types, and any future internal fields can’t leak into the wire format: every field here is a plain owned wire value. Shared between the server (serializes) anddecdn node lanes(deserializes via the generated client). - Lanes
Response - Response body for
admin_v1_lanes(issue #749). Shared between the server (serializes),decdn node lanes(deserializes via the generated client), and the integration tests. - Record
Store Health - DHT provider-record store utilization for
admin_v1_status(issue #741). - Reload
Response - Response body for
admin_v1_reload(issue #373). Reports the post-reload values the SIGHUP arm logs to stdout, so operators using the RPC path get the same after-state confirmation without scrapingtracingoutput. Only the reloadable fields appear here: changes to non-reloadable sections are logged by the reload path itself (oneinfo!per changed-but-ignored field) and aren’t echoed in the RPC response. - Republish
Health - Republish-scheduler health for
admin_v1_status(issue #741). - Routing
Health - Routing-table health section of
admin_v1_status(issue #741). - Slash
Record Dto - One slash detected against this node’s operator (
SlashJudge.Slashed, #1032, G-NODE-05). Surfaced so an operator (or a keeper script) can notice a slash and filedecdn appeal slashwithin the 30-day window without watching the chain directly. - Slashes
Response - Snapshot of every slash the watcher has detected against this node’s operator (#1032). Empty list when none — a clean operator.
- Status
Response - Response body for
admin_v1_status(issue #741): a single-shot snapshot of this node’s DHT participation health, so an operator can diagnose cold-start / routing-table degradation without scraping Prometheus or reading logs.
Enums§
- Binding
Status - Whether the node’s local iroh key is the one bound to its operator address on-chain (#1034).
Constants§
- BUYER_
POOL_ STORE_ ERROR_ CODE - JSON-RPC error code:
admin_v1_poolscould not read the buyer pool store. Distinct fromPOOL_STORE_ERROR_CODE, which covers the seller-side lane store: the two are different files, and a fault in one says nothing about the other. - BUYER_
POOL_ UNAVAILABLE_ CODE - JSON-RPC error code:
admin_v1_poolswas called on an admin surface with no buyer pool store attached, so it can say nothing about what this node tracks. - CACHE_
ERROR_ CODE - JSON-RPC error code: the cache layer reported an error during evict (e.g. the underlying iroh-blobs store I/O failed when persisting the evicted-hash log).
- CONFIG_
PATH_ UNSET_ CODE - JSON-RPC error code: the node was started without a config file
path, so
admin_v1_reloadhas nothing to re-read. Distinct fromRELOAD_ERROR_CODEso an operator script can tell “this node can’t reload, ever, until it’s restarted with--config <path>” from “this node tried and failed”. - DHT_
POISONED_ CODE - JSON-RPC error code:
admin_v1_statusfound a DHT subsystem mutex (routing table or record store) poisoned — i.e. a thread panicked while holding it, so the DHT’s in-memory state may be inconsistent. This is a severe in-process fault, kept distinct from the benignDHT_UNAVAILABLE_CODE(“no DHT wired”) so an operator script can tell “this node never had a DHT” from “this node’s DHT just broke”. The server also logs the poisoning aterrorlevel. - DHT_
UNAVAILABLE_ CODE - JSON-RPC error code:
admin_v1_statuswas called on a node whose DHT subsystem is not wired (e.g. a future CLI-only or test invocation that brings up the admin surface without the DHT handler). A benign, expected configuration state — distinct from a generic failure so an operator gets “this node has no DHT to report on” rather than a confusing transport error, and distinct fromDHT_POISONED_CODEso it isn’t confused with an in-process fault. - INVALID_
PARAMS_ CODE - JSON-RPC error code: the request shape was wrong (bad hex, etc.).
Matches the standard JSON-RPC 2.0
Invalid paramscode. - POOL_
STORE_ ERROR_ CODE - JSON-RPC error code:
admin_v1_lanescould not read the pool state store (issue #749) — e.g. the redb load failed or a poisoned in-memory mutex. A read-side fault distinct from the cache/DHT codes so an operator script can tell “lane snapshot is unavailable right now” from a generic transport failure. The server also logs the underlying store error. - RELOAD_
ERROR_ CODE - JSON-RPC error code:
RuntimeReloadState::reloadreturned an error (file unreadable, malformed TOML, rejected resolution, mutex poison, log-level setter failed). Mirrors the SIGHUP arm’s “previous values retained” guarantee — by the time this surfaces, the running config is unchanged. - SLASH_
DETECTION_ UNAVAILABLE_ CODE - JSON-RPC error code:
admin_v1_slasheswas called on a node whose slash watcher is not wired (e.g. noslash_judge_address, or a test/CLI-only invocation). Benign config state, distinct from a generic failure so an operator gets “no slash detection on this node” rather than an opaque error.
Traits§
- Admin
RpcClient - Client implementation for the
AdminRpcRPC API. - Admin
RpcServer - Server trait implementation for the
AdminRpcRPC API.
Functions§
- parse_
hash_ arg - Decode a 64-character hex BLAKE3 hash into a
Hash.