Blog Index

iroh 0.21.0 - Fix, clean & polish

by dig

Welcome to a new release of iroh, the open-source distributed systems toolkit with tools for direct connections, moving data, and syncing state.

This time around a lot of work went into fixing subtle bugs, improving documentation, and polishing APIs. We hope this will help you enjoy iroh even more!

👾 Iroh vs Tokio

The tokio_util LocalPoolHandle does not properly handle Drop during shutdown. Its threads are just spawned as detached. So any Drop implementation that runs in a local pool thread will be stopped as soon as the process terminates.

This in turn can have some serious consequences if the Drop operation performs IO, like closing files and committing database transactions.

In order to fix this, we now have our own implementation of a LocalPool, which more gracefully handles shutdown. The only thing you should notice about this, is that things are more stable.

For details check out PR 2517

🐳 Docker Round 2

Our docker images are now published to docker hub, and tested in CI. Check them out at

For details checkout PR 2520

🎯 Realigning APIs

Based on the Rust API, we have updated both the CLI and the FFI APIs, to make them as similar as possible.

For example, listing all blobs, looks like this now

// Rust
let blobs = iroh.blobs().list().await?;
# Python
blobs = await iroh.blobs().list()
// Kotlin
val blobs = iroh.blobs().list()
// Swift
let blobs = try await iroh.blobs().list()
# CLI
iroh blobs list blobs

For details check out iroh-ffi PR 167 and PR 2522.

⚠️ Breaking Changes

Protocol Changes

  • iroh-relay
    • Clients will dial /relay instead of /derp, this means all 0.21 nodes are only compatible with relays >= 0.20

API Changes

  • iroh-cli
    • top level commands
      • author -> authors
      • blob -> blobs
      • doc -> docs
      • tag -> tags
      • sub commands
        • new -> create
    • added metrics_dump_path on the top level CLI parameters, which if set will make sure metrics are collected at regular intervals and written to the provided path in CSV format.
  • iroh
    • removed deprecated
      • client::MemIroh use iroh::client::Iroh instead
      • client::QuicIroh use iroh::client::Iroh instead
      • client::MemDocuse iroh::client::docs::Doc instead
      • client::QuicDoc use iroh::client::docs::Doc instead
  • iroh-net
    • renamed
      • field: magicsock::metrics::Metrics::update_endpoints -> update_direct_addrs.
    • relay server is now behind the iroh-relay feature flag
    • removed
      • endpoint::Builder::peers_path
    • added
      • endpoint::Builder::known_nodes
  • no automatic storage of known peers anymore in iroh-net
  • Public interfaces using tokio_util::task::LocalPoolHandle now use our own LocalPool/LocalPoolHandle.

But wait, there's more!

Many bugs were squashed, and smaller features were added. For all those details, check out the full changelog: https://github.com/n0-computer/iroh/releases/tag/v0.21.0.

If you want to know what is coming up, check out the 0.22.0 milestone, and if you have any wishes, let us know in our issues! If you need help using iroh or just want to chat, please join us on discord! And to keep up with all things iroh, check out our Twitter/X.

Iroh is a dial-any-device networking library that just works. Compose from an ecosystem of ready-made protocols to get the features you need, or go fully custom on a clean abstraction over dumb pipes. Iroh is open source, and already running in production on hundreds of thousands of devices.
To get started, take a look at our docs, dive directly into the code, or chat with us in our discord channel.