Expand description
SocialWebNet peer store.
Where an accepted connection’s peering material lands. Once a connection
offer has been mutually authenticated (see handshake.rs) and the peering
payload exchanged (see connection_identifier.rs), the resulting
SocialPeer — the counterpart’s DID plus the WireGuard public key and
overlay address needed to reach them on the SocialWebNet mesh — is recorded
here.
The store is deliberately thin and additive: pure list-manipulation helpers
(upsert, find) carry the logic and are unit-tested in isolation,
while the *_peer functions layer a small pretty-JSON persistence step on
top (a Vec<SocialPeer> at app_meta_dir()/social_peers.json).
Structs§
- Social
Peer - An accepted peer on the SocialWebNet mesh.
Functions§
- find
- Find the peer with the given
did, if present. - list_
peers - Load every stored peer. Returns
vec![]if the store file is absent or unreadable. - register_
peer - Register (insert-or-update) a peer, then persist the store.
- remove_
peer - Remove the peer with the given
didfrom the store, then persist. - resolve_
envelope_ keys - Resolve
didsto(did, envelope_pubkey_hex)pairs frompeers— the parties whose envelope key is known. Parties without a published key (or not peered) are simply omitted (the caller learns which keys are still missing by comparing lengths). Pure; unit-tested. - set_
peer_ active - Set the
activeflag on the peer with the givendid, then persist. - set_
peer_ endpoint - Set (or clear) the peer’s last-known transport endpoint (
host:port), then persist. Emptyendpointclears it. Errors if no such peer. - set_
peer_ envelope_ key - Set the peer’s envelope (X25519) public key (hex), then persist. Errors if no such peer.
- upsert
- Insert or update
peerinpeers, keyed bySocialPeer::did.