Keyboard shortcuts

Press ← or → to go to the previous or next page

Press S or / to search the docs

Press ? to show this help

Press Esc to hide this help

Internals

Contributing

This page points a contributor at the rest. Issues go in the tracker.

Where each crate is explained

CrateInternals page
iroh-liveThe node and its transport, for the facade, its errors, and calls
iroh-live-nodeThe node and its transport, Authorization and audiences, explained
moq-transport-irohThe node and its transport
iroh-live-roomsAuthorization and audiences, explained
moq-ext-accessAuthorization and audiences, explained
moq-ext-publisher, moq-ext-sourcesPublishing
moq-ext-playerSubscribing, Playout and A/V sync
moq-ext-adaptiveAdaptive rendition switching
moq-ext-jsonSend data without media
moq-ext-eguiInstrumentation and tests
iroh-live-relayPeer-to-peer and the media relay, iroh-live-relay reference
iroh-live-cliirl reference

Crates and features says what each crate holds.

No moq-ext-* crate depends on iroh, so each could move upstream into moq, the UI crate moq-ext-egui included. moq-ext-player and moq-ext-publisher do not depend on each other. A transport publishes a LocalBroadcast by reading it through moq_net::Consume. It builds a RemoteBroadcast from a route table with from_resolved. iroh-live-rooms has no media dependency. iroh-live depends on both sides and is the only crate that joins them.

Upstream covers one publisher with one rendition, and one subscriber that takes what it is given. The moq-ext-* crates add three things on top.

  • Publishing encodes one source into a ladder of renditions.
  • Subscribing starts a player that picks among those renditions as the downlink changes, and swaps decoders without a blank frame.
  • Each player’s playout clock keeps audio and video aligned across two separate decode paths.

The docs

The docs are an mdBook under docs/, with SUMMARY.md as the table of contents. Each page has one job:

  • getting-started/ takes a new reader from nothing to a running program, in four short pages.
  • guides/ does one common task, CLI first, then a Rust program, in under 250 lines. A page starts with an “In short” block.
  • concepts/ explains the model in three pages: how it works, the two kinds of media relay server, and access.
  • hosted/ describes the hosted preview.
  • reference/ lists flags, defaults and limits, and answers problems.
  • advanced/ holds the specialized tasks and the deeper concept pages.
  • internals/ explains how the crates work inside, for contributors.

A new page goes into the first section whose reader needs it. Keep Get started, Guides and Concepts short, and push depth down into Advanced.

Rules that keep the pages consistent:

  • A page describes what a reader can run today on main. A plan, such as Hosted media relays, says so in a callout at its top. Move a fact out of a plan into a guide once a reader can run it.
  • A fact lives in one page, and other pages link to it. The latency modes live in the irl reference, the adaptation defaults in Adaptive rendition switching, IROH_SECRET in the irl reference, the feature list in Crates and features, and the cross-compile steps in Publish from a Raspberry Pi.
  • The pages use the terms of the glossary. Never write a bare “relay”. An iroh relay is iroh’s, for hole punching and connection fallback. A media relay is the MoQ server that forwards and fans out media, such as iroh-live-relay. A relay link is a node’s session with a media relay. Code names such as --relay and iroh-live-relay stay as they are, and the prose around them says which kind they mean.
  • A path’s id placeholder is <endpoint id> in prose, and <peer> in reference pages that also show * and ** patterns.
  • Link text matches the title of the page it links to.
  • A page ends with “Where to go next”.
  • Paragraphs have six sentences or fewer, and sentences stay under 25 words where they can. Define a term at its first use.
  • In internals/, explain the behavior first. Put file and constant names in lists, not in the middle of the explanation.

Code in the docs

Every rust block in every page of docs/ and in every crate README compiles as a doctest of the iroh-live-doc-tests crate. Its build script finds the pages by itself, so a new page needs no registration. The crate’s dev-dependencies turn on the features that the pages use.

  • A rust block compiles and runs. Mark a complete program rust,no_run, since most programs open devices or wait for peers.
  • Hide setup lines, such as imports and a wrapping function, with a leading # . They compile, and the reader does not see them. A short excerpt with hidden setup is better than an uncompiled one.
  • Mark a fragment that cannot compile on its own rust,ignore. Use text for output, diagrams, and anything that is not Rust.

Run these checks before you commit docs:

cargo make docs-check
cargo make site-no-api

docs-check runs the site tool’s check, the docs tests of irl, the doc command test of iroh-live-relay and the doctests of iroh-live-doc-tests. Together they check:

  • every relative link and anchor in the repository’s Markdown,
  • that every moq rev in the docs matches the root Cargo.toml, and that every Cargo feature is in Crates and features,
  • that every Rust block compiles,
  • that every command in a shell block of docs/, site/ and the READMEs parses, and names packages, targets, features and cargo make tasks that exist,
  • that the irl reference names every flag.

site-no-api builds the site without the API docs and checks the links between its pages. site/README.md describes the site build.