iroh-topic-tracker-0.1.6 has been yanked.
Iroh Topic Tracker
An easy-to-use tracker for Iroh NodeId's in GossipSub topics. This library includes a hosted iroh-topic-tracker BOOTSTRAP_NODE to facilitate seamless tracking.
Getting Started
Automatic Discovery with iroh-gossip
This crate comes with an iroh-gossip integration, available via the feature flag:
feature = ["iroh-gossip-auto-discovery"]
use *;
let endpoint = builder.bind.await?;
// Setup Gossip with auto discovery
let gossip = new.await?;
// ::new() or ::builder().spawn_with_auto_discovery()
let gossip = builder
.spawn_with_auto_discovery
.await?;
let router = builder
.accept
.spawn.await?;
// Gossip Topic
let topic = from_passphrase;
// Subscribe and join with automatic peer discovery
let = gossip.subscribe_and_join.await?.split;
Try It Out
-
Get the last connected NodeId's for a given gossip topic:
-
Run your own dedicated topic tracker node:
Note: Adjust the
secret.rsSecretKey to ensure secure communication, and update theBOOTSTRAP_NODESpublic key intopic_tracker.rs(around line 33) to correctly point to the desired bootstrap node for discovery.
Build Server for Release
To build the server in release mode:
Library Usage
Refer to the examples below for quick guidance:
Basic Example
use TopicTracker;
let topic = from_passphrase;
let topic_tracker = new;
topic_tracker.get_topic_nodes.await?;
Expanded Example
use TopicTracker;
let topic = from_passphrase;
let endpoint = builder
.secret_key
.discovery_n0
.discovery_dht
.bind
.await?;
let topic_tracker = new;
let router = builder
.accept
.spawn
.await?;
topic_tracker.get_topic_nodes.await?;