3 ms·
I've worked with `js-ipfs` and their `js-libp2p`, they use a signalling server (actually two types of them): - https://github.com/libp2p/js-libp2p-webrtc-star
by AquiGorka 8y ago
I've worked with `js-ipfs` and their `js-libp2p`, they use a signalling server (actually two types of them):
- https://github.com/libp2p/js-libp2p-webrtc-star https://github.com/libp2p/js-libp2p-webrtc-star
- https://github.com/libp2p/js-libp2p-websocket-star https://github.com/libp2p/js-libp2p-websocket-star
That would be going back to using a server for the handshake.
In regards to using a DHT, that's something I have not researched. I am not sure how long an offer is valid, were you thinking of being able to update them as needed whenever you want to establish a connection?
- kodablah 8y ago> In regards to using a DHT, that's something I have not researched. I am not sure how long an offer is valid, were you thinking of being able to update them as needed whenever you want to establish a connection? Yes. I have toyed with js-libp2p to obtain "providers" based on a key, but I believe the part of js-libp2p that allows you to participate in the DHT isn't quite done [0]. I imagine you'd make a CID that would be a simple hash of some shared string. Then you'd tell the network you are a "provider" with that CID, and when requested, you give the offer (AES'd w/ shared string or other shared secret?). The client can just connect to the same DHT and give the hash and get the (encrypted?) offer. Not sure if IPFS has a way for me to prevent other people from serving/replicating the CID I am serving instead of forcing it to be a hash of the content. A similar approach can happen on BT mainline w/ an infohash maybe. 0 - https://github.com/ipfs/js-ipfs/pull/856 https://github.com/ipfs/js-ipfs/pull/856
- AquiGorka 8y agoThank you for sharing, will keep an eye out for that thread. I did some research a year ago (https://aquigorka.net/post/how-to-find-peers-in-the-decentralized-web/ https://aquigorka.net/post/how-to-find-peers-in-the-decentra...) and going back to it I found this repo that uses the DHT to connect peers: https://github.com/mafintosh/peer-network https://github.com/mafintosh/peer-network The author is one of the main contributors to the Dat project so I'll do some catching up to see what they've come up with.
- kodablah 8y agoAlthough it uses Tor and is probably outdated, here is a PoC I wrote of bootstrapping a DHT network on the server side and using the client side to discover peers: https://github.com/cretz/tor-dht-poc https://github.com/cretz/tor-dht-poc
- smaddock 8y agoI created swarm-peer-server [1] as a way to connect to specific peers over a DHT using a public key known ahead of time. I use this in a networked app I've built to perform WebRTC signaling between peers [2]. The networking and crypto works using modules popular in the Dat Project community. The challenge is that multiple peers could announce under the same hash on the DHT. Thus I have code to perform a handshake to verify peers upon connecting. Another project worth mentioning is hyperswarm [3], also created by the Dat Project folks. It's planned to be their new method of connecting peers on a DHT in Beaker Browser. [1] https://www.npmjs.com/package/swarm-peer-server https://www.npmjs.com/package/swarm-peer-server [2] https://github.com/samuelmaddock/metastream/blob/master/app/browser/platform/swarm/index.ts#L62 https://github.com/samuelmaddock/metastream/blob/master/app/... [3] https://pfrazee.hashbase.io/blog/hyperswarm https://pfrazee.hashbase.io/blog/hyperswarm
- AquiGorka 8y agoThank you for sharing. Metastream is very nice! I thought I was following Paul Frazee's blog but I wasn't (updated my feeds now) so, thanks for the link to the `hyperswarm` post too.