feat(brave): delegated peers and content routing#739
Merged
Conversation
This enables delegated routers in embedded js-ipfs running in Brave. Coupled with preload, this gives us basic file sharing functionality back, until we have real p2p transport, native DHT etc.
lidel
commented
Jul 25, 2019
package.json
Outdated
| "preferGlobal": false, | ||
| "resolutions": { | ||
| "libp2p-delegated-content-routing": "0.3.1", | ||
| "libp2p-delegated-peer-routing": "0.3.1", |
Member
Author
There was a problem hiding this comment.
This ensures fixes from libp2p/js-libp2p-delegated-peer-routing#12 are in.
package.json
Outdated
| "private": true, | ||
| "preferGlobal": false, | ||
| "resolutions": { | ||
| "libp2p-delegated-content-routing": "0.3.1", |
Member
Author
There was a problem hiding this comment.
This ensures fixes from libp2p/js-libp2p-delegated-content-routing#16 are in.
| const delegates = [ | ||
| '/dns4/node0.preload.ipfs.io/tcp/443/https', | ||
| '/dns4/node1.preload.ipfs.io/tcp/443/https' | ||
| '/dns4/node1.delegate.ipfs.io/tcp/443/https', |
Member
Author
There was a problem hiding this comment.
We got dedicated hostnames for use in delegate contexts: ipfs/js-ipfs#2291
| config.preload = { | ||
| enabled: true, | ||
| addresses: [ | ||
| '/dns4/node1.preload.ipfs.io/tcp/443/https', |
Member
Author
There was a problem hiding this comment.
We will reuse delegates here, but for now I use .preload. hostnames to make it easier to see which requests are from libp2p's routing modules, and which ones are triggered by preload logic in js-ipfs.
67f8a53 to
0064f18
Compare
This switches to 0.2.x versions of delegate modules which work correctly with js-libp2p + wip [1] fix for js-ipfs that caches DNS records for 1 minute, greatly reducing the HTTP request overhead to remote APIs. [1]: ipfs/js-ipfs#2304
0064f18 to
8fcfa7a
Compare
Member
Author
|
This seems to work as expected, however remains experimental and opt-in for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This enables experimental delegated routers (ipfs/js-ipfs#2155)
in embedded js-ipfs running in Brave (#716).
Coupled with preload, this gives us basic file sharing functionality back.
This is not the end goal, just a stop gap until we have real p2p transport, native DHT etc.