Transport
libp2p creates a host on /ip4/0.0.0.0/tcp/<port> and handles encrypted transport and peer connections.
P2PNetwork is not a multi-hop privacy network yet. The current implementation is a smaller, real system: libp2p hosts, a Kademlia DHT, a bootstrap node, a peer node, and a GUI built on top of the same node package.
The Go module is fgov/network.
The important packages are:
Network/cmd/bootstrap - interactive bootstrap entrypointNetwork/cmd/peer - interactive peer entrypointNetwork/cmd/gui - desktop UI entrypointNetwork/pkg/node - shared node logic, discovery, connection, and name syncTransport
libp2p creates a host on /ip4/0.0.0.0/tcp/<port> and handles encrypted transport and peer connections.
Discovery
The node uses a Kademlia DHT and routing discovery to find peers advertising on fgov-network.
Peer registry
Connected and discovered peers are tracked in maps so the CLI and GUI can render them.
Name sync
Connected peers exchange display names over a /fgov stream with JSON payloads.
Interfaces
The CLI prints status to the terminal; the GUI presents the same data in a Fyne window.
bs-nodes or from the bootstrap list passed to NewNode.The shared Node type stores two peer collections:
Peers - currently connected peersDiscoveredPeers - peers found by discovery, whether connected or notEach record stores:
peer.AddrInfoThis is what powers the peers and discovered commands and the GUI peer list.
The current code does not implement:
.fgov name registryThose ideas exist in the planning notes, but the shipped code is currently focused on direct peer discovery and naming.