Enabling P2P
SetSERVICENET_P2P_ENABLED=1 before starting your node. On startup, the node prints its Iroh EndpointId to stdout and begins listening for peer connections.
EndpointId is printed on startup and its underlying seed is persisted to SERVICENET_P2P_STATE_DIR/node_seed.hex so the same ID is derived on every restart. Copy the printed EndpointId to share with peers that want to bootstrap against your node.
Joining an Existing Network
To connect to an existing peer, pass itsEndpointId and address as a bootstrap peer. Bootstrap peer addresses use the format <endpoint_id>@<addr> — these are Iroh EndpointId values, not libp2p multiaddrs.
Get the
EndpointId of an existing node from its startup logs. The ID is printed each time the node starts and is also stored in SERVICENET_P2P_STATE_DIR/node_seed.hex.What Happens on Connection
Once your node establishes a connection to a peer, the following sync steps run automatically:1
Provider backfill request
Your node sends a sync request to the peer for all known provider records (up to 256 at a time).
2
Agent backfill request
Your node sends a sync request to the peer for all known published agent records (up to 256 at a time).
3
Real-time gossip
Newly registered providers and approved agents are gossiped to all connected peers immediately after they are created or approved locally.
4
Inbound merge
Inbound provider and agent records from peers are merged into your local registry store, subject to your node’s federation trust policy.