Skip to main content

Crate iroh_content_discovery

Crate iroh_content_discovery 

Source
Expand description

A library for discovering content using a tracker.

This library contains the protocol for announcing and querying content, as well as a simple client implementation.

§Protocol

The protocol is defined in the protocol module.

§Client

Client functionality uses the client feature flag, which is enabled by default. Disable it if you only need the protocol and want to minimize dependencies.

The client implementation is using 0-rtt to minimize latency when announcing or querying content. For details about how to use 0-rtt in iroh, see this blog post.

Note that both announce and query will dial the tracker using just a node ID, so the endpoint must have node discovery enabled, and the tracker must announce itself to that node discovery mechanism.

Use announce to announce content to a tracker, and query to query a tracker for content.

The higher level functions announce_all and query_all can be used to announce to or or query from multiple trackers at once. They use futures_buffered for concurrency and are intended for the common case of working with multiple trackers.

The lower level functions announce_conn and query_conn can be used to announce to or query a tracker using an existing connection.

Re-exports§

pub use protocol::ALPN;

Modules§

protocol
The protocol for communicating with the tracker.

Enums§

Error

Functions§

announce
Announce to a tracker.
announce_all
Announce to multiple trackers in parallel.
announce_conn
Announce via an existing connection.
query
A single query to a tracker, using 0-rtt if possible.
query_all
Query multiple trackers in parallel and merge the results.
query_conn
Query via an existing connection.

Type Aliases§

Result