From ec5ed9716c0d83632bba82d896d5ce585bc1adff Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Wed, 7 Sep 2022 10:58:02 -0700 Subject: [PATCH 1/2] chore: update to ipfsd-ctl@12.0.2 --- .aegir.cjs | 4 +- package-lock.json | 757 ++++++++++++++++++++++++++++++----- package.json | 2 +- test/cid-version-agnostic.js | 12 +- test/circuit/v1/browser.js | 8 +- test/exchange-files.js | 8 +- test/ipns-pubsub.js | 12 +- test/ipns.js | 2 +- test/pubsub.js | 24 +- test/utils/circuit.js | 6 +- 10 files changed, 688 insertions(+), 147 deletions(-) diff --git a/.aegir.cjs b/.aegir.cjs index 5efb1d12..9f9beef9 100644 --- a/.aegir.cjs +++ b/.aegir.cjs @@ -1,7 +1,6 @@ 'use strict' const path = require('path') -const createServer = require('ipfsd-ctl').createServer const signaller = require('libp2p-webrtc-star-signalling-server') /** @type {import('aegir').Options["build"]["config"]} */ @@ -38,6 +37,9 @@ module.exports = { } }, async before (options) { + + const { createServer } = await import ('ipfsd-ctl') + if (options.runner !== 'node') { const ipfsdServer = await createServer({ host: '127.0.0.1', diff --git a/package-lock.json b/package-lock.json index 39db6658..1a8a6a1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "hasha": "^5.2.2", "ipfs-unixfs": "^6.0.3", "ipfs-utils": "^9.0.1", - "ipfsd-ctl": "^10.0.3", + "ipfsd-ctl": "^12.0.2", "ipns": "^0.16.0", "is-ci": "^3.0.0", "is-os": "^1.0.1", @@ -1946,6 +1946,56 @@ "dev": true, "license": "MIT" }, + "node_modules/@libp2p/interface-peer-id": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-id/-/interface-peer-id-1.0.4.tgz", + "integrity": "sha512-VRnE0MqmS1kN43hyKCEdkhz0gciuDML7hpL3p8zDm0LnveNMLJsR+/VSUaugCi/muOzLaLk26WffKWbMYfnGfA==", + "dependencies": { + "multiformats": "^9.6.3" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/logger": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-2.0.1.tgz", + "integrity": "sha512-Mtj7ImjRYbaANuT53QRqc7ooBYpWieLo7KbqYYGas5O2AWQeOu/zyGBMM35WbWIo7sMuhCas9XBPJdFOR7A05w==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.2", + "debug": "^4.3.3", + "interface-datastore": "^7.0.0", + "multiformats": "^9.6.3" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/logger/node_modules/interface-datastore": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-7.0.0.tgz", + "integrity": "sha512-q9OveOhexQ3Fx8h4YbuR4mZtUHwvlOynKnIwTm6x8oBTWfIyAKtlYtrOYdlHfqQztbYpdzRFcapopNJBMx36NQ==", + "dependencies": { + "interface-store": "^3.0.0", + "nanoid": "^3.0.2", + "uint8arrays": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/logger/node_modules/interface-store": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-3.0.0.tgz", + "integrity": "sha512-IBJn3hE6hYutwdDcStR76mcwfV98vZc49LkEN9ANHHpsxcm6YbGMJxowO2G3FITU4U5ZH4KJPlHOT6Oe2vzTWA==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.8", "dev": true, @@ -1965,6 +2015,71 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/@multiformats/multiaddr": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-10.4.1.tgz", + "integrity": "sha512-8Xl/cv0pfoxr8hG+2GriPrxdsxJiRVTogrbQD/wE7SKpjOH+JIXmBpfwZkGzoEW1WknufYSdM0Ouj45E0yTpyA==", + "dependencies": { + "dns-over-http-resolver": "^2.1.0", + "err-code": "^3.0.1", + "is-ip": "^5.0.0", + "multiformats": "^9.4.5", + "uint8arrays": "^3.0.0", + "varint": "^6.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@multiformats/multiaddr/node_modules/dns-over-http-resolver": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-2.1.0.tgz", + "integrity": "sha512-eb8RGy6k54JdD7Rjw8g65y1MyA4z3m3IIYh7uazkgZuKIdFn8gYt8dydMm3op+2UshDdk9EexrXcDluKNY/CDg==", + "dependencies": { + "debug": "^4.3.1", + "native-fetch": "^4.0.2", + "receptacle": "^1.3.2" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@multiformats/multiaddr/node_modules/ip-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", + "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@multiformats/multiaddr/node_modules/is-ip": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-5.0.0.tgz", + "integrity": "sha512-uhmKwcdWJ1nTmBdoBxdHilfJs4qdLBIvVHKRels2+UCZmfcfefuQWziadaYLpN7t/bUrJOjJHv+R1di1q7Q1HQ==", + "dependencies": { + "ip-regex": "^5.0.0", + "super-regex": "^0.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@multiformats/multiaddr/node_modules/native-fetch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-4.0.2.tgz", + "integrity": "sha512-4QcVlKFtv2EYVS5MBgsGX5+NWKtbDbIECdUXDBGDMAZXq3Jkv9zf+y8iS7Ub8fEdga3GpYeazp9gauNqXHJOCg==", + "peerDependencies": { + "undici": "*" + } + }, "node_modules/@multiformats/murmur3": { "version": "1.0.8", "dev": true, @@ -4412,6 +4527,20 @@ "node": ">=0.8" } }, + "node_modules/clone-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-3.0.0.tgz", + "integrity": "sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==", + "dependencies": { + "is-regexp": "^3.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/clone-response": { "version": "1.0.2", "license": "MIT", @@ -5835,6 +5964,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/convert-source-map": { "version": "1.8.0", "license": "MIT", @@ -8405,6 +8545,17 @@ "version": "1.1.1", "license": "MIT" }, + "node_modules/function-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-0.1.1.tgz", + "integrity": "sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "license": "MIT" @@ -10443,23 +10594,165 @@ } }, "node_modules/ipfsd-ctl": { - "version": "10.0.5", - "license": "MIT", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/ipfsd-ctl/-/ipfsd-ctl-12.0.2.tgz", + "integrity": "sha512-XvrfDgf8zjwLT09r6ZVl1eI4PIT3eW84J3UirbG4VP6qj+wCbwcB0ZC7y1Criu42uA1RsjBurZ4JPpKdAL4mGg==", "dependencies": { - "@hapi/boom": "^9.1.0", + "@hapi/boom": "^10.0.0", "@hapi/hapi": "^20.0.0", - "debug": "^4.1.1", - "execa": "^5.0.0", + "@libp2p/interface-peer-id": "^1.0.4", + "@libp2p/logger": "^2.0.0", + "@multiformats/multiaddr": "^10.1.8", + "execa": "^6.1.0", "ipfs-utils": "^9.0.1", "joi": "^17.2.1", "merge-options": "^3.0.1", - "multiaddr": "^10.0.0", - "nanoid": "^3.1.3", - "p-wait-for": "^3.1.0", - "temp-write": "^4.0.0" + "nanoid": "^4.0.0", + "p-wait-for": "^4.1.0", + "temp-write": "^5.0.0", + "wherearewe": "^2.0.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/ipfsd-ctl/node_modules/@hapi/boom": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-10.0.0.tgz", + "integrity": "sha512-1YVs9tLHhypBqqinKQRqh7FUERIolarQApO37OWkzD+z6y6USi871Sv746zBPKcIOBuI6g6y4FrwX87mmJ90Gg==", + "dependencies": { + "@hapi/hoek": "10.x.x" + } + }, + "node_modules/ipfsd-ctl/node_modules/@hapi/hoek": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-10.0.1.tgz", + "integrity": "sha512-CvlW7jmOhWzuqOqiJQ3rQVLMcREh0eel4IBnxDx2FAcK8g7qoJRQK4L1CPBASoCY6y8e6zuCy3f2g+HWdkzcMw==" + }, + "node_modules/ipfsd-ctl/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/ipfsd-ctl/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/ipfsd-ctl/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ipfsd-ctl/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ipfsd-ctl/node_modules/nanoid": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz", + "integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^14 || ^16 || >=18" + } + }, + "node_modules/ipfsd-ctl/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ipfsd-ctl/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ipfsd-ctl/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ipfsd-ctl/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ipfsd-ctl/node_modules/wherearewe": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", + "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", + "dependencies": { + "is-electron": "^2.2.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" } }, "node_modules/ipjs": { @@ -10908,6 +11201,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-regexp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz", + "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-relative": { "version": "1.0.0", "license": "MIT", @@ -13487,8 +13791,9 @@ } }, "node_modules/multiformats": { - "version": "9.6.2", - "license": "(Apache-2.0 AND MIT)" + "version": "9.8.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.8.1.tgz", + "integrity": "sha512-Cu7NfUYtCV+WN7w59WsRRF138S+um4tTo11ScYsWbNgWyCEGOu8wID1e5eMJs91gFZ0I7afodkkdxCF8NGkqZQ==" }, "node_modules/multistream-select": { "version": "2.0.1", @@ -17599,26 +17904,28 @@ "license": "MIT" }, "node_modules/p-wait-for": { - "version": "3.2.0", - "license": "MIT", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", "dependencies": { - "p-timeout": "^3.0.0" + "p-timeout": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-wait-for/node_modules/p-timeout": { - "version": "3.2.0", - "license": "MIT", - "dependencies": { - "p-finally": "^1.0.0" - }, + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/package-hash": { @@ -18813,29 +19120,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/playwright-test/node_modules/p-timeout": { - "version": "5.0.2", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/playwright-test/node_modules/p-wait-for": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "p-timeout": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/playwright-test/node_modules/restore-cursor": { "version": "4.0.0", "license": "MIT", @@ -18873,13 +19157,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/playwright-test/node_modules/temp-dir": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/playwright-test/node_modules/tempy": { "version": "2.0.0", "license": "MIT", @@ -20799,8 +21076,9 @@ } }, "node_modules/signal-exit": { - "version": "3.0.6", - "license": "ISC" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/signale": { "version": "1.4.0", @@ -21548,6 +21826,22 @@ "node": ">= 8.0" } }, + "node_modules/super-regex": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-0.2.0.tgz", + "integrity": "sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==", + "dependencies": { + "clone-regexp": "^3.0.0", + "function-timeout": "^0.1.0", + "time-span": "^5.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { "version": "7.2.0", "license": "MIT", @@ -21788,24 +22082,36 @@ } }, "node_modules/temp-dir": { - "version": "1.0.0", - "license": "MIT", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/temp-write": { - "version": "4.0.0", - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-5.0.0.tgz", + "integrity": "sha512-cJhnzBW7DjNox7VcZDXeNlQSkIh3mX/h+M0n0Fh+zgT7YAHwI9c+OngKx4MCiQCVx9iXxV104xYlJgDBCCtawA==", "dependencies": { - "graceful-fs": "^4.1.15", + "graceful-fs": "^4.2.6", "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.3.2" + "temp-dir": "^2.0.0", + "uuid": "^8.3.2" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/temp-write/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" } }, "node_modules/tempy": { @@ -21825,13 +22131,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tempy/node_modules/temp-dir": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/tempy/node_modules/type-fest": { "version": "0.16.0", "license": "(MIT OR CC0-1.0)", @@ -21907,6 +22206,20 @@ "lodash.throttle": "^4.1.1" } }, + "node_modules/time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", + "dependencies": { + "convert-hrtime": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/timed-out": { "version": "4.0.1", "license": "MIT", @@ -22272,6 +22585,15 @@ "node": ">=0.10.0" } }, + "node_modules/undici": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", + "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", + "peer": true, + "engines": { + "node": ">=12.18" + } + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "license": "MIT", @@ -24235,6 +24557,42 @@ "version": "2.0.3", "dev": true }, + "@libp2p/interface-peer-id": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/interface-peer-id/-/interface-peer-id-1.0.4.tgz", + "integrity": "sha512-VRnE0MqmS1kN43hyKCEdkhz0gciuDML7hpL3p8zDm0LnveNMLJsR+/VSUaugCi/muOzLaLk26WffKWbMYfnGfA==", + "requires": { + "multiformats": "^9.6.3" + } + }, + "@libp2p/logger": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-2.0.1.tgz", + "integrity": "sha512-Mtj7ImjRYbaANuT53QRqc7ooBYpWieLo7KbqYYGas5O2AWQeOu/zyGBMM35WbWIo7sMuhCas9XBPJdFOR7A05w==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.2", + "debug": "^4.3.3", + "interface-datastore": "^7.0.0", + "multiformats": "^9.6.3" + }, + "dependencies": { + "interface-datastore": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-7.0.0.tgz", + "integrity": "sha512-q9OveOhexQ3Fx8h4YbuR4mZtUHwvlOynKnIwTm6x8oBTWfIyAKtlYtrOYdlHfqQztbYpdzRFcapopNJBMx36NQ==", + "requires": { + "interface-store": "^3.0.0", + "nanoid": "^3.0.2", + "uint8arrays": "^3.0.0" + } + }, + "interface-store": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-3.0.0.tgz", + "integrity": "sha512-IBJn3hE6hYutwdDcStR76mcwfV98vZc49LkEN9ANHHpsxcm6YbGMJxowO2G3FITU4U5ZH4KJPlHOT6Oe2vzTWA==" + } + } + }, "@mapbox/node-pre-gyp": { "version": "1.0.8", "dev": true, @@ -24250,6 +24608,51 @@ "tar": "^6.1.11" } }, + "@multiformats/multiaddr": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-10.4.1.tgz", + "integrity": "sha512-8Xl/cv0pfoxr8hG+2GriPrxdsxJiRVTogrbQD/wE7SKpjOH+JIXmBpfwZkGzoEW1WknufYSdM0Ouj45E0yTpyA==", + "requires": { + "dns-over-http-resolver": "^2.1.0", + "err-code": "^3.0.1", + "is-ip": "^5.0.0", + "multiformats": "^9.4.5", + "uint8arrays": "^3.0.0", + "varint": "^6.0.0" + }, + "dependencies": { + "dns-over-http-resolver": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-2.1.0.tgz", + "integrity": "sha512-eb8RGy6k54JdD7Rjw8g65y1MyA4z3m3IIYh7uazkgZuKIdFn8gYt8dydMm3op+2UshDdk9EexrXcDluKNY/CDg==", + "requires": { + "debug": "^4.3.1", + "native-fetch": "^4.0.2", + "receptacle": "^1.3.2" + } + }, + "ip-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", + "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==" + }, + "is-ip": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-5.0.0.tgz", + "integrity": "sha512-uhmKwcdWJ1nTmBdoBxdHilfJs4qdLBIvVHKRels2+UCZmfcfefuQWziadaYLpN7t/bUrJOjJHv+R1di1q7Q1HQ==", + "requires": { + "ip-regex": "^5.0.0", + "super-regex": "^0.2.0" + } + }, + "native-fetch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-4.0.2.tgz", + "integrity": "sha512-4QcVlKFtv2EYVS5MBgsGX5+NWKtbDbIECdUXDBGDMAZXq3Jkv9zf+y8iS7Ub8fEdga3GpYeazp9gauNqXHJOCg==", + "requires": {} + } + } + }, "@multiformats/murmur3": { "version": "1.0.8", "dev": true, @@ -25868,6 +26271,14 @@ "clone": { "version": "1.0.4" }, + "clone-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-3.0.0.tgz", + "integrity": "sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==", + "requires": { + "is-regexp": "^3.0.0" + } + }, "clone-response": { "version": "1.0.2", "requires": { @@ -26796,6 +27207,11 @@ } } }, + "convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==" + }, "convert-source-map": { "version": "1.8.0", "requires": { @@ -28460,6 +28876,11 @@ "function-bind": { "version": "1.1.1" }, + "function-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-0.1.1.tgz", + "integrity": "sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==" + }, "functional-red-black-tree": { "version": "1.0.1" }, @@ -29920,19 +30341,108 @@ } }, "ipfsd-ctl": { - "version": "10.0.5", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/ipfsd-ctl/-/ipfsd-ctl-12.0.2.tgz", + "integrity": "sha512-XvrfDgf8zjwLT09r6ZVl1eI4PIT3eW84J3UirbG4VP6qj+wCbwcB0ZC7y1Criu42uA1RsjBurZ4JPpKdAL4mGg==", "requires": { - "@hapi/boom": "^9.1.0", + "@hapi/boom": "^10.0.0", "@hapi/hapi": "^20.0.0", - "debug": "^4.1.1", - "execa": "^5.0.0", + "@libp2p/interface-peer-id": "^1.0.4", + "@libp2p/logger": "^2.0.0", + "@multiformats/multiaddr": "^10.1.8", + "execa": "^6.1.0", "ipfs-utils": "^9.0.1", "joi": "^17.2.1", "merge-options": "^3.0.1", - "multiaddr": "^10.0.0", - "nanoid": "^3.1.3", - "p-wait-for": "^3.1.0", - "temp-write": "^4.0.0" + "nanoid": "^4.0.0", + "p-wait-for": "^4.1.0", + "temp-write": "^5.0.0", + "wherearewe": "^2.0.1" + }, + "dependencies": { + "@hapi/boom": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-10.0.0.tgz", + "integrity": "sha512-1YVs9tLHhypBqqinKQRqh7FUERIolarQApO37OWkzD+z6y6USi871Sv746zBPKcIOBuI6g6y4FrwX87mmJ90Gg==", + "requires": { + "@hapi/hoek": "10.x.x" + } + }, + "@hapi/hoek": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-10.0.1.tgz", + "integrity": "sha512-CvlW7jmOhWzuqOqiJQ3rQVLMcREh0eel4IBnxDx2FAcK8g7qoJRQK4L1CPBASoCY6y8e6zuCy3f2g+HWdkzcMw==" + }, + "execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + } + }, + "human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==" + }, + "is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==" + }, + "mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==" + }, + "nanoid": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz", + "integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==" + }, + "npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "requires": { + "path-key": "^4.0.0" + } + }, + "onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "requires": { + "mimic-fn": "^4.0.0" + } + }, + "path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==" + }, + "strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==" + }, + "wherearewe": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", + "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", + "requires": { + "is-electron": "^2.2.0" + } + } } }, "ipjs": { @@ -30162,6 +30672,11 @@ "has-tostringtag": "^1.0.0" } }, + "is-regexp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz", + "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==" + }, "is-relative": { "version": "1.0.0", "requires": { @@ -31939,7 +32454,9 @@ } }, "multiformats": { - "version": "9.6.2" + "version": "9.8.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.8.1.tgz", + "integrity": "sha512-Cu7NfUYtCV+WN7w59WsRRF138S+um4tTo11ScYsWbNgWyCEGOu8wID1e5eMJs91gFZ0I7afodkkdxCF8NGkqZQ==" }, "multistream-select": { "version": "2.0.1", @@ -34699,16 +35216,17 @@ "dev": true }, "p-wait-for": { - "version": "3.2.0", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", "requires": { - "p-timeout": "^3.0.0" + "p-timeout": "^5.0.0" }, "dependencies": { "p-timeout": { - "version": "3.2.0", - "requires": { - "p-finally": "^1.0.0" - } + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==" } } }, @@ -35456,15 +35974,6 @@ "wcwidth": "^1.0.1" } }, - "p-timeout": { - "version": "5.0.2" - }, - "p-wait-for": { - "version": "4.1.0", - "requires": { - "p-timeout": "^5.0.0" - } - }, "restore-cursor": { "version": "4.0.0", "requires": { @@ -35481,9 +35990,6 @@ "ansi-regex": "^6.0.1" } }, - "temp-dir": { - "version": "2.0.0" - }, "tempy": { "version": "2.0.0", "requires": { @@ -36727,7 +37233,9 @@ } }, "signal-exit": { - "version": "3.0.6" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "signale": { "version": "1.4.0", @@ -37219,6 +37727,16 @@ "debug": "^4.1.0" } }, + "super-regex": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-0.2.0.tgz", + "integrity": "sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==", + "requires": { + "clone-regexp": "^3.0.0", + "function-timeout": "^0.1.0", + "time-span": "^5.1.0" + } + }, "supports-color": { "version": "7.2.0", "requires": { @@ -37384,16 +37902,26 @@ } }, "temp-dir": { - "version": "1.0.0" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==" }, "temp-write": { - "version": "4.0.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-5.0.0.tgz", + "integrity": "sha512-cJhnzBW7DjNox7VcZDXeNlQSkIh3mX/h+M0n0Fh+zgT7YAHwI9c+OngKx4MCiQCVx9iXxV104xYlJgDBCCtawA==", "requires": { - "graceful-fs": "^4.1.15", + "graceful-fs": "^4.2.6", "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.3.2" + "temp-dir": "^2.0.0", + "uuid": "^8.3.2" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } } }, "tempy": { @@ -37406,9 +37934,6 @@ "unique-string": "^2.0.0" }, "dependencies": { - "temp-dir": { - "version": "2.0.0" - }, "type-fest": { "version": "0.16.0" } @@ -37463,6 +37988,14 @@ "lodash.throttle": "^4.1.1" } }, + "time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", + "requires": { + "convert-hrtime": "^5.0.0" + } + }, "timed-out": { "version": "4.0.1" }, @@ -37677,6 +38210,12 @@ "unc-path-regex": { "version": "0.1.2" }, + "undici": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.10.0.tgz", + "integrity": "sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==", + "peer": true + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0" }, diff --git a/package.json b/package.json index 0d65e108..f2e0d987 100644 --- a/package.json +++ b/package.json @@ -171,7 +171,7 @@ "hasha": "^5.2.2", "ipfs-unixfs": "^6.0.3", "ipfs-utils": "^9.0.1", - "ipfsd-ctl": "^10.0.3", + "ipfsd-ctl": "^12.0.2", "ipns": "^0.16.0", "is-ci": "^3.0.0", "is-os": "^1.0.1", diff --git a/test/cid-version-agnostic.js b/test/cid-version-agnostic.js index e3fe1e73..9460b360 100644 --- a/test/cid-version-agnostic.js +++ b/test/cid-version-agnostic.js @@ -23,12 +23,12 @@ describe('CID version agnostic', function () { Object.assign(daemons, { js0, js1, go0, go1 }) await Promise.all([ - js0.api.swarm.connect(js1.api.peerId.addresses[0]), - js1.api.swarm.connect(js0.api.peerId.addresses[0]), - go0.api.swarm.connect(go1.api.peerId.addresses[0]), - go1.api.swarm.connect(go0.api.peerId.addresses[0]), - js0.api.swarm.connect(go0.api.peerId.addresses[0]), - go0.api.swarm.connect(js0.api.peerId.addresses[0]) + js0.api.swarm.connect(js1.peer.addresses[0]), + js1.api.swarm.connect(js0.peer.addresses[0]), + go0.api.swarm.connect(go1.peer.addresses[0]), + go1.api.swarm.connect(go0.peer.addresses[0]), + js0.api.swarm.connect(go0.peer.addresses[0]), + go0.api.swarm.connect(js0.peer.addresses[0]) ]) }) diff --git a/test/circuit/v1/browser.js b/test/circuit/v1/browser.js index 812577cf..4a81fd8e 100644 --- a/test/circuit/v1/browser.js +++ b/test/circuit/v1/browser.js @@ -106,7 +106,7 @@ export default { await relay.api.swarm.connect(await getWrtcStarAddr(nodeB.api)) // TODO: needed until https://github.com/ipfs/interop/issues/17 is resolved await delay(5000) - const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.api.peerId.id}` + const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.peer.id}` await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => true // go-ipfs does not know what p2p-webrtc-star is @@ -122,7 +122,7 @@ export default { await relay.api.swarm.connect(await getWrtcStarAddr(nodeB.api)) // TODO: needed until https://github.com/ipfs/interop/issues/17 is resolved await delay(3000) - const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.api.peerId.id}` + const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.peer.id}` await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => isWebWorker // no webrtc support in webworkers @@ -138,7 +138,7 @@ export default { await relay.api.swarm.connect(await getWsAddr(nodeB.api)) // TODO: needed until https://github.com/ipfs/interop/issues/17 is resolved await delay(5000) - const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.api.peerId.id}` + const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.peer.id}` await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => isWebWorker // no webrtc support in webworkers @@ -154,7 +154,7 @@ export default { await relay.api.swarm.connect(await getWsAddr(nodeB.api)) // TODO: needed until https://github.com/ipfs/interop/issues/17 is resolved await delay(3000) - const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.api.peerId.id}` + const nodeBCircuitAddr = `${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.peer.id}` await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => isWebWorker // no webrtc support in webworkers diff --git a/test/exchange-files.js b/test/exchange-files.js index b033d41a..32e88c3d 100644 --- a/test/exchange-files.js +++ b/test/exchange-files.js @@ -119,16 +119,16 @@ describe('exchange files', function () { before('connect', async function () { this.timeout(timeout); // eslint-disable-line - await daemon1.api.swarm.connect(daemon2.api.peerId.addresses[0]) - await daemon2.api.swarm.connect(daemon1.api.peerId.addresses[0]) + await daemon1.api.swarm.connect(daemon2.peer.addresses[0]) + await daemon2.api.swarm.connect(daemon1.peer.addresses[0]) const [peer1, peer2] = await Promise.all([ daemon1.api.swarm.peers(), daemon2.api.swarm.peers() ]) - expect(peer1.map((p) => p.peer.toString())).to.include(daemon2.api.peerId.id) - expect(peer2.map((p) => p.peer.toString())).to.include(daemon1.api.peerId.id) + expect(peer1.map((p) => p.peer.toString())).to.include(daemon2.peer.id) + expect(peer2.map((p) => p.peer.toString())).to.include(daemon1.peer.id) }) after(() => factory.clean()) diff --git a/test/ipns-pubsub.js b/test/ipns-pubsub.js index 52aaba5b..802765b7 100644 --- a/test/ipns-pubsub.js +++ b/test/ipns-pubsub.js @@ -60,8 +60,8 @@ describe('ipns-pubsub', function () { // TODO: go-ipfs needs two nodes in the DHT to be able to publish a record // Remove the second connect when js-ipfs runs a DHT server await Promise.all([ - nodes[0].api.swarm.connect(nodes[1].api.peerId.addresses[0]), - nodes[0].api.swarm.connect(nodes[2].api.peerId.addresses[0]) + nodes[0].api.swarm.connect(nodes[1].peer.addresses[0]), + nodes[0].api.swarm.connect(nodes[2].peer.addresses[0]) ]) }) @@ -78,15 +78,15 @@ describe('ipns-pubsub', function () { it('should publish the received record to a go node and a js subscriber should receive it', async function () { // TODO find out why JS doesn't resolve, might be just missing a DHT await Promise.all([ - subscribeToReceiveByPubsub(nodes[0], nodes[1], nodes[0].api.peerId.id, nodes[1].api.peerId.id), - expect(last(nodes[1].api.name.resolve(nodes[0].api.peerId.id, { stream: false }))).to.eventually.be.rejected.with(/was not found in the network/) + subscribeToReceiveByPubsub(nodes[0], nodes[1], nodes[0].peer.id, nodes[1].peer.id), + expect(last(nodes[1].api.name.resolve(nodes[0].peer.id, { stream: false }))).to.eventually.be.rejected.with(/was not found in the network/) ]) }) it('should publish the received record to a js node and a go subscriber should receive it', async function () { await Promise.all([ - subscribeToReceiveByPubsub(nodes[1], nodes[0], nodes[1].api.peerId.id, nodes[0].api.peerId.id), - last(nodes[0].api.name.resolve(nodes[1].api.peerId.id, { stream: false })) + subscribeToReceiveByPubsub(nodes[1], nodes[0], nodes[1].peer.id, nodes[0].peer.id), + last(nodes[0].api.name.resolve(nodes[1].peer.id, { stream: false })) ]) }) }) diff --git a/test/ipns.js b/test/ipns.js index 20c3fcac..085efbb4 100644 --- a/test/ipns.js +++ b/test/ipns.js @@ -37,7 +37,7 @@ const publishAndResolve = async (publisherDaemon, resolverDaemon) => { await publisherDaemon.init() await publisherDaemon.start() - const nodeId = publisherDaemon.api.peerId.id + const nodeId = publisherDaemon.peer.id await publisherDaemon.api.name.publish(ipfsRef, { resolve: false, diff --git a/test/pubsub.js b/test/pubsub.js index 87069d29..3102402f 100644 --- a/test/pubsub.js +++ b/test/pubsub.js @@ -58,16 +58,16 @@ describe('pubsub', function () { before('connect', async function () { this.timeout(timeout) - await daemon1.api.swarm.connect(daemon2.api.peerId.addresses[0]) - await daemon2.api.swarm.connect(daemon1.api.peerId.addresses[0]) + await daemon1.api.swarm.connect(daemon2.peer.addresses[0]) + await daemon2.api.swarm.connect(daemon1.peer.addresses[0]) const peers = await Promise.all([ daemon1.api.swarm.peers(), daemon2.api.swarm.peers() ]) - expect(peers[0].map((p) => p.peer.toString())).to.include(daemon2.api.peerId.id) - expect(peers[1].map((p) => p.peer.toString())).to.include(daemon1.api.peerId.id) + expect(peers[0].map((p) => p.peer.toString())).to.include(daemon2.peer.id) + expect(peers[1].map((p) => p.peer.toString())).to.include(daemon1.peer.id) }) after(() => factory.clean()) @@ -82,13 +82,13 @@ describe('pubsub', function () { expect(msg).to.have.property('seqno') expect(msg.seqno).to.be.an.instanceof(Uint8Array) expect(msg).to.have.property('topicIDs').and.to.include(topic) - expect(msg).to.have.property('from', daemon1.api.peerId.id) + expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) }) const publisher = async () => { - await waitForTopicPeer(topic, daemon2.api.peerId, daemon1) + await waitForTopicPeer(topic, daemon2.peer, daemon1) await daemon1.api.pubsub.publish(topic, data) } @@ -108,13 +108,13 @@ describe('pubsub', function () { expect(msg).to.have.property('seqno') expect(msg.seqno).to.be.an.instanceof(Uint8Array) expect(msg).to.have.property('topicIDs').and.to.include(topic) - expect(msg).to.have.property('from', daemon1.api.peerId.id) + expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) }) const publisher = async () => { - await waitForTopicPeer(topic, daemon2.api.peerId, daemon1) + await waitForTopicPeer(topic, daemon2.peer, daemon1) await daemon1.api.pubsub.publish(topic, data) } @@ -134,13 +134,13 @@ describe('pubsub', function () { expect(msg).to.have.property('seqno') expect(msg.seqno).to.be.an.instanceof(Uint8Array) expect(msg).to.have.property('topicIDs').and.to.include(topic) - expect(msg).to.have.property('from', daemon1.api.peerId.id) + expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) }) const publisher = async () => { - await waitForTopicPeer(topic, daemon2.api.peerId, daemon1) + await waitForTopicPeer(topic, daemon2.peer, daemon1) await daemon1.api.pubsub.publish(topic, data) } @@ -160,13 +160,13 @@ describe('pubsub', function () { expect(msg).to.have.property('seqno') expect(msg.seqno).to.be.an.instanceof(Uint8Array) expect(msg).to.have.property('topicIDs').and.to.include(topic) - expect(msg).to.have.property('from', daemon1.api.peerId.id) + expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) }) const publisher = async () => { - await waitForTopicPeer(topic, daemon2.api.peerId, daemon1) + await waitForTopicPeer(topic, daemon2.peer, daemon1) await daemon1.api.pubsub.publish(topic, data) } diff --git a/test/utils/circuit.js b/test/utils/circuit.js index 55422554..8ce2d6be 100644 --- a/test/utils/circuit.js +++ b/test/utils/circuit.js @@ -238,8 +238,8 @@ export async function getTcpAddr (api) { export async function connect (nodeA, nodeB, relay, timeout = 1000) { const relayWsAddr = await getWsAddr(relay.api) - const nodeAId = nodeA.api.peerId.id - const nodeBId = nodeB.api.peerId.id + const nodeAId = nodeA.peer.id + const nodeBId = nodeB.peer.id if (process.env.DEBUG) console.log(`connect A (${nodeAId}) to relay at`, relayWsAddr) await nodeA.api.swarm.connect(relayWsAddr) @@ -249,7 +249,7 @@ export async function connect (nodeA, nodeB, relay, timeout = 1000) { // TODO: needed until https://github.com/ipfs/interop/issues/17 is resolved await delay(timeout) - const nodeBCircuitAddr = `${relayWsAddr}/p2p-circuit/p2p/${nodeB.api.peerId.id}` + const nodeBCircuitAddr = `${relayWsAddr}/p2p-circuit/p2p/${nodeB.peer.id}` if (process.env.DEBUG) console.log('connect A to B over circuit', nodeBCircuitAddr) await nodeA.api.swarm.connect(nodeBCircuitAddr) From 6fb3077febed7d376f071fad42a072d60dc7a56e Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:30:06 -0700 Subject: [PATCH 2/2] fix: resolve ERR_PACKAGE_PATH_NOT_EXPORTED in electron --- .aegir.cjs | 2 +- .github/workflows/test.yml | 5 ++++- package-lock.json | 13 ++++++++++++- package.json | 3 ++- test/packages/ipfsd-ctl-wrapper/cjs-index.cjs | 1 + test/packages/ipfsd-ctl-wrapper/esm-index.mjs | 5 +++++ test/packages/ipfsd-ctl-wrapper/package.json | 10 ++++++++++ test/pubsub.js | 16 ++++++++-------- test/utils/daemon-factory.js | 3 ++- tsconfig.json | 2 +- 10 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 test/packages/ipfsd-ctl-wrapper/cjs-index.cjs create mode 100644 test/packages/ipfsd-ctl-wrapper/esm-index.mjs create mode 100644 test/packages/ipfsd-ctl-wrapper/package.json diff --git a/.aegir.cjs b/.aegir.cjs index 9f9beef9..c0952dca 100644 --- a/.aegir.cjs +++ b/.aegir.cjs @@ -3,7 +3,7 @@ const path = require('path') const signaller = require('libp2p-webrtc-star-signalling-server') -/** @type {import('aegir').Options["build"]["config"]} */ +/** @type {import('esbuild').BuildOptions} */ const esbuild = { inject: [path.join(__dirname, 'scripts/node-globals.js')], plugins: [ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c79cee17..09c29312 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -114,6 +114,9 @@ jobs: type: - electron-main - electron-renderer + moduleType: + - cjs + - esm fail-fast: false steps: - uses: actions/checkout@v2 @@ -130,7 +133,7 @@ jobs: ./scripts/custom-runtime.sh - uses: GabrielBB/xvfb-action@v1 with: - run: npm run test -- -t ${{ matrix.type }} --bail -f dist/cjs/node-test/*js + run: npm run test -- -t ${{ matrix.type }} --bail -f dist/${{matrix.moduleType}}/node-test/*js release: needs: [test-node, test-browser, test-electron] diff --git a/package-lock.json b/package-lock.json index 1a8a6a1d..86dcdc60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,8 @@ "devDependencies": { "go-ipfs": "^0.12.2", "ipfs": "^0.61.0", - "ipfs-http-client": "^55.0.0" + "ipfs-http-client": "^55.0.0", + "ipfsd-ctl-wrapper": "file:test/packages/ipfsd-ctl-wrapper" }, "engines": { "node": ">=16.0.0", @@ -10617,6 +10618,10 @@ "npm": ">=7.0.0" } }, + "node_modules/ipfsd-ctl-wrapper": { + "resolved": "test/packages/ipfsd-ctl-wrapper", + "link": true + }, "node_modules/ipfsd-ctl/node_modules/@hapi/boom": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-10.0.0.tgz", @@ -23341,6 +23346,9 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "test/packages/ipfsd-ctl-wrapper": { + "dev": true } }, "dependencies": { @@ -30445,6 +30453,9 @@ } } }, + "ipfsd-ctl-wrapper": { + "version": "file:test/packages/ipfsd-ctl-wrapper" + }, "ipjs": { "version": "5.2.0", "requires": { diff --git a/package.json b/package.json index f2e0d987..0db2c1b4 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,8 @@ "devDependencies": { "go-ipfs": "^0.12.2", "ipfs": "^0.61.0", - "ipfs-http-client": "^55.0.0" + "ipfs-http-client": "^55.0.0", + "ipfsd-ctl-wrapper": "file:test/packages/ipfsd-ctl-wrapper" }, "browser": { "go-ipfs": false, diff --git a/test/packages/ipfsd-ctl-wrapper/cjs-index.cjs b/test/packages/ipfsd-ctl-wrapper/cjs-index.cjs new file mode 100644 index 00000000..ee75f217 --- /dev/null +++ b/test/packages/ipfsd-ctl-wrapper/cjs-index.cjs @@ -0,0 +1 @@ +module.exports = async () => await import('ipfsd-ctl') diff --git a/test/packages/ipfsd-ctl-wrapper/esm-index.mjs b/test/packages/ipfsd-ctl-wrapper/esm-index.mjs new file mode 100644 index 00000000..5383354b --- /dev/null +++ b/test/packages/ipfsd-ctl-wrapper/esm-index.mjs @@ -0,0 +1,5 @@ +import * as ipfsdCtl from 'ipfsd-ctl' + +// export default ipfsdCtl +// export const createFactory = ipfsdCtl.createFactory +export default async () => ipfsdCtl diff --git a/test/packages/ipfsd-ctl-wrapper/package.json b/test/packages/ipfsd-ctl-wrapper/package.json new file mode 100644 index 00000000..786d2d73 --- /dev/null +++ b/test/packages/ipfsd-ctl-wrapper/package.json @@ -0,0 +1,10 @@ +{ + "name": "ipfsd-ctl-wrapper", + "exports": { + ".": { + "import": "./esm-index.mjs", + "require": "./cjs-index.cjs", + "default": "./cjs-index.cjs" + } + } +} diff --git a/test/pubsub.js b/test/pubsub.js index 3102402f..1ab5ea28 100644 --- a/test/pubsub.js +++ b/test/pubsub.js @@ -76,7 +76,7 @@ describe('pubsub', function () { const data = uint8ArrayFromString('hello world') const topic = 'pubsub-ascii' - const subscriber = () => new Promise((resolve) => { + const subscriber = () => /** @type {Promise} */(new Promise((resolve) => { daemon2.api.pubsub.subscribe(topic, (msg) => { expect(uint8ArrayEquals(data, msg.data)).to.be.true() expect(msg).to.have.property('seqno') @@ -85,7 +85,7 @@ describe('pubsub', function () { expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) - }) + })) const publisher = async () => { await waitForTopicPeer(topic, daemon2.peer, daemon1) @@ -102,7 +102,7 @@ describe('pubsub', function () { const data = uint8ArrayFromString('你好世界 zażółć gęślą jaźń') const topic = 'pubsub-non-ascii' - const subscriber = () => new Promise((resolve) => { + const subscriber = () => /** @type {Promise} */(new Promise((resolve) => { daemon2.api.pubsub.subscribe(topic, (msg) => { expect(uint8ArrayEquals(data, msg.data)).to.be.true() expect(msg).to.have.property('seqno') @@ -111,7 +111,7 @@ describe('pubsub', function () { expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) - }) + })) const publisher = async () => { await waitForTopicPeer(topic, daemon2.peer, daemon1) @@ -128,7 +128,7 @@ describe('pubsub', function () { const data = uint8ArrayFromString('a36161636179656162830103056164a16466666666f400010203040506070809', 'base16') const topic = 'pubsub-binary' - const subscriber = () => new Promise((resolve) => { + const subscriber = () => /** @type {Promise} */(new Promise((resolve) => { daemon2.api.pubsub.subscribe(topic, (msg) => { expect(uint8ArrayEquals(data, msg.data)).to.be.true() expect(msg).to.have.property('seqno') @@ -137,7 +137,7 @@ describe('pubsub', function () { expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) - }) + })) const publisher = async () => { await waitForTopicPeer(topic, daemon2.peer, daemon1) @@ -154,7 +154,7 @@ describe('pubsub', function () { const data = uint8ArrayFromString('你好世界\nzażółć\r\ngęślą\njaźń') const topic = 'pubsub\n你好世界\r\njaźń' - const subscriber = () => new Promise((resolve) => { + const subscriber = () => /** @type {Promise} */(new Promise((resolve) => { daemon2.api.pubsub.subscribe(topic, (msg) => { expect(uint8ArrayEquals(data, msg.data)).to.be.true() expect(msg).to.have.property('seqno') @@ -163,7 +163,7 @@ describe('pubsub', function () { expect(msg).to.have.property('from', daemon1.peer.id) resolve() }) - }) + })) const publisher = async () => { await waitForTopicPeer(topic, daemon2.peer, daemon1) diff --git a/test/utils/daemon-factory.js b/test/utils/daemon-factory.js index a622df9a..4cafa497 100644 --- a/test/utils/daemon-factory.js +++ b/test/utils/daemon-factory.js @@ -1,10 +1,11 @@ -import { createFactory } from 'ipfsd-ctl' import isNode from 'detect-node' +import ipfsdWrapper from 'ipfsd-ctl-wrapper' export async function daemonFactory () { let ipfsHttpModule let ipfsModule + const { createFactory } = await ipfsdWrapper() try { ipfsHttpModule = await import(process.env.IPFS_JS_HTTP_MODULE) diff --git a/tsconfig.json b/tsconfig.json index 591795fd..376ad55e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,4 +7,4 @@ "src", "test" ] -} \ No newline at end of file +}