Iroh 0.16 - A Better Client!
by ramfoxiroh@0.16 — A Better Client!
Hello again folks, and welcome to the latest iroh release!
This time, we shifted focus to our APIs: streamlining exports, taking ownership of our networking API, and making the iroh node simpler to use, without sacrificing functionality. We’ve also added some useful tools to help with debugging!
📓 Improved API DX
We’ve been focusing on some quality-of-life improvements for devs using iroh, starting with making our crate structure and exports more logical and better named. We wanted to make it more obvious that the iroh::client module is the main entry point to using iroh, so the largest changes are concentrated there. Most types that you will use to interact with your iroh node will come from that module.
🚥 Cleaner networking integration
In order to squeeze out latency performance improvements, we recently had to fork quinn. Forking quinn allowed us to manipulate certain quinn APIs, so we could better integrate the pieces we use for hole-punching with lower-level QUIC systems, like the congestion controller. This was not a decision we made lightly; it certainly made switching to iroh easier when our QUIC connections API was simply the quinn API.
Thankfully, this switch is relatively simple as well. Rather than the accept method returning a quinn::Accept, it now returns a magic_endpoint::Accept; connect returns magic_endpoint::Connecting rather than quinn::Connecting. Other API changes are listed below.
Also, we wanted to make life easier on folks using iroh, so we now also export the QUIC API from iroh itself. This way, devs do not have to drag around two copies of QUIC implementations in their dependencies.
For more information, check out PR #2279 and iroh-quinn on crates.io.
🩺 iroh doctor
You can use the iroh doctor command to test out iroh connections.
The iroh doctor connect and iroh doctor accept commands allow you to test the connection between different devices, by transferring and echoing data. It will show you the speed at which the data is sending, how much of the data is being sent directly over ipv4 vs ipv6 vs over the relay. In this last update, we now report the connection type (over the relay, direct, or a mix between the two) in a rolling fashion, as the data transfers occur.
For more information, check out PR #2251
📉 iroh doctor plot
View prometheus-like metrics plotting from the terminal, that displays data from your running iroh node!
iroh doctor plot takes a list of metrics, as well flags for the reporting interval (e.g. report every 500ms) and the timeframe (e.g. show the lastest 60 seconds).
Metrics are defined in [metrics.rs](https://github.com/n0-computer/iroh/blob/main/iroh/src/metrics.rs) files throughout the codebase. To get metrics on send_data in the magicsock::Metrics struct, you would call:
$ iroh doctor plot magicsock_send_data
If you also wanted to add the download_bytes_total metrics in the iroh-blobs::Metrics struct you would call:
$ iroh doctor plot magic_sock_send_data, download_bytes_total

To learn more, check out PR #2206
⚠️ Breaking Changes
Protocol Changes
None!
API Changes
As mentioned earlier, this release contains a number of breaking changes to the iroh and iroh-netAPI. As always, changed APIs are documented here, and all pull requests that introduced a breaking change include documentation on the details of the change.
crate renames
iroh-bytesis nowiroh-blobsiroh-syncis nowiroh-docs
iroh-net
- renamed:
magicsock::ConnectionType->magic_endpoint::ConnectionTypemagicsock::ControlMsg->iroh_net::magic_endpoint::ControlMsgmagicsock::ConnectionInfo->iroh_net::magic_endpoint::ConnectionInfomagicsock::ConnectionTypeStream->iroh_net::magic_endpoint::ConnectionTypeStreammagicsock::DirectAddrInfo->iroh_net::magic_endpoint::DirectAddrInfomagicsock::LocalEndpointsStream->iroh_net::magic_endpoint::LocalEndpointsStream
- made private:
net::interfacesmagicsock
MagicEndpoint::acceptnow returnsmagic_endpoint::Acceptrather than Quinn'sAccepttype.magic_endpoint::Connectingreplacesquinn::Connecting. This is the type returned by.awaiting theAcceptfuture.magic_endpoint::accept_connandmagic_endpoint::get_alpnhave been removed. You now accept the connection by directly awaiting the futures returned. To retrieve the ALPN use the newConnecting::alpnmethod.
iroh
- renamed:
sync->docsbytes->blobsProviderService->RpcServiceiroh::clientmem::Iroh->MemIrohmem::Doc->MemDocquic::Iroh->QuicIrohquic::Doc->QuicDocblobs::BlobReader->blobs::Readerblobs::BlobAddProgress->blobs::AddProgressblobs::BlobAddOutcome->blobs::AddOutcomeblobs::BlobDownloadProgress->blobs::DownloadProgressblobs::BlobDownloadOutcome->blobs::DownloadOutcomeblobs::BlobExportProgress->blobs::ExportProgressdocs::DocImportFileProgress->docs::ImportFileProgressdocs::DocExportFileProgress->docs::ExportFileProgressdocs::DocImportFileOutcome->docs::ImportFileOutcomedocs::DocExportFileOutcome->docs::ExportFileOutcome
rpc_protocol::NodeStatusResponse->client::node::NodeStatusrpc_protocol::ListTagsResponse->client::tags::TagInforpc_protocol::BlobListResponse->client::blobs::BlobInforpc_protocol::BlobListIncompleteResponse->client::blobs::IncompleteBlobInforpc_protocol::BlobListCollectionResponse->client::blobs::CollectionInforpc_protocol::DownloadMode->client::blobs::DownloadMode
- moved:
DocTicketintoiroh-syncclient::Node::stats->client::Client::statsclient::Node::connections->client::Client::connectionsclient::Node::connection_info->client::Client::connection_infoclient::Node::status->client::Client::statusclient::Node::id->client::Client::node_idclient::Node::shutdown->client::Client::shutdown
- removed:
ticketmoduledialmodule
- made private:
sync_engineclient::rpc_protocolclient::quic::RPC_ALPNclient::quic::connect_raw
- added:
client::node::Client::idclient::blobs::Client::download_with_optsclient::blobs::Client::download_hash_seqclient::Client::my_relayclient::Client::my_addr
- removed
node::Node::ticket, useclient::blobs::Client::shareinstead
But wait there’s more!
Many bugs were squashed and smaller features were added. For all those details you can check out the full changelog: https://github.com/n0-computer/iroh/releases/tag/v0.16.0.
If you want to know what is coming up, check out the 0.17.0 milestone, and if you have any wishes let us know in the issues! If you need help using iroh or just want to chat, please join us on discord!
To get started, take a look at our docs, dive directly into the code, or chat with us in our discord channel.