Skip to content

06 — Transport

weave-swarm

Topic-based peer networking with priority events, real connection lifecycle, metrics, and an encrypted-stream backbone (weave-secret-stream). Built to pair with weave-proto-mp for typed multiplexed protocols.

A closer lookA direct line between peers.

Discover, connect, and exchange data through encrypted peer connections.

  1. 01Find a peer
  2. 02Establish the connection
  3. 03Exchange directly
01 — Concepts
01

Connect peers, join topics, move signed payloads.

02

Encrypted streams via weave-secret-stream.

03

Priority events, real connection lifecycle, metrics.

04

Pairs with weave-proto-mp for typed multiplexed protocols.

02 — Code

A handful of lines.

use weave_swarm::{Swarm, JoinOpts};

let mut swarm = Swarm::new(keypair).await?;
swarm.join("team/notes", JoinOpts::default()).await?;

while let Some(msg) = swarm.next().await {
    if msg.verify(&trusted_keys) { handle(msg.payload); }
}