Expand description
Loopback-only admin JSON-RPC server (appendix-local-admin-http.md).
Wire types (the AdminRpc trait, DTOs, error codes, parse_hash_arg) live
in decdn_common::admin so the user-facing decdn CLI can speak the
generated client without dragging in the daemon’s runtime
dependencies. This module keeps the server-side implementation:
AdminState, the AdminRpcImpl that backs the trait against the
live cache and runtime handles, and the bind/serve helpers the runtime
calls during start-up and graceful shutdown.
Re-exports§
pub use crate::handlers::client::LaneActivityClock;
Structs§
- Admin
RpcImpl - Concrete server implementation backed by the live
AdminState. - Admin
State - Shared state for admin RPC handlers.
- Buyer
Pool Handle - The buyer pool store handle
admin_v1_poolsreads, wrapped soAdminStatekeeps itsDebugderive. AnArcclone of the store the buy loop already writes through, so attaching it adds read access, not new ownership. - DhtStatus
Handles - Read-only DHT subsystem handles the
admin_v1_statushandler snapshots (issue #741). Each shared-state field is anArcclone of state the runtime already owns and shares with the DHT handler / refresh / republish tasks (plus theCopyrefresh_interval), so attaching this toAdminStateadds no new ownership — only read access. Bundled into one struct so theAdminStateconstructor stays a single optional argument rather than five positional ones. - Drain
Trigger - One-shot trigger that lets
admin_v1_drainwake the runtime’s main select loop and request graceful shutdown (issue #244). Modelled ontokio::sync::Notifyso the RPC handler can fire-and-return without blocking on the runtime’s shutdown latency. The runtime awaitswaitin its select loop; firing twice is a no-op (the secondnotify_onecoalesces, same asNotify). - Lane
Status Handles - Read-only lane handles the
admin_v1_laneshandler snapshots (issue #749). Each is anArcclone of state the runtime already owns and shares with thecdn/client/v1handler and the settlement service, so attaching this toAdminStateadds read access, not new ownership. Bundled into one struct so thewith_lanesbuilder stays a single argument. - Reload
Hook - Pair of values needed by
admin_v1_reload: the runtime’s reload state (the sameArcthe SIGHUP arm holds inruntime::run’s select loop) and the path to the config file the operator started with. Bundled soAdminStatecan carry “both or neither” as a singleOption, matching the runtime’s “no path → no reload” invariant. - Slash
Status Handles - Read-only slash-detection handle the
admin_v1_slasheshandler snapshots (#1032). The shared in-memory store is populated by the slash watcher; the admin surface only reads it. Bundled into a struct so thewith_slash_detectionbuilder stays a single argument (and to leave room for future fields without churning the signature).