WeaveDocs
Filament

Transport

Transport layer of Filament — pluggable transports, connection lifecycle, and negotiation between peers.

Purpose

Experimental transport/runtime stack composed from filament core, crypto, link, packet, transport, types, interfaces, and utilities.

This page follows the real source shape for Filament and explains the workflow a developer is likely to use first.

Network contract

Document peer identity, topic selection, message framing, session lifetime, retry behavior, metrics, and what must be stable between releases. Any change here can strand peers, so examples should be exercised with at least two real processes.

Primary types to know

  • Announce — filament/filament-transport/src/announce.rs
  • AnnounceManager — filament/filament-transport/src/announce.rs
  • AnnounceQueue — filament/filament-transport/src/announce.rs
  • AutoInterface — filament/filament-interfaces/src/auto.rs
  • AutoInterfaceBuilder — filament/filament-interfaces/src/auto.rs
  • AutoInterfaceConfig — filament/filament-interfaces/src/auto.rs
  • BandwidthManager — filament/filament-transport/src/bandwidth.rs
  • Channel — filament/filament-link/src/channel.rs
  • ChannelMessage — filament/filament-link/src/channel.rs
  • Config — filament/filament-core/src/config.rs
  • DestinationHash — filament/filament-transport/src/types.rs
  • DestinationHash — filament/filament-types/src/primitives.rs

Example shape

use filament_transport::{
    Announce, AnnounceManager, ForwardingEngine, PathDiscovery, PathRequest, RoutingTable,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // The transport layer wires three subsystems: announces (presence), path
    // discovery (next-hop selection), and forwarding (frame relay).
    let mut announces = AnnounceManager::new();
    announces.enqueue(Announce::self_advertise("did:l1fe:agent:demo"))?;

    let routing = RoutingTable::new();
    let path = PathDiscovery::new(routing.clone());
    let response = path.request(PathRequest::for_destination([0u8; 32])).await?;

    let forwarder = ForwardingEngine::new(routing);
    println!(
        "announce_queue={} path_hops={} forwarder_ready=true",
        announces.len(),
        response.hops.len(),
    );
    let _ = forwarder;
    Ok(())
}