You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
I've been working with this library and really like it, but I had some questions about the proper way to use it, and what each function does. What I want to do is allow each peer to connect to many random peers that are also searching for peers using a private signaling server, and then be able to arbitrarily and programmatically pass data between one another.
Right now, I'm using webrtc-star as my discovery and transport and I'm adding a private signaling server to my peerInfo.multiaddrs from the start. When I do this with two different peers, they trigger on.("peer:discovery") repeatedly. What I don't yet understand is whether I should call dialProtocol when I discover a peer and open a pull-stream on both sides so data can be arbitrarily passed, or if there's another, more elegant way. Because when I implement something like that, on("peer:connect") and on("peer:disconnect") are never triggered. Should my flow to connecting to peers look different? Also, what is the best way to store info on my peers so I can keep track of them and continue to communicate with them? I was storing the peerInfo in a simple object, but I run into a problem because the Connection object returned by handle doesn't have peerInfo for some reason -- it says peerInfo not set. I also found https://github.com/libp2p/js-peer-book as a potential better way to keep track of it, but it's very poorly documented.
Essentially, what I'm asking is what does the proper flow for using this library in conjunction with libp2p look like? Is there an example with more sustained communication than the chat example in js-libp2p?
The text was updated successfully, but these errors were encountered:
@owenauch Were you able to find a good answer to your question. I'm stuck in a similar situation looking for some guidance. Would appreciate your help.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've been working with this library and really like it, but I had some questions about the proper way to use it, and what each function does. What I want to do is allow each peer to connect to many random peers that are also searching for peers using a private signaling server, and then be able to arbitrarily and programmatically pass data between one another.
Right now, I'm using
webrtc-star
as my discovery and transport and I'm adding a private signaling server to mypeerInfo.multiaddrs
from the start. When I do this with two different peers, they triggeron.("peer:discovery")
repeatedly. What I don't yet understand is whether I should calldialProtocol
when I discover a peer and open a pull-stream on both sides so data can be arbitrarily passed, or if there's another, more elegant way. Because when I implement something like that,on("peer:connect")
andon("peer:disconnect")
are never triggered. Should my flow to connecting to peers look different? Also, what is the best way to store info on my peers so I can keep track of them and continue to communicate with them? I was storing thepeerInfo
in a simple object, but I run into a problem because theConnection
object returned byhandle
doesn't havepeerInfo
for some reason -- it sayspeerInfo not set
. I also found https://github.com/libp2p/js-peer-book as a potential better way to keep track of it, but it's very poorly documented.Essentially, what I'm asking is what does the proper flow for using this library in conjunction with libp2p look like? Is there an example with more sustained communication than the chat example in js-libp2p?
The text was updated successfully, but these errors were encountered: