Expand description
iroh-services is the client side of interacting with services. services 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_services::Client;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let endpoint = Endpoint::bind().await?;
// needs IROH_SERVICES_API_KEY set to an environment variable
// client will now push endpoint metrics to services.
let client = Client::builder(&endpoint)
.api_key_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::net_diagnostics::DiagnosticsReport;pub use self::net_diagnostics::checks::run_diagnostics;pub use self::api_key::ApiKey;pub use self::protocol::ALPN;pub use anyhow;
Modules§
- api_key
- caps
- net_
diagnostics - Network diagnostics for iroh-powered applications.
- protocol
Structs§
- Client
- Client is the main handle for interacting with services. It communicates with
services entirely through an iroh endpoint, and is configured through a builder.
Client requires either an Ssh Key or
ApiSecret - Client
Builder - ClientBuilder provides configures and builds a services client, typically
created with
Client::builder - Client
Host - Protocol handler for cloud-to-endpoint connections.
- Registry
- A registry for [
MetricsGroup].
Constants§
- API_
KEY_ ENV_ VAR_ NAME - CLIENT_
HOST_ ALPN - The ALPN for sending messages from the cloud node to the client.
- IROH_
SERVICES_ VERSION - Version of this crate.
Statics§
- IROH_
VERSION - Version of iroh this crate was built against.