truffle 0.3.2

P2P mesh networking for your devices, built on Tailscale
Documentation

truffle

P2P mesh networking for your devices, built on Tailscale.

This is the convenience crate that bundles truffle-core (the Rust library) and truffle-sidecar (auto-downloaded Go binary). For most users, this is the only dependency you need.

Quick start

[dependencies]
truffle = "0.3"
use truffle::{Node, sidecar_path};

# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let node = Node::builder()
    .name("my-app")
    .sidecar_path(sidecar_path())
    .build()
    .await?;

// Send a message to all peers
node.broadcast("chat", b"hello!").await;

// Subscribe to messages
let mut rx = node.subscribe("chat");
# Ok(())
# }

Advanced: BYO sidecar

If you want to manage the sidecar binary yourself, depend on truffle-core directly:

[dependencies]
truffle-core = "0.3"