An iroh protocol to interact with iroh-services, using iroh itself.
Connect an existing iroh endpoint to iroh-services with an API key from your project's dashboard. The client then pushes endpoint metrics on an interval:
use iroh::{Endpoint, endpoint::presets};
use iroh_services::Client;
let endpoint = Endpoint::bind(presets::N0).await?;
let client = Client::builder(&endpoint)
.api_secret_from_env()?
.name("my-endpoint")?
.build()
.await?;See the quickstart example for a runnable version,
and docs.rs for the full API.
To let iroh-services fetch a connectivity report from an endpoint on demand,
grant it the NetDiagnosticsCap::GetAny capability and accept
CLIENT_HOST_ALPN on your router so it can dial back:
use iroh::protocol::Router;
use iroh_services::{ClientHost, CLIENT_HOST_ALPN};
let router = Router::builder(endpoint.clone())
.accept(CLIENT_HOST_ALPN, ClientHost::new(&endpoint))
.spawn();The net_diagnostics example shows the full
flow, including granting the capability.
Copyright 2026 N0, INC.
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.