Skip to content

Implementing application specific communication on top of iron-docs #31

@bn-c

Description

@bn-c

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions