Skip to content

Conversation

lidel
Copy link
Member

@lidel lidel commented Jul 25, 2019

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.

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",
Copy link
Member Author

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",
Copy link
Member Author

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',
Copy link
Member Author

@lidel lidel Jul 25, 2019

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',
Copy link
Member Author

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.

@lidel lidel force-pushed the feat/delegated-routing-js-ipfs branch 2 times, most recently from 67f8a53 to 0064f18 Compare August 2, 2019 10:27
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
@lidel lidel force-pushed the feat/delegated-routing-js-ipfs branch from 0064f18 to 8fcfa7a Compare August 12, 2019 12:16
@lidel lidel changed the title [WIP] feat(brave): delegated peers and content routing feat(brave): delegated peers and content routing Aug 12, 2019
@lidel lidel marked this pull request as ready for review August 12, 2019 12:34
@lidel
Copy link
Member Author

lidel commented Aug 12, 2019

This seems to work as expected, however remains experimental and opt-in for now.
Merging to include in the next Beta.

@lidel lidel merged commit 254a3bd into master Aug 12, 2019
@lidel lidel deleted the feat/delegated-routing-js-ipfs branch August 12, 2019 12:56
@lidel lidel added the area/brave Issues related to Brave Browser label Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/brave Issues related to Brave Browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant