diff --git a/package-lock.json b/package-lock.json index cccbcf1d..f7439938 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13073,9 +13073,9 @@ } }, "node_modules/ipfsd-ctl": { - "version": "12.0.2", + "version": "12.0.3", "resolved": "https://gitpkg.now.sh/SgtPooki/js-ipfsd-ctl?feature/add-js-kubo-rpc-client&scripts.postinstall=npm%20install%20--ignore-scripts%20%26%26%20npm%20run%20build", - "integrity": "sha512-S6XhB4Jm87+pE10TlU3tn2e2J82GyyzeV+Lf8rukr4abcJMK0yXlFMm6HipZcyqBud9bBfhLn/cRqAwVxEdoUQ==", + "integrity": "sha512-dwT1f/VXRdMkFJgoovQdj2Euqok8XMXdCCixIOlDuqQNB/U7vkiq88rqEDyrUgl4vXLdUXRIVsp/UXI5RYc44A==", "hasInstallScript": true, "license": "Apache-2.0 OR MIT", "dependencies": { @@ -13083,14 +13083,14 @@ "@hapi/hapi": "^20.0.0", "@libp2p/interface-peer-id": "^1.0.4", "@libp2p/logger": "^2.0.0", - "@multiformats/multiaddr": "^10.1.8", + "@multiformats/multiaddr": "^11.0.0", "execa": "^6.1.0", "ipfs-utils": "^9.0.1", "joi": "^17.2.1", "kubo-rpc-client": "^1.0.0", "merge-options": "^3.0.1", "nanoid": "^4.0.0", - "p-wait-for": "^4.1.0", + "p-wait-for": "^5.0.0", "temp-write": "^5.0.0", "wherearewe": "^2.0.1" }, @@ -13112,29 +13112,21 @@ "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-10.0.1.tgz", "integrity": "sha512-CvlW7jmOhWzuqOqiJQ3rQVLMcREh0eel4IBnxDx2FAcK8g7qoJRQK4L1CPBASoCY6y8e6zuCy3f2g+HWdkzcMw==" }, - "node_modules/ipfsd-ctl/node_modules/p-timeout": { - "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": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ipfsd-ctl/node_modules/p-wait-for": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", - "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "node_modules/ipfsd-ctl/node_modules/@multiformats/multiaddr": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-11.0.0.tgz", + "integrity": "sha512-NfOx/RF7TmGeCiQ5rmpvU7Ny7VKfmIG2jP2XSebTCv78vGuSRQ1YF+5UEKWft2Kjhtj1Xaq7dvgB9SeLp+BYSw==", "dependencies": { - "p-timeout": "^5.0.0" + "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": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=16.0.0", + "npm": ">=7.0.0" } }, "node_modules/ipns": { @@ -36915,20 +36907,20 @@ }, "ipfsd-ctl": { "version": "https://gitpkg.now.sh/SgtPooki/js-ipfsd-ctl?feature/add-js-kubo-rpc-client&scripts.postinstall=npm%20install%20--ignore-scripts%20%26%26%20npm%20run%20build", - "integrity": "sha512-S6XhB4Jm87+pE10TlU3tn2e2J82GyyzeV+Lf8rukr4abcJMK0yXlFMm6HipZcyqBud9bBfhLn/cRqAwVxEdoUQ==", + "integrity": "sha512-dwT1f/VXRdMkFJgoovQdj2Euqok8XMXdCCixIOlDuqQNB/U7vkiq88rqEDyrUgl4vXLdUXRIVsp/UXI5RYc44A==", "requires": { "@hapi/boom": "^10.0.0", "@hapi/hapi": "^20.0.0", "@libp2p/interface-peer-id": "^1.0.4", "@libp2p/logger": "^2.0.0", - "@multiformats/multiaddr": "^10.1.8", + "@multiformats/multiaddr": "^11.0.0", "execa": "^6.1.0", "ipfs-utils": "^9.0.1", "joi": "^17.2.1", "kubo-rpc-client": "^1.0.0", "merge-options": "^3.0.1", "nanoid": "^4.0.0", - "p-wait-for": "^4.1.0", + "p-wait-for": "^5.0.0", "temp-write": "^5.0.0", "wherearewe": "^2.0.1" }, @@ -36946,17 +36938,17 @@ "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-10.0.1.tgz", "integrity": "sha512-CvlW7jmOhWzuqOqiJQ3rQVLMcREh0eel4IBnxDx2FAcK8g7qoJRQK4L1CPBASoCY6y8e6zuCy3f2g+HWdkzcMw==" }, - "p-timeout": { - "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==" - }, - "p-wait-for": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", - "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "@multiformats/multiaddr": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-11.0.0.tgz", + "integrity": "sha512-NfOx/RF7TmGeCiQ5rmpvU7Ny7VKfmIG2jP2XSebTCv78vGuSRQ1YF+5UEKWft2Kjhtj1Xaq7dvgB9SeLp+BYSw==", "requires": { - "p-timeout": "^5.0.0" + "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" } } } diff --git a/test/cid-version-agnostic.js b/test/cid-version-agnostic.js index c1208685..a57faf3b 100644 --- a/test/cid-version-agnostic.js +++ b/test/cid-version-agnostic.js @@ -32,11 +32,17 @@ describe('CID version agnostic', function () { Object.assign(daemons, { js0, js1, go0, go1 }) await Promise.all([ + // @ts-ignore js0.api.swarm.connect(js1.peer.addresses[0]), + // @ts-ignore js1.api.swarm.connect(js0.peer.addresses[0]), + // @ts-ignore go0.api.swarm.connect(go1.peer.addresses[0]), + // @ts-ignore go1.api.swarm.connect(go0.peer.addresses[0]), + // @ts-ignore js0.api.swarm.connect(go0.peer.addresses[0]), + // @ts-ignore go0.api.swarm.connect(js0.peer.addresses[0]) ]) }) diff --git a/test/circuit/v1/browser.js b/test/circuit/v1/browser.js index 3f3cc42e..a0619f5d 100644 --- a/test/circuit/v1/browser.js +++ b/test/circuit/v1/browser.js @@ -140,11 +140,14 @@ export default { * @param {Controller} relay */ connect: async (nodeA, nodeB, relay) => { + // @ts-ignore await relay.api.swarm.connect(await getWsAddr(nodeA.api)) + // @ts-ignore 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 = new Multiaddr(`${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${nodeB.peer.id.toString()}`) + // @ts-ignore await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => true // go-ipfs does not know what p2p-webrtc-star is @@ -164,11 +167,14 @@ export default { * @param {Controller} relay */ connect: async (nodeA, nodeB, relay) => { + // @ts-ignore await relay.api.swarm.connect(await getWsAddr(nodeA.api)) + // @ts-ignore 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 = new Multiaddr(`${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${(await nodeB.api.id()).id.toString()}`) + // @ts-ignore await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => isWebWorker // no webrtc support in webworkers @@ -188,11 +194,14 @@ export default { * @param {Controller} relay */ connect: async (nodeA, nodeB, relay) => { + // @ts-ignore await relay.api.swarm.connect(await getWrtcStarAddr(nodeA.api)) + // @ts-ignore 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 = new Multiaddr(`${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${(await nodeB.api.id()).id.toString()}`) + // @ts-ignore await nodeA.api.swarm.connect(nodeBCircuitAddr) }, skip: () => isWebWorker // no webrtc support in webworkers @@ -212,11 +221,14 @@ export default { * @param {Controller} relay */ connect: async (nodeA, nodeB, relay) => { + // @ts-ignore await relay.api.swarm.connect(await getWrtcStarAddr(nodeA.api)) + // @ts-ignore 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 = new Multiaddr(`${await getWrtcStarAddr(relay.api)}/p2p-circuit/p2p/${(await nodeB.api.id()).id.toString()}`) + // @ts-ignore 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 7cf396fe..7dfb32ac 100644 --- a/test/exchange-files.js +++ b/test/exchange-files.js @@ -134,7 +134,9 @@ describe('exchange files', function () { before('connect', async function () { this.timeout(timeout); // eslint-disable-line + // @ts-ignore await daemon1.api.swarm.connect(daemon2.peer.addresses[0]) + // @ts-ignore await daemon2.api.swarm.connect(daemon1.peer.addresses[0]) const [peer1, peer2] = await Promise.all([ diff --git a/test/ipns-pubsub.js b/test/ipns-pubsub.js index c308d27f..537f6af2 100644 --- a/test/ipns-pubsub.js +++ b/test/ipns-pubsub.js @@ -71,11 +71,16 @@ describe('ipns-pubsub', function () { // Connect nodes and wait for republish beforeEach('connect the nodes', async function () { this.timeout(60e3) + // @ts-ignore await goNode0.api.swarm.connect(goNode1.peer.addresses[0]) + // @ts-ignore await goNode0.api.swarm.connect(jsNode0.peer.addresses[0]) + // @ts-ignore await goNode0.api.swarm.connect(jsNode1.peer.addresses[0]) + // @ts-ignore await jsNode0.api.swarm.connect(jsNode1.peer.addresses[0]) + // @ts-ignore await jsNode0.api.swarm.connect(goNode1.peer.addresses[0]) }) diff --git a/test/kad-dht.js b/test/kad-dht.js index 55622451..42f868b3 100644 --- a/test/kad-dht.js +++ b/test/kad-dht.js @@ -154,6 +154,7 @@ const createBootstrappedNetwork = function (name, createBootstrapper, createNode createNetwork(name, async factory => { const bootstrapper = await createBootstrapper(factory) const bootstrapAddr = await getNodeAddr(bootstrapper) + // @ts-ignore const nodes = await createNodes(factory, bootstrapAddr) await delay(5000) @@ -211,8 +212,11 @@ const createLinearNetwork = function (name, createNodes) { * +-+ +-+ */ + // @ts-ignore await node3.api.swarm.connect(node0.peer.addresses[0]) + // @ts-ignore await node0.api.swarm.connect(node1.peer.addresses[0]) + // @ts-ignore await node1.api.swarm.connect(node2.peer.addresses[0]) // ensure nodes have their peers in their routing tables @@ -248,7 +252,9 @@ const createDisjointNetwork = function (name, createNodes) { // Make connections between nodes // 0 -> 1 -> 2 + // @ts-ignore await node0.api.swarm.connect(node1.peer.addresses[0]) + // @ts-ignore await node1.api.swarm.connect(node2.peer.addresses[0]) // ensure nodes have their peers in their routing tables @@ -256,7 +262,9 @@ const createDisjointNetwork = function (name, createNodes) { await inRoutingTable(node1, node2) // 3 -> 4 -> 5 + // @ts-ignore await node3.api.swarm.connect(node4.peer.addresses[0]) + // @ts-ignore await node4.api.swarm.connect(node5.peer.addresses[0]) // ensure nodes have their peers in their routing tables @@ -281,6 +289,7 @@ const createDisjointNetwork = function (name, createNodes) { * Make connections between nodes * 0 -> 1 -> 2 -> 5 -> 4 -> 3 */ + // @ts-ignore await node2.api.swarm.connect(node5.peer.addresses[0]) await inRoutingTable(node2, node5) diff --git a/test/pubsub.js b/test/pubsub.js index 21931ddf..8fe57163 100644 --- a/test/pubsub.js +++ b/test/pubsub.js @@ -70,7 +70,9 @@ describe('pubsub', function () { }) before('connect', async function () { + // @ts-ignore await daemon1.api.swarm.connect(daemon2.peer.addresses[0]) + // @ts-ignore await daemon2.api.swarm.connect(daemon1.peer.addresses[0]) const peers = await Promise.all([ diff --git a/test/utils/circuit.js b/test/utils/circuit.js index 3f5b296d..5aac7537 100644 --- a/test/utils/circuit.js +++ b/test/utils/circuit.js @@ -280,15 +280,18 @@ export async function connect (nodeA, nodeB, relay, timeout = 1000) { const nodeBId = (await nodeB.api.id()).id if (process.env.DEBUG) console.log(`connect A (${nodeAId.toString()}) to relay at`, relayWsAddr.toString()) + // @ts-ignore await nodeA.api.swarm.connect(relayWsAddr) if (process.env.DEBUG) console.log(`connect B (${nodeBId.toString()}) to relay at`, relayWsAddr.toString()) + // @ts-ignore await nodeB.api.swarm.connect(relayWsAddr) // TODO: needed until https://github.com/ipfs/interop/issues/17 is resolved await delay(timeout) const nodeBCircuitAddr = new Multiaddr(`${relayWsAddr}/p2p-circuit/p2p/${nodeBId.toString()}`) if (process.env.DEBUG) console.log('connect A to B over circuit', nodeBCircuitAddr.toString()) + // @ts-ignore await nodeA.api.swarm.connect(nodeBCircuitAddr) if (process.env.DEBUG) {