Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,28 @@ description: "Connect two iroh endpoints in five minutes"

In five minutes you'll have two iroh endpoints connecting over the [iroh-ping](https://github.com/n0-computer/iroh-ping) protocol. Clone the repo, run the included quickstart example as a receiver in one terminal and a sender in another, and watch the round-trip time print.

### 1. Set your API key

If you want to see your metrics and verify connectivity, get an API key from your project's **Settings → API Keys** tab and export it as an environment variable. See [API Keys](/iroh-services/access) for the full walkthrough.

```bash
export IROH_SERVICES_API_SECRET=<your-api-key>
```

The example will pick up the key automatically. This step is optional, skip this step if you just want to see iroh-ping work.

### 2. Install Rust
### 1. Install Rust

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

### 3. Clone iroh-ping
### 2. Clone iroh-ping

```bash
git clone https://github.com/n0-computer/iroh-ping
cd iroh-ping
```

### 4. Run the receiver
### 3. Run the receiver

```bash
cargo run --example quickstart receiver
```

The receiver prints a ticket. Copy it.

### 5. Run the sender
### 4. Run the sender

In another terminal:

Expand All @@ -46,6 +36,16 @@ cargo run --example quickstart sender <TICKET>

Replace `<TICKET>` with the ticket from the receiver. The sender will print the round-trip time once the connection succeeds.

### 5. See your metrics (optional)

Now that ping is working, hook the example up to Iroh Services to watch connectivity metrics like direct data rate. Get an API key from your project's **Settings → API Keys** tab, export it, and rerun the example:

```bash
export IROH_SERVICES_API_SECRET=<your-api-key>
```

The example picks up the key automatically and starts reporting metrics. See [API Keys](/iroh-services/access) for the full walkthrough, or [View metrics](/iroh-services/quickstart) to read the dashboard.

## Next steps

Integrate iroh into your own app by following one of the tutorials below.
Expand Down
Loading