This guide explains:
- What options you get for each node type
- What each option means
- A small tutorial on how to connect nodes and discover services
When you run:
go run .
You choose:
1. Registrar
2. Advertiser
3. Discoverer
Below are the commands available for each node.
After choosing Registrar, you see:
Shows peers known in the registrar’s routing table.
Lists advertisements stored for the chosen service.
Exit the registrar node.
After choosing Advertiser, you see:
Starts the ADVERTISE routine (registers itself with registrars).
Connect this advertiser to a registrar using:
- registrar multiaddr
- registrar PeerID
Exit the advertiser node.
After choosing Discoverer, you see:
Search for advertisers of the service and print results.
Connect this discoverer to a registrar using:
- registrar multiaddr
- registrar PeerID
Exit the discoverer node.
This is the minimum setup for discovery to work:
Registrar ← (connect) → Advertiser
Registrar ← (connect) → Discoverer
That’s it.
- Advertiser cannot advertise
- Discoverer cannot discover
- System looks "empty"
Terminal 1:
go run .
> 1
Port: 4000
Service: wakumix
Copy the registrar's PeerID printed on screen.
Terminal 2:
go run .
> 2
Port: 4001
Service: wakumix
Now connect it to the registrar:
> connect
Enter multiaddr: /ip4/127.0.0.1/tcp/4000
Enter peerID: <RegistrarPeerID>
Start advertising:
> advertise
The registrar terminal will now show registration logs.
Terminal 3:
go run .
> 3
Port: 5000
Service: wakumix
Connect it to the registrar:
> connect
Enter multiaddr: /ip4/127.0.0.1/tcp/4000
Enter peerID: <RegistrarPeerID>
Lookup advertisers:
> lookup
Expected output:
Found advertisers:
• 12D3KooWCBZX3EJ9...
You now have:
- A registrar storing advertisements
- An advertiser announcing itself
- A discoverer successfully discovering it