Skip to main content

Crate decdn_node

Crate decdn_node 

Source
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 PaymentPool buyer-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 PoolStateStore for 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::run parses the resolved config and hands off to crate::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 single Arc<AtomicU16> shared by all clones, seeded at startup and refreshed by the multiplexed log poller (see fee_shares_watcher.rs). (1 - f) numerator for the serve-economics margin.
fee_shares_watcher
FeeRouter.SharesUpdated watcher (ADR 041 / ADR 016 § Tunable Economics).
handlers
ALPN protocol handlers. Each handler impls iroh::protocol::ProtocolHandler and is registered on the iroh Router by crate::runtime.
load_shed
Load-shedding: content-agnostic overload protection for the paid serve path.
metrics
OpenMetrics/Prometheus metrics and a minimal /metrics HTTP 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 PaymentPool write ladders.
payment_settlement
On-chain PaymentPool seller-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 CancellationToken paired with its JoinHandle in 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).