Skip to content

Commit

Permalink
fix: callback-based delgates + DNS caching
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lidel committed Aug 12, 2019
1 parent 5ae9064 commit 8fcfa7a
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 48 deletions.
5 changes: 4 additions & 1 deletion add-on/src/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ function buildDefaultIpfsNodeConfig () {
config.config.Addresses.Gateway = '/ip4/127.0.0.1/tcp/9091'

// 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']
config.config.Addresses.Swarm = [
'/dns4/ws-star1.par.dwebops.pub/tcp/443/wss/p2p-websocket-star',
'/dns4/ws-star.discovery.libp2p.io/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 = [
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"private": true,
"preferGlobal": false,
"resolutions": {
"libp2p-delegated-content-routing": "0.3.1",
"libp2p-delegated-peer-routing": "0.3.1",
"libp2p-delegated-content-routing": "0.2.4",
"libp2p-delegated-peer-routing": "0.2.4",
"@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",
Expand Down Expand Up @@ -126,7 +126,7 @@
"get-port": "5.0.0",
"http-dns": "3.0.1",
"http-node": "1.2.0",
"ipfs": "https://github.com/ipfs/js-ipfs/tarball/2ae6b672c222555b1a068141f2acfe4b5f39b709/js-ipfs.tar.gz",
"ipfs": "https://github.com/ipfs/js-ipfs/tarball/6fa8f88310a4f7f451f0f6846e435134376703e6/js-ipfs.tar.gz",
"ipfs-css": "0.12.0",
"ipfs-http-client": "33.1.0",
"ipfs-http-response": "0.3.1",
Expand Down
Loading

0 comments on commit 8fcfa7a

Please sign in to comment.