worker-7, assign it to the staging group, and add region and app-version attributes. Then we’ll update its metadata and find it on the Iroh Services dashboard.
Each endpoint can belong to one group and have a set of custom key-value attributes. Multiple endpoints can share a group.
This tutorial uses the
iroh-services Rust crate. The Python, Swift, and Kotlin bindings in iroh-ffi do not expose groups or attributes yet.Prerequisites
Start with an endpoint connected to Iroh Services, as described in the quickstart. Keep that application’sendpoint and replace its client construction with the code below.
Set IROH_SERVICES_API_SECRET to your API key in the environment where you run the application. Run the Rust snippets inside your application’s async function.
Set metadata at build time
First, set the name, group, and attributes on the client builder:worker-7, then open its detail page. After the client authenticates and sends its metadata, the page shows group staging and attributes region: us-west and app-version: 1.4.2.
The builder validates metadata locally. Names, groups, and attribute keys must contain 2 to 128 bytes of UTF-8. Attribute values may be empty, with a maximum of 128 bytes. An endpoint can have up to 128 attributes.
If the client cannot send metadata after authentication, it logs a warning. A successful
build() does not confirm that the server received the metadata. Use the setters below when you need to handle update errors explicitly.Update metadata later
Next, move the endpoint toproduction and update its app version. Add these calls after client construction:
production, region us-west, and app version 1.4.4.
set_attributes replaces the entire map. set_attribute merges one key into the client’s cached attributes and sends the resulting map. Both methods return errors if validation or the update fails.
To clear all attributes, pass an empty iterator to set_attributes:
Read the name and group
Read the name and group from the local client:Result<Option<String>, Error>. They read cached values from the builder or successful setter calls. They do not fetch server state or confirm that startup metadata reached the server.
There is no attributes() getter. Keep a copy in your application if you need to read the attribute map.
See it on the dashboard
Find the updated endpoint on your project’s Endpoints page:- Search for
worker-7. The search box also matches endpoint IDs, groups, and attributes. - Select
productionin the group filter in the sidebar. The endpoint remains in the results. - Open Columns above the table and enable Group and Attributes. Both columns are hidden by default.
- Open the endpoint’s detail page to inspect its full group and attribute values.
Full example
The endpoint metadata example demonstrates builder configuration and runtime updates. To run it, clone the repository and run the example from its workspace root:What’s next
Iroh Services quickstart
Connect your first endpoint and see it on the dashboard.
API keys
Understand what an API key authorizes and how to get one.
Diagnose a connectivity issue
Run remote diagnostic reports on your users’ endpoints to find out why connections fail.