-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Configure own signaling server and bootstrap node #1092
Comments
signalling server
and bootstrap node
Hi @AquiGorka, thanks for opening this issue, now I see that it is not clear how to configure custom multiaddrs. The fix for your issue is that you do not need that "SignalServer" on the config file, instead, you should add a multiaddr to your swarm array that looks like this:
So that IPFS knows where to find the Signalling Server. The explanation why it is this way is that we use Multiaddr, a self-describable data type that offers information about an address, in the example I shared with you, we can see that 1) it is a p2p-webrtc-star multiaddr and 2) the SignalServer is available at an IPv4 addr, on a TCP port that expect interactions over WebSockets. Let me know if you hit any other issue :) |
That kind'a worked! Now I can see all the nodes connected to the swarm. But I am not able to Could there be any reason why in setup like mine peers are not receiving updates via |
Now it is working, thanks for the help @diasdavid ! |
Awesome! you bet :) Would you like to contribute to the js-ipfs FAQ with how to configure a signalling endpoint? |
I will gladly do so. Expect another PR from me. |
I would to add that there currently is a bug with multiaddr in libp2p-webrtc-star when using domains for your signal server that listens on ports other than 80. As we have discussed @diasdavid on IRC, it is most likely util.js in libp2p-webrtc-star. I should probably create another issue, but I am pretty new when it comes to actual github usage. Setup
const ipfs = new IPFS({
repo: `stream-handler/${Math.random()}`,
EXPERIMENTAL: {
pubsub: true
},
config: {
Addresses: {
Swarm: [
'/dns4/example.com/tcp/9999/ws/p2p-webrtc-star'
]
}
}
}); ResultUsing the browser I then get this error in my console
Temporary fix for /dns4Assuming that the ports are accessable from the outside, use these following multiaddrs to make it work: Port other than 80If port 9999 is the desired port: Port 80No need to add tcp or port hackery Using /ip4omitting the v caught me off guard but it's a design choice 👍IP4 actually works last time I checked, but I am not 100% sure. I would have to test it again. Conclusion/dns4 is not handled properly, and the culprit is most likely the cleanUrlSIO function. More specifically: As it expects either ws or wss, but got tcp instead. The solution is probably adding another I haven't gotten around to test it or looked over the code to fully understand it, but I would like to let this be my first PR on github. Just point me to the guidelines :). As a sidenote: Chrome is a real PITA when it comes to wss and https with WebRTC as I am getting "mixed content" errors or key generation errors. I believe the provided signal server does not support wss, and I need it in order to use my own signalling server for my upcoming live demo. This also means I can't test this part. |
@Steverman thank you for the complete description of the problem, 5 🌟 We are now targetting this issue in both libp2p/js-libp2p-webrtc-star#129 and libp2p/js-libp2p-websocket-star#35 and as we talked about, the real issue is here https://github.com/libp2p/js-libp2p-websocket-star/blob/master/src/utils.js#L8-L35. Let's continue the convo on these two issues :) |
I'd been seeing some odd behavior (now reported here) so I wanted to setup a browser node that would only connect to my local
jsipfs daemon
and use my ownsignaling server
.My config looks like this:
jsipfs daemon
(using experimental pub/sub):signaling server
:I see the browser node has one connected swarm peer:
I am using
YJS
forCRDT
and I am not able to pubsub. The signaling server does not log any info - either the server does not log anything or it is not being used.Help would be much appreciated.
The text was updated successfully, but these errors were encountered: