Skip to main content

Crate iroh_n0des

Crate iroh_n0des 

Source
Expand description

iroh-n0des is the client side of interacting with n0des. n0des gives visibility into a running iroh network by pushing metrics aggregations from iroh endpoints into a central hub for monitoring.

Typical setup looks something like this:

use iroh::Endpoint;
use iroh_n0des::Client;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let endpoint = Endpoint::bind().await?;

    // needs N0DES_API_SECRET set to an environment variable
    // client will now push endpoint metrics to n0des.
    let client = Client::builder(&endpoint)
        .api_secret_from_env()?
        .build()
        .await?;

    // we can also ping the service just to confirm everything is working
    client.ping().await?;

    Ok(())
}

Re-exports§

pub use self::api_secret::ApiSecret;
pub use self::protocol::ALPN;
pub use anyhow;

Modules§

api_secret
caps
net_diagnostics
Network diagnostics for iroh-powered applications.
protocol

Structs§

Client
Client is the main handle for interacting with n0des. It communicates with n0des entirely through an iroh endpoint, and is configured through a builder. Client requires either an Ssh Key or ApiSecret
ClientBuilder
ClientBuilder provides configures and builds a n0des client, typically created with Client::builder
Registry
A registry for MetricsGroup.

Constants§

API_SECRET_ENV_VAR_NAME
IROH_N0DES_VERSION
Version of this crate.

Statics§

IROH_VERSION
Version of iroh this crate was built against.