-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ exports.optionDefaults = Object.freeze({ | |
ipfsApiUrl: buildIpfsApiUrl(), | ||
ipfsApiPollMs: 3000, | ||
ipfsProxy: true, // window.ipfs | ||
logNamespaces: 'jsipfs*,ipfs*,-*:ipns*,-ipfs:preload*,-ipfs-http-client:request*' | ||
logNamespaces: 'jsipfs*,ipfs*,libp2p-delegated*,-*:ipns*,-ipfs:preload*,-ipfs-http-client:request*' | ||
}) | ||
|
||
function buildCustomGatewayUrl () { | ||
|
@@ -62,15 +62,21 @@ function buildDefaultIpfsNodeConfig () { | |
// Until we have MulticastDNS+DNS, peer discovery is done over ws-star | ||
config.config.Addresses.Swarm = ['/dns4/ws-star1.par.dwebops.pub/tcp/443/wss/p2p-websocket-star'] | ||
// Until DHT and p2p transport are ready, delegate + preload | ||
// Note: we use .preload.ipfs.io and .delegate.ipfs.io as means of http sharding (12 instead of 6 concurrent requests) | ||
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', | ||
'/dns4/node0.delegate.ipfs.io/tcp/443/https' | ||
] | ||
// Delegated Content and Peer Routing: https://github.com/ipfs/js-ipfs/pull/2195 | ||
// TODO: delegated routing blocked by https://github.com/libp2p/js-libp2p-delegated-content-routing/issues/12 | ||
// config.config.Addresses.Delegates = delegates | ||
// TODO: are preloads needed? should Brave have own nodes? | ||
config.preload = { enabled: true, addresses: delegates } | ||
config.config.Addresses.Delegates = delegates | ||
// TODO: when we have p2p transport, are preloads still needed? should Brave have own nodes? | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. We will reuse |
||
'/dns4/node0.preload.ipfs.io/tcp/443/https' | ||
] | ||
} | ||
/* | ||
(Sidenote on why we need API for Web UI) | ||
Gateway can run without API port, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
"libp2p-delegated-peer-routing": "0.3.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
"@hapi/hapi": "https://github.com/lidel/hapi/tarball/ccbf84ba5edc9b24564fdd166e3ee6d81c4c02d8/hapi.tar.gz", | ||
"pino": "5.12.3", | ||
"hapi-pino": "https://github.com/pinojs/hapi-pino/tarball/3767ed6b67601831e176e084ed82ba4ed9f726e6/hapi-pino.tar.gz", | ||
|
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