Skip to main content

Module social_mesh

Module social_mesh 

Source
Expand description

Social ↔ mesh bridge — bring the SocialWebNet mesh up from identity + the peer store.

crate::node_identity::NodeIdentity holds this node’s WireGuard secret; the crate::social_peers store holds accepted peers (their WireGuard public key, overlay address, and last-known endpoint). This module joins the two: it reports which peers are dialable (have the material to form a tunnel) for the UI, and — on native targets — builds a live SocialWebNet with a tunnel per reachable peer.

The split mirrors the crate boundary: qualia-core-db owns the mesh mechanism (sockets, boringtun), this module owns the social binding (identity + peer records → mesh). The pure dialability report needs neither sockets nor boringtun, so it compiles everywhere (including the wasm32 studio build); build_node_mesh is native-only.

Structs§

PeerAddOutcome
The outcome of adding one peer to the mesh.
PeerMeshReport
A per-peer report of whether the mesh can bring up a tunnel to them, and what (if anything) is missing. Drives the Connect/Directory UI’s “can I reach this peer?” affordance.

Functions§

build_node_mesh
Build a live SocialWebNet for this node, adding a tunnel for every reachable peer (active + valid WireGuard key). Inactive or keyless peers are skipped with a note. Peers whose endpoint is known are pre-pointed; the rest wait to learn it by roaming.
dialability
Compute the dialability report for a set of peers — a pure, side-effect-free view usable on any target (native or wasm).
start_node_mesh_service
Build the mesh from identity + peers and start it running on its own thread.