Skip to main content

Crate iroh_gossip_rendezvous

Crate iroh_gossip_rendezvous 

Source
Expand description

§iroh-gossip-rendezvous

Passphrase-based peer rendezvous for iroh-gossip swarms, using the BitTorrent Mainline DHT as an out-of-band meeting place.

Two nodes that share a passphrase and an application salt can find each other and join the same gossip topic with no central bootstrap server and no prior knowledge of each other’s network address.

use iroh_gossip_rendezvous::Rendezvous;

let rendezvous = Rendezvous::join("my-passphrase", "my-app/v1").await?;
rendezvous.broadcast(bytes::Bytes::from_static(b"hello")).await?;

let mut receiver = rendezvous.subscribe();
while let Ok(event) = receiver.recv().await {
    // handle event (iroh_gossip::api::Event)
    drop(event);
}

The algorithm is a clock-free variant of a HyParView-healing protocol with K-sharded slots, logical aging, vouching, and a two-layer AEAD record format. See dht-partition-healing.md in the repository for the design specification and examples/simulator.rs for validation scaffolding.

§Lifetime

The returned Rendezvous is the keep-alive anchor for the DHT maintenance loops. Dropping it cancels the loops and the swarm will slowly drift off the DHT as entries age out. Any iroh_gossip::api::GossipSender or iroh_gossip::api::GossipReceiver extracted from the handle via Rendezvous::sender or Rendezvous::subscribe must be dropped before — or kept alongside — the Rendezvous.

Modules§

defaults
Algorithm defaults, one per §2 parameter of PROTOCOL.md.
simsim
Discrete-event simulator + DHT-backend surface.

Structs§

Builder
Advanced builder.
Rendezvous
Handle to a live rendezvous.
RendezvousState
Snapshot of rendezvous state at a point in time. Cheap to clone.

Enums§

DhtStatus
Health of the underlying DHT client.
Error
Errors returned by the public API.

Type Aliases§

Result
Result alias used throughout the crate.