Skip to main content
This guide will walk you through hooking up your first endpoint to Iroh Services.

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-services crate to your Cargo.toml:
cargo add iroh-services

Step 4: Connect Your Endpoint

Then, in your code, create a client and connect your endpoint to Iroh Services.
use iroh::Endpoint;
use iroh_services::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(())
}

Step 5: View Your Endpoint on the Dashboard

Go to your project’s Endpoints page. You should see your endpoint listed as online. Click on it to view details.

Step 6: View Metrics

Navigate to the Metrics tab to see real-time and historical metrics about your endpoint’s connectivity, direct data rate, and more. Metrics Dashboard

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
  • Net Diagnostics: Run remote diagnostics on your endpoints to understand connectivity issues