macula_peer_discovery (macula v0.20.5)
View SourcePeer Discovery - DHT-based gateway discovery and P2P mesh formation.
This module implements automatic peer discovery to enable true P2P mesh: 1. Gateways register themselves in the bootstrap DHT 2. Peers periodically query DHT to discover other gateways 3. Peers establish direct QUIC connections to discovered gateways 4. Cross-peer relay works automatically via these mesh connections
Architecture: Peer1 Gateway - Peer2 Gateway - Peer3 Gateway | | | Local Clients Local Clients Local Clients
DHT Storage: Key pattern: "peer.gateway." + NodeID Value: map with node_id, host, port, realm fields
Summary
Functions
Discover other peer gateways from DHT
Register this gateway in the bootstrap DHT
Start the peer discovery process
Functions
Discover other peer gateways from DHT
-spec register_gateway() -> ok | {error, term()}.
Register this gateway in the bootstrap DHT
Start the peer discovery process