Skip to main content
This guide will walk you through setting up your first Iroh Services-enabled application.

Prerequisites

Step 1: Create a Project

After signing in to Iroh Services, create a new project. This will be your control center for managing relays, metrics, and endpoints.

Step 2: Get Your API Key

Navigate to your project’s API Keys tab and create a new API key. You’ll need this to authenticate your endpoints.

Step 3: Add the Iroh Services Client

Add the iroh-n0des crate to your Cargo.toml:
[dependencies]
iroh = "0.35"
iroh-n0des = "0.1"

Step 4: Connect Your Endpoint

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

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Create an iroh endpoint
    let endpoint = Endpoint::builder().bind().await?;
    
    // Wait for the endpoint to be online
    endpoint.online().await;
    
    // Create the Iroh Services client with your API key
    let client = Client::new(&endpoint, "YOUR_API_KEY").await?;
    
    // Your endpoint is now reporting metrics to Iroh Services!
    
    Ok(())
}

Next Steps

  • Access Control: Learn how to manage API keys and permissions
  • Metrics: Understand the metrics collected by Iroh Services
  • Relays: Set up dedicated relay servers for your network