Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTorrent DHT integration #1152

Open
nazar-pc opened this issue Jun 29, 2017 · 13 comments
Open

WebTorrent DHT integration #1152

nazar-pc opened this issue Jun 29, 2017 · 13 comments
Labels

Comments

@nazar-pc
Copy link

@nazar-pc nazar-pc commented Jun 29, 2017

From discussion in #288 there is a potential implementation which I'd like to integrate with WebTorrent itself.
The question now is how to do this?

We can more or less just replace bittorrent-dht/client with browser-compatible implementation, but desktop clients should likely participate in 2 DHTs at the same time.

My first idea was to create some kind of DHT proxy that will send requests and combine responses from several underlying DHTs, but I'm not sure this is a really good approach, since there are some features that do not translate directly this way (like dht.address() call).

Maintainers, what are your thoughts and vision about this?

@RangerMauve

This comment has been minimized.

Copy link

@RangerMauve RangerMauve commented Aug 2, 2017

This is super cool! Is there anything in the way of getting this merged in? What are the next steps to getting this working everywhere?

@nazar-pc

This comment has been minimized.

Copy link
Author

@nazar-pc nazar-pc commented Aug 2, 2017

There are a few architectural decisions that need to be made by maintainers before this can be plugged in. You should be familiar with internals of related pieces in order to do something here.

Unfortunately my interest doesn't go much further that DHT itself (which is why I've made it) and I'm not familiar with WebTorrent architecture, so some help is definitely needed here.

@RangerMauve

This comment has been minimized.

Copy link

@RangerMauve RangerMauve commented Aug 2, 2017

Is the DHT you've made functional on its own? Could one start using it to build a network?

@nazar-pc

This comment has been minimized.

Copy link
Author

@nazar-pc nazar-pc commented Aug 2, 2017

Exactly, just like BitTorrent DHT is functional on its own too. I've actually built it for another project and used WebTorrent's BitTorrent DHT implementation as the base for my implementation, which is why it shares most of the features with BitTorrent DHT.

I should note however, that there are some things to be done there, like dropping unnecessary WebRTC connection before browser tab crashes (both Firefox and Chrome simply crash with large number of connections), but it is ready for experiments with a few tens of nodes and can be improved later without breaking its API. Follow the repo for future updates.

@Marak

This comment has been minimized.

Copy link

@Marak Marak commented Aug 3, 2017

@nazar-pc

It's very good to see someone working on this.

I believe that WebRTC based DHT is going to be a requirement for this p2p music sharing platform we've been working on ( https://github.com/lolashare/lolashare )

Looking forward to seeing if we can get more support for this feature. We may start testing out https://github.com/nazar-pc/webtorrent-dht soon.

Related: fermentation/ferment#45

@RangerMauve

This comment has been minimized.

Copy link

@RangerMauve RangerMauve commented Aug 4, 2017

There's already support for the Kademlia DHT in node.js or electron main process based clients.

@norzak

This comment has been minimized.

Copy link

@norzak norzak commented Apr 15, 2018

It may be possible to get the DHT implementation from the IPFS-JS when it is done for web browsers. I am not sure how easy the integration of those bits can be.

DHT: ipfs/js-ipfs#856
Relay: ipfs/js-ipfs#1063

@nazar-pc

This comment has been minimized.

Copy link
Author

@nazar-pc nazar-pc commented Apr 15, 2018

How similar is it to Mainline DHT? If it is significantly different, it might make integration much more difficult, and even with almost identical implementation there is not much interest.

BTW, WebTorrent-DHT works pretty good now, though some improvements are still expected in node-webrtc (all reported upstream and the progress over last few months is amazing). There is a Detox project (transport package in particular) I'm working on that uses it under the hood, which might explain some more advanced uses of it (Detox uses different hash function, has cryptographic signatures on signaling data, multiplexes different data over the same data channel, etc).

I'm no longer interested in making integration into WebTorrent client myself, but I'd be happy to help if some feel adventurous enough.

@norzak

This comment has been minimized.

Copy link

@norzak norzak commented Apr 15, 2018

Does WebTorrent-DHT work inside the browser?

@nazar-pc

This comment has been minimized.

Copy link
Author

@nazar-pc nazar-pc commented Apr 15, 2018

Yes, it does. In fact, this is the reason it was created.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Apr 16, 2018

@norzak No, in the browser we use websocket-based tracker to share WebRTC offers and answers.

@nazar-pc ;)

@norzak

This comment has been minimized.

Copy link

@norzak norzak commented Apr 17, 2018

@nazar-pc I think WebTorrent-DHT is a separate project(in fact, I think your project) and is not part of the WebTorrent. I was referring to the WebTorrent project itself. I may have chosen the wrong issue to comment.

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Jul 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 16, 2018
@stale stale bot closed this Jul 23, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 21, 2018
@feross feross reopened this Aug 9, 2019
@stale stale bot removed the stale label Aug 9, 2019
@webtorrent webtorrent unlocked this conversation Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.