every.channel: sanitized baseline

This commit is contained in:
every.channel 2026-02-15 16:17:27 -05:00
commit 897e556bea
No known key found for this signature in database
258 changed files with 74298 additions and 0 deletions

View file

@ -0,0 +1,21 @@
use iroh::{protocol::Router, Endpoint};
use iroh_gossip::{net::Gossip, ALPN};
use n0_error::{Result, StdResultExt};
#[tokio::main]
async fn main() -> Result<()> {
// create an iroh endpoint that includes the standard address lookup mechanisms
// we've built at number0
let endpoint = Endpoint::bind().await?;
// build gossip protocol
let gossip = Gossip::builder().spawn(endpoint.clone());
// setup router
let router = Router::builder(endpoint.clone())
.accept(ALPN, gossip.clone())
.spawn();
// do fun stuff with the gossip protocol
router.shutdown().await.std_context("shutdown router")?;
Ok(())
}