GET /
Returns the currently registered bootstrap nodes as JSON.
P2PNetwork only has one server-side service today, but that service carries a lot of weight. It is the registry that makes bootstrap discovery practical.
GET /
Returns the currently registered bootstrap nodes as JSON.
POST /register
Adds or replaces a bootstrap node after verifying the shared password.
DELETE /register/{peer_id}
Removes a bootstrap node from the registry after password validation.
GET /health
Reports service health and the current number of registered nodes.
The registry service is intentionally narrow. It is not a general purpose node database and it is not trying to model the whole network.
Its job is to:
That narrow scope is useful. It makes the service easy to reason about, easy to replace, and easy to document.
Each registry entry stores:
peer_idaddressnameThose fields are enough for a joining node to turn the registry entry into a usable libp2p peer address. The registry does not need to know about peer discovery state, connection count, or application behavior.
When a bootstrap node registers itself, the service:
That replace-on-write behavior keeps stale duplicate bootstrap rows from building up when the same node restarts.
Bootstrap nodes are expected to remove themselves when they exit cleanly. That keeps the registry from advertising dead nodes for longer than necessary.
In practical terms:
This is normal for a lightweight registry. The network remains usable as long as at least one registered bootstrap node is alive and reachable.
The service is most valuable when it stays simple and stable.
The registry does not do peer discovery. It does not manage active sessions. It does not know whether a peer is connected or merely discoverable.
That boundary is deliberate:
Keeping those concerns separate makes the system easier to debug when one layer is healthy and another is not.