Bridge iroh control announcements into web stream discovery

This commit is contained in:
every.channel 2026-02-22 23:08:37 -08:00
parent 74842eb25e
commit 2778715304
No known key found for this signature in database
8 changed files with 528 additions and 26 deletions

View file

@ -293,10 +293,14 @@ impl CatalogGossip {
.map(|addr| addr.id)
.collect::<Vec<PublicKey>>();
let (sender, receiver) = gossip
.subscribe_and_join(catalog_topic(), peer_ids)
.await?
.split();
// Allow local-only startup with no explicit bootstrap peers. In that mode we still
// subscribe to the topic immediately and can add peers later.
let topic = if peer_ids.is_empty() {
gossip.subscribe(catalog_topic(), Vec::new()).await?
} else {
gossip.subscribe_and_join(catalog_topic(), peer_ids).await?
};
let (sender, receiver) = topic.split();
Ok(Self {
sender,
@ -365,10 +369,14 @@ impl ControlGossip {
.map(|addr| addr.id)
.collect::<Vec<PublicKey>>();
let (sender, receiver) = gossip
.subscribe_and_join(control_topic(), peer_ids)
.await?
.split();
// Allow local-only startup with no explicit bootstrap peers. In that mode we still
// subscribe to the topic immediately and can add peers later.
let topic = if peer_ids.is_empty() {
gossip.subscribe(control_topic(), Vec::new()).await?
} else {
gossip.subscribe_and_join(control_topic(), peer_ids).await?
};
let (sender, receiver) = topic.split();
Ok(Self {
sender,