Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

feat(rpc, api): add network_events, and Gossipsub IPC methods #16

Open
ramfox opened this issue Jan 3, 2023 · 0 comments · May be fixed by #296
Open

feat(rpc, api): add network_events, and Gossipsub IPC methods #16

ramfox opened this issue Jan 3, 2023 · 0 comments · May be fixed by #296
Assignees

Comments

@ramfox
Copy link
Contributor

ramfox commented Jan 3, 2023

After chats with @dignifiedquire and @b5, and after considering API notes from @flub on the WIP PR concerning these refactors, we've decided to adjust this goal.

We are going to limit the exposure of some of our lower level APIs and have settled on these changes:

  1. We need a public pub/sub interface:
  • a subscribe method that returns a stream of GossipsubEvents on that topic
  • a publish method that you can send messages on a topic
  • an unsubscribe method that you can use to unsubscribe to a topic
  • an add_peer method that explicitly adds the given peer to your pub/sub network
  1. We need to make adjustments to certain RPC methods to get this to work properly:
  • gossipsub_subscribe should return a stream of GossipsubEvents
  1. A way to configure the get process to tell it how you want your data fetched. For now, I'm scoping this down to get_from_peers, that allows you to use a list of PeerIds as your providers, rather than fetching the providers off the DHT or getting the providers from something like cid.contact
  • get_from_providers
  • LoaderFromProviders ContextLoader

previous issue contents for posterity:

feat(rpc, api): add network_events, and Gossipsub IPC methods

  • need a network_events method that returns a stream of NetworkEvents emitted by the p2p node
  • add p2p/rpc test~
  • expose gossipsub_subscribe to the iroh-api
  • expose gossipsub_publish to iroh-api

Exposing/adding these methods to IPC so we can use iroh-embed inside iroh-share (iroh-share uses Gossipsub & expects to be able to inspect Gossipsub network events). Ignoring exposing the other Gossipsub RPC methods for now, and only implementing what is needed for the use case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant