Skip to content

Latest commit

 

History

History
196 lines (122 loc) · 2.54 KB

File metadata and controls

196 lines (122 loc) · 2.54 KB

🚀 LCD Playground — Quick Usage Guide

This guide explains:

  1. What options you get for each node type
  2. What each option means
  3. A small tutorial on how to connect nodes and discover services

🌐 Node Types & Their Options

When you run:

go run .

You choose:

1. Registrar
2. Advertiser
3. Discoverer

Below are the commands available for each node.


🏛️ Registrar Options

After choosing Registrar, you see:

peers

Shows peers known in the registrar’s routing table.

show

Lists advertisements stored for the chosen service.

quit

Exit the registrar node.


📢 Advertiser Options

After choosing Advertiser, you see:

advertise

Starts the ADVERTISE routine (registers itself with registrars).

connect

Connect this advertiser to a registrar using:

  • registrar multiaddr
  • registrar PeerID

quit

Exit the advertiser node.


🔍 Discoverer Options

After choosing Discoverer, you see:

lookup

Search for advertisers of the service and print results.

connect

Connect this discoverer to a registrar using:

  • registrar multiaddr
  • registrar PeerID

quit

Exit the discoverer node.


🧪 Small Tutorial — How Nodes Work Together

This is the minimum setup for discovery to work:

Registrar  ← (connect) →  Advertiser
Registrar  ← (connect) →  Discoverer

That’s it.

⭐ Without connecting to the registrar:

  • Advertiser cannot advertise
  • Discoverer cannot discover
  • System looks "empty"

📘 Tutorial: Run a Full Workflow

Step 1 — Start a Registrar

Terminal 1:

go run .
> 1
Port: 4000
Service: wakumix

Copy the registrar's PeerID printed on screen.


Step 2 — Start an Advertiser

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.


Step 3 — Start a Discoverer

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’re Done!

You now have:

  • A registrar storing advertisements
  • An advertiser announcing itself
  • A discoverer successfully discovering it