iroh-topic-tracker
A tracker for Iroh NodeId's in GossipSub topics.
This library integrates with iroh-gossip to automate peer discovery and includes a hosted BOOTSTRAP_NODE for seamless topic tracking without you needing to host anything. Your peers can discover each other even if both are behind NATs.
Overview
The crate provides a TopicTracker to manage and discover peers participating in shared GossipSub topics. It leverages Iroh's direct connectivity and Router to handle protocol routing.
Features
- Automatic peer discovery via
iroh-gossip(enabled withiroh-gossip-auto-discoveryfeature). - Dedicated bootstrap node support for topic tracking.
- Simple API to fetch active peers for a topic.
Getting Started
Prerequisites
Add the crate to your Cargo.toml with the required features:
[]
= { = "0.1", = ["iroh-gossip-auto-discovery"] }
Automatic Discovery
Enable iroh-gossip integration to automate peer discovery for topics:
use *;
async
Basic Setup with Iroh
use ;
use ;
async
Examples
Run a Topic Tracker Node
Start a dedicated tracker node:
Note: Update secret.rs with your SecretKey and configure BOOTSTRAP_NODES in topic_tracker.rs for secure communication.
Query Active Peers
Fetch the latest NodeIds for a topic:
Building
Optimized release build for the tracker server:
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless explicitly stated, any contribution intentionally submitted for inclusion in this project shall be dual-licensed as above, without any additional terms or conditions.