Skip to content

n0-computer/iroh-services

Repository files navigation

iroh-services

Documentation Crates.io downloads Chat License: MIT License: Apache 2.0 CI

An iroh protocol to interact with iroh-services, using iroh itself.

Usage

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.

Network diagnostics

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.

License

Copyright 2026 N0, INC.

This project is licensed under either of

at your option.

Contribution

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.

About

iroh based client to interact with iroh-services

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages