Skip to content

feat: add iroh net-diagnostics integration#139

Open
zachsmith1 wants to merge 4 commits intomainfrom
feat/iroh-net-diagnostics
Open

feat: add iroh net-diagnostics integration#139
zachsmith1 wants to merge 4 commits intomainfrom
feat/iroh-net-diagnostics

Conversation

@zachsmith1
Copy link
Copy Markdown
Contributor

Summary

Integrate iroh-services net-diagnostics into the desktop app for anonymous network diagnostic data collection (NAT type, UDP connectivity, relay latency, port mapping).

Closes datum-cloud/enhancements#676

Changes

Dependency upgrades

  • iroh 0.950.97
  • iroh-proxy-utils: git dep → crates.io 0.1.0
  • iroh-blobs 0.970.99
  • Added iroh-services 0.12 with net_diagnostics + client_host features
  • Migrated iroh 0.97 API changes (endpoint builder, address lookup, metrics)

Net diagnostics

  • New lib/src/diagnostics.rs module
  • ClientHost registered on ListenNode router so iroh-services can dial back
  • NetDiagnosticsCap::GetAny granted on startup (background task)
  • API key from IROH_SERVICES_API_KEY env var or BUILD_IROH_SERVICES_API_KEY at build time

User consent

  • One-time prompt dialog on first launch (matches project switcher styling)
  • Settings → Privacy section with toggle
  • Preference persisted in diagnostics_settings.yml
  • Default: enabled, opt-out model
  • Changes take effect on next app restart

Testing

  • Verified locally: client connects to iroh-services, capability granted
  • Logs: connecting to iroh-services for net diagnostics remote=ab2be4c4b2Granted NetDiagnosticsCap::GetAny to iroh-services

Notes

  • n0des-local workspace member excluded (needs separate iroh-n0des → iroh-services migration for tickets feature)
  • The .env files need IROH_SERVICES_API_KEY for local dev; CI builds should set BUILD_IROH_SERVICES_API_KEY

Integrate iroh-services net-diagnostics into the desktop app to
collect anonymous network diagnostic data (NAT type, UDP
connectivity, relay latency, port mapping).

Key changes:
- Upgrade iroh 0.95 → 0.97, iroh-proxy-utils to crates.io 0.1.0
- Add iroh-services 0.12 with net_diagnostics and client_host
- New diagnostics module with opt-in/out settings persisted to disk
- ClientHost registered on ListenNode router for iroh-services
  dial-back
- One-time prompt on first launch for user consent
- Settings → Privacy toggle for runtime opt-out
- API key loaded from IROH_SERVICES_API_KEY env var or
  BUILD_IROH_SERVICES_API_KEY at build time

Closes datum-cloud/enhancements#676
New dependencies (netwatch, portmapper, irpc, iroh-tickets) require
rustc 1.89.
Add conns_closed, conns_direct, paths_direct, and paths_relay
metrics that have equivalents in iroh 0.97's SocketMetrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iroh Gateway: standalone repo, telemetry, key management, and net-diagnostics integration

1 participant