Skip to content

Commit 8fcfa7a

Browse files
committed
fix: callback-based delgates + DNS caching
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
1 parent 5ae9064 commit 8fcfa7a

File tree

3 files changed

+208
-48
lines changed

3 files changed

+208
-48
lines changed

add-on/src/lib/options.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ function buildDefaultIpfsNodeConfig () {
6060
config.config.Addresses.Gateway = '/ip4/127.0.0.1/tcp/9091'
6161

6262
// Until we have MulticastDNS+DNS, peer discovery is done over ws-star
63-
config.config.Addresses.Swarm = ['/dns4/ws-star1.par.dwebops.pub/tcp/443/wss/p2p-websocket-star']
63+
config.config.Addresses.Swarm = [
64+
'/dns4/ws-star1.par.dwebops.pub/tcp/443/wss/p2p-websocket-star',
65+
'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star'
66+
]
6467
// Until DHT and p2p transport are ready, delegate + preload
6568
// Note: we use .preload.ipfs.io and .delegate.ipfs.io as means of http sharding (12 instead of 6 concurrent requests)
6669
const delegates = [

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
"private": true,
6767
"preferGlobal": false,
6868
"resolutions": {
69-
"libp2p-delegated-content-routing": "0.3.1",
70-
"libp2p-delegated-peer-routing": "0.3.1",
69+
"libp2p-delegated-content-routing": "0.2.4",
70+
"libp2p-delegated-peer-routing": "0.2.4",
7171
"@hapi/hapi": "https://github.com/lidel/hapi/tarball/ccbf84ba5edc9b24564fdd166e3ee6d81c4c02d8/hapi.tar.gz",
7272
"pino": "5.12.3",
7373
"hapi-pino": "https://github.com/pinojs/hapi-pino/tarball/3767ed6b67601831e176e084ed82ba4ed9f726e6/hapi-pino.tar.gz",
@@ -126,7 +126,7 @@
126126
"get-port": "5.0.0",
127127
"http-dns": "3.0.1",
128128
"http-node": "1.2.0",
129-
"ipfs": "https://github.com/ipfs/js-ipfs/tarball/2ae6b672c222555b1a068141f2acfe4b5f39b709/js-ipfs.tar.gz",
129+
"ipfs": "https://github.com/ipfs/js-ipfs/tarball/6fa8f88310a4f7f451f0f6846e435134376703e6/js-ipfs.tar.gz",
130130
"ipfs-css": "0.12.0",
131131
"ipfs-http-client": "33.1.0",
132132
"ipfs-http-response": "0.3.1",

0 commit comments

Comments
 (0)