Expand description
deCDN node daemon library — runtime, handlers, dispatch rate limiting,
metrics, and the admin RPC server (appendix-local-admin-http.md).
The binary target (src/main.rs) is a thin clap shell: parse --config
plus a single run subcommand and call into commands::run.
Wire types and shared CLI/config schema live in decdn_common; the
user-facing CLI binary (decdn) lives in crates/cli/.
Modules§
- admin
- Loopback-only admin JSON-RPC server (
appendix-local-admin-http.md). - binding_
check - Startup self-check: is the local iroh key the one bound on-chain? (#1034)
- blacklist_
watcher - Blacklist compliance watcher (ADR 011 § Content Takedown).
- buyer_
channel - On-chain
PaymentPoolbuyer-side service (#744). - buyer_
ledgers - The live voucher ledger for each buyer lane’s current pool.
- chain_
events - Shared chain-event log streaming for the on-chain watchers.
- chain_
freshness - Liveness of the node’s chain-derived compliance state (ADR 011 § Serving while chain-stale).
- channel_
store - Disk-backed
PoolStateStorefor the node runtime. - coarse_
clock - A coarse wall clock read off the per-lane hot path (issue #1792 item 4).
- commands
- Daemon entry point:
commands::runparses the resolved config and hands off tocrate::runtime::run. - content_
deny - The node’s live ORIGIN deny-set (ADR 011 §Local Denylist, §On Blacklist Event) — which operator addresses this node refuses to accept payment from.
- dht
- Kademlia content DHT (
cdn/dht/v1) — runtime-side modules. - dispatch
- Per-source connection rate limiting for all deCDN QUIC protocol handlers.
- fee_
shares - Live operator fee-share (basis points), read from
FeeRouter.getShares()[0]. A singleArc<AtomicU16>shared by all clones, seeded at startup and refreshed by the multiplexed log poller (seefee_shares_watcher.rs).(1 - f)numerator for the serve-economics margin. - fee_
shares_ watcher FeeRouter.SharesUpdatedwatcher (ADR 041 / ADR 016 § Tunable Economics).- handlers
- ALPN protocol handlers. Each handler impls
iroh::protocol::ProtocolHandlerand is registered on the irohRouterbycrate::runtime. - load_
shed - Load-shedding: content-agnostic overload protection for the paid serve path.
- metrics
- OpenMetrics/Prometheus metrics and a minimal
/metricsHTTP server. - node_
origin NodeOrigin— the node-to-node cache-miss pull-through origin (#831, ADR 001/022).- onchain_
tx - Shared driver for the node’s on-chain
PaymentPoolwrite ladders. - payment_
settlement - On-chain
PaymentPoolseller-settlement service (ADR 003). - pool_
view - Event-fed on-chain pool view for the serve path (ADR 003 §Sizing).
- rate_
limit - Shared three-layer token-bucket rate limiter for per-request inbound traffic on authenticated QUIC handlers.
- receipt_
log - Append-only download-receipt log for the node runtime (issue #248).
- runtime
- Node runtime: owns the iroh endpoint, metrics server, and protocol router.
- selection
- Provider selection algorithm (ADR 001 § Node Selection Algorithm + ADR 008 § Tie-Breaking).
- serve_
economics - Buy-side profitability gate for cache-miss relay legs (ADR 041).
- slash_
watcher - Daemon slash-detection watcher (#1032, G-NODE-05).
- stop_
handle - A background task’s
CancellationTokenpaired with itsJoinHandlein one type, so cancel-before-join is structural rather than call-site discipline. - systemd_
watchdog - Runtime-liveness heartbeat for the systemd service watchdog.
- warming_
allowance - Per-source serve-vindicated warming allowance (ADR 041).