-
Notifications
You must be signed in to change notification settings - Fork 325
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
feat(brave): delegated peers and content routing #739
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.
package.json
Outdated
@@ -66,6 +66,8 @@ | |||
"private": true, | |||
"preferGlobal": false, | |||
"resolutions": { | |||
"libp2p-delegated-content-routing": "0.3.1", | |||
"libp2p-delegated-peer-routing": "0.3.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures fixes from libp2p/js-libp2p-delegated-peer-routing#12 are in.
package.json
Outdated
@@ -66,6 +66,8 @@ | |||
"private": true, | |||
"preferGlobal": false, | |||
"resolutions": { | |||
"libp2p-delegated-content-routing": "0.3.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
This seems to work as expected, however remains experimental and opt-in for now. |
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.