Back to Spacedrive

Unified P2P Stack with Iroh

.tasks/core/NET-001-iroh-p2p-stack.md

0.4.3829 B
Original Source

Description

The networking layer will be built using the Iroh library. A single, unified NetworkingService manages one Iroh endpoint that handles all P2P communication, including device discovery, pairing, and file transfers.

Implementation Notes

  • The NetworkingService in src/services/networking/core/mod.rs encapsulates the Iroh Endpoint.
  • The NetworkingEventLoop processes all incoming connections and routes them to the appropriate protocol handler based on ALPNs.
  • Device identity is managed by src/services/networking/utils/identity.rs, which derives Iroh keys from the master device key.

Acceptance Criteria

  • The core has a single, unified NetworkingService.
  • The service can bind to a port and establish an Iroh Endpoint.
  • Device discovery on a local network is functional.