This repository was archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
feat(rpc, api): add network_events, and Gossipsub IPC methods #16
Copy link
Copy link
Open
Description
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:
- We need a public pub/sub interface:
- a
subscribemethod that returns a stream ofGossipsubEventson that topic - a
publishmethod that you can send messages on a topic - an
unsubscribemethod that you can use to unsubscribe to a topic - an
add_peermethod that explicitly adds the given peer to your pub/sub network
- We need to make adjustments to certain RPC methods to get this to work properly:
gossipsub_subscribeshould return a stream ofGossipsubEvents
- A way to configure the
getprocess to tell it how you want your data fetched. For now, I'm scoping this down toget_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_providersLoaderFromProvidersContextLoader
previous issue contents for posterity:
feat(rpc, api): add network_events, and Gossipsub IPC methods
- need a
network_eventsmethod that returns a stream ofNetworkEventsemitted by the p2p node - add p2p/rpc test~
- expose
gossipsub_subscribeto theiroh-api - expose
gossipsub_publishtoiroh-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.
Metadata
Metadata
Assignees
Labels
No labels