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

Prerequisites

While iroh is currently only available in Rust, it can be deployed in many other languages and environments. Please refer to our Using Iroh Services with Other Languages guide for more information.

Step 1: Create a Project

After signing in, create a new project. This will be your sandbox for all endpoints. This is the control center where you can manage and monitor your infrastructure, including relays, metrics, and networks. Create Project

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. Create API Key See API Key

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