Bridge iroh control announcements into web stream discovery
This commit is contained in:
parent
74842eb25e
commit
2778715304
8 changed files with 528 additions and 26 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue