Expand description
An [iroh::endpoint] preset tailored for use with iroh-services.
IrohServicesPreset starts from the n0 stock preset (production crypto
provider + n0 DNS-based address lookup) and overlays the bits that
iroh-services callers usually want to configure together: the relay map
the endpoint should use, an optional explicit [SecretKey], and an
optional ApiSecret that downstream code can retrieve to wire up a
crate::Client.
§Example
use iroh::Endpoint;
async fn run() -> anyhow::Result<()> {
let preset = iroh_services::preset()
.relays(["https://us-east1.project_username.iroh.link"])?
.api_secret_from_env()?
.build()?;
let endpoint = Endpoint::builder(preset).bind().await?;
Ok(())
}Structs§
- Iroh
Services Preset - An iroh endpoint preset configured for iroh-services. Build one with
presetorIrohServicesPreset::builder, then pass it to [iroh::Endpoint::builder]. - Preset
Builder - Fluent builder for
IrohServicesPreset. Construct one throughpresetorIrohServicesPreset::builder.
Functions§
- preset
- Start a new
IrohServicesPresetbuilder seeded with iroh-services defaults: the n0 production relay map and no explicit secret key (the endpoint will generate one at bind time).