Skip to content

Discovery and registry

Aster includes a peer-replicated service registry built on Iroh documents, blobs, and gossip. Participating peers synchronize registry state and use its endpoint leases to locate services.

A remote worker can send its address directly to an operator. When many workers advertise the same contract, a shared registry helps the operator select a provider without keeping an application-maintained address list.

Connection approach Prerequisites Useful when
Explicit endpoint address Expected endpoint identity and usable address hints or discovery You already know the provider, including a first-service tutorial
Shared registry Namespace access, reachable synchronization peers, published contract and endpoint records You need to find providers by contract or rollout channel

A contract ID identifies an interface; it does not tell a new peer which registry to join. Obtain the registry namespace’s read or write capability through your deployment’s trusted bootstrap path and synchronize with its participants. Writers also need an author identity and the registry’s write permission. Knowing a namespace ID alone does not grant write access.

The Python high-level server publishes contract metadata for connected clients; its consumer workflow can obtain the registry namespace during admission and synchronize from that producer. That metadata path and a deployment-wide provider registry have different setup requirements. The key layout below is reference material, rather than a complete registry deployment procedure.

Before using registry resolution, understand contract identity and the data capability model. Use dial a service for an explicit-address connection.

The registry is built on three independent iroh subsystems, each suited to a different data pattern:

iroh-docs – replicated key-value store for mutable state. iroh-docs provides a CRDT-based document model where multiple authors can write entries concurrently. Entries are signed by their author’s keypair, providing cryptographic proof of authorship. The registry uses iroh-docs for endpoint leases, service aliases, channel pointers, access control lists, and configuration.

iroh-blobs – content-addressed storage for immutable artifacts. iroh-blobs stores data identified by its BLAKE3 hash. Data is transferred directly between peers, verified on receipt, and cacheable while retained (the hash verifies content integrity). The registry uses iroh-blobs for contract bundles – the immutable collections containing canonical service definitions and type definitions.

iroh-gossip – pub-sub for real-time notifications. iroh-gossip provides topic-based message broadcast across the mesh. The registry uses gossip for real-time events: CONTRACT_PUBLISHED when a new contract is available, ENDPOINT_LEASE_UPSERTED and ENDPOINT_DOWN for endpoint changes, and other operational notifications.

The registry organizes data in an iroh-docs namespace with the following key structure:

{namespace}/
_aster/
acl/
writers -- list of authorized AuthorIds
readers -- list of authorized AuthorIds
admins -- list of authorized AuthorIds
policy -- registry policy configuration
config/
gossip_topic -- TopicId for change notifications
lease_duration_s -- default: 45 seconds
lease_refresh_interval_s -- default: 15 seconds
contracts/
{contract_id} -- ArtifactRef (pointer to blob collection)
services/
{service_name}/
versions/
v{version} -- contract_id
channels/
stable -- contract_id
canary -- contract_id
dev -- contract_id
tags/
{label} -- contract_id
meta -- service metadata
contracts/
{contract_id}/
endpoints/
{endpoint_id} -- EndpointLease
endpoints/
{endpoint_id}/
meta -- optional static endpoint metadata
tags -- optional discovery tags
compatibility/
{contract_id}/
{other_contract_id} -- compatibility report

All entries are signed by their author’s keypair. The AuthorId proves authorship; registry authorization must separately decide which authors may publish trusted records.

The registry separates mutable pointers (in iroh-docs) from immutable data (in iroh-blobs). The link between them is an ArtifactRef – a small JSON document stored as a docs entry that points to an iroh blob collection:

ArtifactRef {
contract_id -- BLAKE3 hash of the ServiceContract
collection_hash -- BLAKE3 root hash of the iroh blob collection
collection_format -- raw (single blob) or index (multi-file collection)
provider_endpoint_id -- optional: endpoint serving the blobs
relay_url -- optional: relay for the provider
ticket -- optional: bearer blob ticket for direct fetch
published_by -- AuthorId of the publisher
published_at_epoch_ms -- publication timestamp
}

This indirection keeps the docs layer lightweight. Docs entries are small pointers; the actual contract artifacts (which may include type definitions, documentation, and compatibility reports) are stored as content-addressed blobs and transferred efficiently via iroh-blobs.

An endpoint that serves a particular contract advertises itself by writing an EndpointLease to the registry. Leases are time-bounded: they have a duration (default 45 seconds) and must be refreshed periodically (default every 15 seconds).

Consumers filter stale leases when resolving a service. These records are discovery hints: replication delay, clock differences, and a failure after lookup can still leave a chosen endpoint unreachable. They do not replace a connection attempt or an application health check.

Registry endpoint leases are advertisements, distinct from fenced ownership leases. A registry entry cannot grant exclusive write authority.

Leases carry an endpoint identity, optional relay URL, and direct-address hints. Consumers use those to attempt a connection; missing or stale hints can still require configured discovery or cause the attempt to fail.

The flow from “I need this service” to “I have a connection” is:

  1. The consumer knows a contract_id (from its compiled client stub or configuration).
  2. The consumer looks up contracts/{contract_id} in the registry docs namespace.
  3. The entry contains an ArtifactRef with a collection_hash.
  4. The consumer fetches the blob collection (if not already cached) and verifies blake3(contract.bin) == contract_id.
  5. The consumer looks up services/{name}/contracts/{contract_id}/endpoints/ for active leases.
  6. The consumer selects an endpoint and dials it using the identity and address hints from the lease.

Registry lookup uses document sync, artifact fetch uses blob transfer, and calls use the RPC protocol. Peers still need a way to join the namespace and reach its participants.

Services can organize their contracts into channels and versions:

  • Versions (v1, v2, …) map to specific contract_id values. Publishers treat version pointers as append-only by convention; the document write itself does not enforce immutability.
  • Channels (stable, canary, dev) are mutable pointers to a contract_id. Promoting a canary to stable is a single docs write that updates the stable channel pointer.
  • Tags are arbitrary labels that point to a contract_id, useful for custom workflows.

Applications can use channel updates to select contracts during a rollout.

Changes to the registry are broadcast via iroh-gossip so that participants learn about new contracts, endpoint changes, and configuration updates in real time rather than polling.

Key gossip events:

  • CONTRACT_PUBLISHED – a new contract has been published; consumers can fetch it.
  • ENDPOINT_LEASE_UPSERTED / ENDPOINT_DOWN – an endpoint advertisement changed or a provider reported itself down.
  • CHANNEL_UPDATED – a channel pointer has changed (e.g., a new version promoted to stable).

Gossip notifications prompt participants to refresh document state. After a missed notification, a later successful document sync can provide the update.

Registry reads reflect the state available to the local replica. Connectivity loss or delayed synchronization can leave it stale. Lease expiry provides a freshness check, but an advertised lease does not guarantee that a provider is reachable or that a call will succeed.

See contract identity for artifact verification and dial a service for client connections.