Overview
iroh-docs uses iroh-gossip under the hood to implement the exchange of ToLiveActor events. Using NamespaceID as gossip's TopicId, See following snippet from iroh-docs
let sub = self
.gossip
.subscribe_with_opts(namespace.into(), JoinOptions::with_bootstrap(bootstrap));
let (sender, stream) = sub.split();
let abort_handle = self.active_tasks.spawn(
receive_loop(
namespace,
stream,
self.to_live_actor.clone(),
self.sync.clone(),
)
.map(move |res| (namespace, res)),
);
entry.insert(ActiveState {
sender,
abort_handle,
});
Problem:
- I would like to be able to send custom events to peers who are interested in the same
iroh-docs namespace.
- Looking at
iroh-gossip examples, I'm only seeing this TopicId::from_bytes(rand::random()) as a way to create a TopicId.
Question:
- Should I use the same channel (
NamespaceId) to send my custom events, may affect iroh-docs or add computational overhead to differentiate the events.
- Or is there a standard way for me to generate one or multiple
TopicId based on the NamespaceId to use as a separate channel for my application specific events?
Perhaps this boils down to whether I can (or should) get away with using only DocTicket to connect and sync not just my application's document, but my entire application as well?
Overview
iroh-docsusesiroh-gossipunder the hood to implement the exchange ofToLiveActorevents. UsingNamespaceIDas gossip'sTopicId, See following snippet fromiroh-docsProblem:
iroh-docsnamespace.iroh-gossipexamples, I'm only seeing thisTopicId::from_bytes(rand::random())as a way to create a TopicId.Question:
NamespaceId) to send my custom events, may affectiroh-docsor add computational overhead to differentiate the events.TopicIdbased on theNamespaceIdto use as a separate channel for my application specific events?Perhaps this boils down to whether I can (or should) get away with using only
DocTicketto connect and sync not just my application's document, but my entire application as well?