Merge agent-trust-wip (DHT Phases 0–4) into main
Integrates the DHT/peer-distribution line with the v1.7.98-alpha release fixes: - Phase 0 signed-catalog trust + release-root key (KAT-pinned) - Phase 1 BLAKE3 content addressing alongside SHA-256 - Phase 2 swarm-assist fetch seam (origin always wins) + iroh-blobs provider — heavy iroh deps stay behind the off-by-default `iroh-swarm` feature, so the default build/deploy is unaffected - Phase 3 signed Nostr seed-advertisement + discovery glue + paid swarm serving + "Networking Profits" Settings page - Phase 4 paid swarm streaming (cross-mint ecash, Shape-A paid ALPN, streaming.prepare-payment), also iroh-swarm-gated Conflicts resolved: seed.rs (kept release-root KAT tests), update.rs (comment-only, OTA logic identical), Cargo.lock (regenerated against the merged Cargo.toml). Default-feature build is clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,31 @@ impl Server {
|
||||
}
|
||||
}
|
||||
|
||||
// DHT swarm-assist (Phase 3): build the iroh provider once at startup so
|
||||
// release downloads can fetch from peers (origin always wins) and seed
|
||||
// what they hold. Inert unless built with `iroh-swarm` AND swarm_enabled.
|
||||
if let Err(e) = crate::swarm::init(
|
||||
&config.data_dir,
|
||||
&config.nostr_relays,
|
||||
config.nostr_tor_proxy.as_deref(),
|
||||
config.swarm_enabled,
|
||||
)
|
||||
.await
|
||||
{
|
||||
tracing::warn!("Swarm init (non-fatal, falling back to origin-only): {}", e);
|
||||
}
|
||||
|
||||
// Resume any cross-mint ecash swap interrupted by a previous crash
|
||||
// (paid the source mint but never claimed the target tokens). Best-effort.
|
||||
match crate::wallet::ecash::resume_pending_swaps(&config.data_dir).await {
|
||||
Ok(0) => {}
|
||||
Ok(reclaimed) => tracing::info!(
|
||||
"Resumed interrupted cross-mint swaps: reclaimed {} sats",
|
||||
reclaimed
|
||||
),
|
||||
Err(e) => tracing::debug!("resume_pending_swaps (non-fatal): {}", e),
|
||||
}
|
||||
|
||||
// Revoke any previously published Nostr data (runs before publish so revocation is not overwritten)
|
||||
let identity_dir = config.data_dir.join("identity");
|
||||
let tor_proxy_revoke = config.nostr_tor_proxy.clone();
|
||||
|
||||
Reference in New Issue
Block a user