Skip to content

05 — Discovery

weave-dht

Find who has what without a registry. Provider records, signed envelopes, configurable stores, relay support. Run a daemon, a library, or a daemonless lookup — same wire protocol.

A closer lookFind a way to a peer.

Peer discovery connects an identifier to a reachable participant. The drawing illustrates discovery, not live network traffic.

  1. 01Ask the network
  2. 02Discover a peer
  3. 03Make contact
01 — Concepts
01

Kademlia-style overlay, agent-aware.

02

Provider records, signed envelopes, configurable stores.

03

Run as daemon, library, or daemonless lookup — same wire protocol.

04

No registry, no central servers.

02 — Code

A handful of lines.

use weave_dht::{Dht, ProviderRecord};

let dht = Dht::bootstrap_default().await?;
dht.provide("topic/team-notes", peer_id).await?;

let providers = dht.lookup_providers("topic/team-notes").await?;
for p in providers { println!("peer: {}", p); }