From 4cf197e54d2b327601aa6a015f63a337d40dcc38 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 22 Jun 2022 15:12:14 +1000 Subject: [PATCH] Implement libp2p bootstrap interface --- .eslintrc.json | 5 +- package-lock.json | 1143 +++++++++++++++++--------------- package.json | 7 +- src/lib/discovery/bootstrap.ts | 175 ++++- src/lib/waku.ts | 45 +- 5 files changed, 797 insertions(+), 578 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 47e4113505..747e539c62 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,7 +14,10 @@ ], "globals": { "BigInt": true, "console": true, "WebAssembly": true }, "rules": { - "@typescript-eslint/explicit-function-return-type": ["error"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { "allowExpressions": true } + ], "@typescript-eslint/explicit-module-boundary-types": "off", "eslint-comments/disable-enable-pair": [ "error", diff --git a/package-lock.json b/package-lock.json index c71d656e7e..6e0e70dbda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,10 +12,14 @@ "@chainsafe/libp2p-gossipsub": "^2.0.0", "@chainsafe/libp2p-noise": "^7.0.0", "@ethersproject/rlp": "^5.5.0", + "@libp2p/interface-peer-discovery": "^1.0.0", "@libp2p/interface-peer-id": "^1.0.2", + "@libp2p/interface-peer-info": "^1.0.1", "@libp2p/interface-peer-store": "^1.0.0", "@libp2p/interfaces": "^3.0.2", + "@libp2p/mplex": "^3.0.0", "@libp2p/peer-id": "^1.1.10", + "@libp2p/websockets": "^3.0.0", "@multiformats/multiaddr": "^10.2.0", "@noble/secp256k1": "^1.3.4", "debug": "^4.3.4", @@ -26,10 +30,7 @@ "it-pipe": "^1.1.0", "js-sha3": "^0.8.0", "libp2p": "^0.37.3", - "libp2p-bootstrap": "^0.14.0", "libp2p-crypto": "^0.21.2", - "libp2p-mplex": "^0.10.4", - "libp2p-websockets": "^0.16.1", "multiformats": "^9.6.5", "protons-runtime": "^1.0.4", "uint8arrays": "^3.0.0", @@ -1814,6 +1815,35 @@ "npm": ">=7.0.0" } }, + "node_modules/@libp2p/interface-stream-muxer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-1.1.0.tgz", + "integrity": "sha512-RvljPB4VIUwewAFyI23ldjmnjeh6b3grxjyqSFZvghtDrVgJqpEIHlm1F1pT2rdGG6vC0NIzSJGQ5p/rVPfUvA==", + "dependencies": { + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interfaces": "^3.0.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/interface-stream-muxer/node_modules/@libp2p/interface-connection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-2.1.1.tgz", + "integrity": "sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^10.2.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@libp2p/interface-transport": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-1.0.2.tgz", @@ -1890,6 +1920,147 @@ "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-2.0.2.tgz", "integrity": "sha512-f/n6HqXGDbHvuMR/3UN+S6W4y/bS1Pxg6Lb0oVc5dbflxy5f3NKkizKs86B8vzqHnB9hm1YpE0pgcEvI3FKDQw==" }, + "node_modules/@libp2p/mplex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-3.0.0.tgz", + "integrity": "sha512-vF8gUlGQfs6j2BmRdaKbKoyiB6ye9dP5rUO4Q2Ihy7wa3IyIJg4mYE8HpN7wr7LaFjspyS/ZgDXvtaJA1qSvUg==", + "dependencies": { + "@libp2p/components": "^2.0.0", + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-stream-muxer": "^1.0.1", + "@libp2p/logger": "^2.0.0", + "@libp2p/tracked-map": "^1.0.5", + "abortable-iterator": "^4.0.2", + "any-signal": "^3.0.0", + "err-code": "^3.0.1", + "it-pipe": "^2.0.3", + "it-pushable": "^3.0.0", + "it-stream-types": "^1.0.4", + "uint8arraylist": "^1.4.0", + "uint8arrays": "^3.0.0", + "varint": "^6.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/mplex/node_modules/@libp2p/components": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/components/-/components-2.0.1.tgz", + "integrity": "sha512-3+HgBnu7MbSBcAODtMRxSbdZ54vNB2TGxmPxeNhDBFb+jTw4pUwCeXUcTkSNzsY8cME0MhsEzQ7bwpdXa9xPeQ==", + "dependencies": { + "@libp2p/interface-address-manager": "^1.0.1", + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-connection-manager": "^1.0.0", + "@libp2p/interface-content-routing": "^1.0.0", + "@libp2p/interface-dht": "^1.0.0", + "@libp2p/interface-metrics": "^2.0.0", + "@libp2p/interface-peer-id": "^1.0.2", + "@libp2p/interface-peer-routing": "^1.0.0", + "@libp2p/interface-peer-store": "^1.0.0", + "@libp2p/interface-pubsub": "^1.0.0", + "@libp2p/interface-registrar": "^2.0.0", + "@libp2p/interface-transport": "^1.0.0", + "@libp2p/interfaces": "^3.0.2", + "err-code": "^3.0.1", + "interface-datastore": "^6.1.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/mplex/node_modules/@libp2p/interface-connection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-2.1.1.tgz", + "integrity": "sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^10.2.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/mplex/node_modules/@libp2p/interface-metrics": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface-metrics/-/interface-metrics-2.0.0.tgz", + "integrity": "sha512-OUMspbgamrPgTQWA9zjyrcVQtXpWegSzPllDVwySBefv14l6AhpgicvVI8s+FPbzdKSj6AanlYDa7V8Ui/14CQ==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/mplex/node_modules/@libp2p/interface-registrar": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-registrar/-/interface-registrar-2.0.2.tgz", + "integrity": "sha512-HqDQua9J6T9KzrdYA9EhYsI0oc4CeSR1sfi0qdk073/IB3SlP+XtD7RzzVuGeyXjssqZtqf3RwjV7C+zOlHYlw==", + "dependencies": { + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-peer-id": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/mplex/node_modules/@libp2p/logger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-2.0.0.tgz", + "integrity": "sha512-aC1Yz4bni8Cui1tKCL5PzQSlS3BE/hhvyVnEHhcUz+GCo+MpbmyrZSPAb/m1e7bHrDDKkT1f9DSr7vgmS/NkuQ==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.2", + "debug": "^4.3.3", + "interface-datastore": "^6.1.0", + "multiformats": "^9.6.3" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/mplex/node_modules/abortable-iterator": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-4.0.2.tgz", + "integrity": "sha512-SJGELER5yXr9v3kiL6mT5RZ1qlyJ9hV4nm34+vfsdIM1lp3zENQvpsqKgykpFLgRMUn3lzlizLTpiOASW05/+g==", + "dependencies": { + "get-iterator": "^2.0.0", + "it-stream-types": "^1.0.3" + } + }, + "node_modules/@libp2p/mplex/node_modules/get-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.0.tgz", + "integrity": "sha512-BDJawD5PU2gZv6Vlp8O28H4GnZcsr3h9gZUvnAP5xXP3WOy/QAoOsyMepSkw21jur+4t5Vppde72ChjhTIzxzg==" + }, + "node_modules/@libp2p/mplex/node_modules/it-pipe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-2.0.3.tgz", + "integrity": "sha512-1bfNC0v8yFDQu5KwZpHZrVO+nxOIEXfrobYtv55NXcsMfGu2SueMOCyCm63khejA+sCU0gLcRFQIfKWlBNNTGw==", + "dependencies": { + "it-merge": "^1.0.4", + "it-pushable": "^2.0.0", + "it-stream-types": "^1.0.3" + } + }, + "node_modules/@libp2p/mplex/node_modules/it-pipe/node_modules/it-pushable": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-2.0.2.tgz", + "integrity": "sha512-f/n6HqXGDbHvuMR/3UN+S6W4y/bS1Pxg6Lb0oVc5dbflxy5f3NKkizKs86B8vzqHnB9hm1YpE0pgcEvI3FKDQw==" + }, + "node_modules/@libp2p/mplex/node_modules/it-pushable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.0.0.tgz", + "integrity": "sha512-Lpo9Q6wghDDoX8RyA2vIkpNckd5E0EY7RzIKwgiTPakrTmwDw7tKMx6DDJ1ZXrunYnHdKHnKSHYJL3Csya5U2w==" + }, "node_modules/@libp2p/multistream-select": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-1.0.6.tgz", @@ -2469,6 +2640,159 @@ } } }, + "node_modules/@libp2p/websockets": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-3.0.1.tgz", + "integrity": "sha512-H9xyxvZ0+0SACIGY6Ppa19K3h567set8tfSnxy/fjzUAJRM6ZwYMROh5N0dMLjyl/vjqTNh5iyJmnO3upddGGA==", + "dependencies": { + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-transport": "^1.0.0", + "@libp2p/interfaces": "^3.0.1", + "@libp2p/logger": "^2.0.0", + "@libp2p/utils": "^3.0.0", + "@multiformats/mafmt": "^11.0.2", + "@multiformats/multiaddr": "^10.1.5", + "@multiformats/multiaddr-to-uri": "^9.0.0", + "abortable-iterator": "^4.0.2", + "err-code": "^3.0.1", + "it-ws": "^5.0.0", + "p-defer": "^4.0.0", + "p-timeout": "^5.0.2", + "wherearewe": "^1.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/websockets/node_modules/@libp2p/interface-connection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-2.1.1.tgz", + "integrity": "sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^10.2.0", + "it-stream-types": "^1.0.4" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/websockets/node_modules/@libp2p/logger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-2.0.0.tgz", + "integrity": "sha512-aC1Yz4bni8Cui1tKCL5PzQSlS3BE/hhvyVnEHhcUz+GCo+MpbmyrZSPAb/m1e7bHrDDKkT1f9DSr7vgmS/NkuQ==", + "dependencies": { + "@libp2p/interface-peer-id": "^1.0.2", + "debug": "^4.3.3", + "interface-datastore": "^6.1.0", + "multiformats": "^9.6.3" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/websockets/node_modules/@libp2p/utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-3.0.0.tgz", + "integrity": "sha512-ik2IjnoO+73/5b3gSfXyMS3+eQAhNpzhzvvqQNOI8gcU6jcLvliStldwt1LKiMe9M3ZUOy6LHeB/3vF1dO9CSA==", + "dependencies": { + "@achingbrain/ip-address": "^8.1.0", + "@libp2p/interface-connection": "^2.1.0", + "@libp2p/interface-peer-store": "^1.0.0", + "@libp2p/logger": "^2.0.0", + "@multiformats/multiaddr": "^10.1.1", + "abortable-iterator": "^4.0.2", + "err-code": "^3.0.1", + "is-loopback-addr": "^2.0.1", + "it-stream-types": "^1.0.4", + "private-ip": "^2.1.1" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/websockets/node_modules/abortable-iterator": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-4.0.2.tgz", + "integrity": "sha512-SJGELER5yXr9v3kiL6mT5RZ1qlyJ9hV4nm34+vfsdIM1lp3zENQvpsqKgykpFLgRMUn3lzlizLTpiOASW05/+g==", + "dependencies": { + "get-iterator": "^2.0.0", + "it-stream-types": "^1.0.3" + } + }, + "node_modules/@libp2p/websockets/node_modules/get-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.0.tgz", + "integrity": "sha512-BDJawD5PU2gZv6Vlp8O28H4GnZcsr3h9gZUvnAP5xXP3WOy/QAoOsyMepSkw21jur+4t5Vppde72ChjhTIzxzg==" + }, + "node_modules/@libp2p/websockets/node_modules/is-loopback-addr": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.1.tgz", + "integrity": "sha512-SEsepLbdWFb13B6U0tt6dYcUM0iK/U7XOC43N70Z4Qb88WpNtp+ospyNI9ddpqncs7Z7brAEsVBTQpaqSNntIw==" + }, + "node_modules/@libp2p/websockets/node_modules/it-ws": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-5.0.2.tgz", + "integrity": "sha512-beq/nBWuKm2Ds4nYSfPuZRF0USVZJhsIvuUH3kRE5QdaCzivDK7zyeewDgsNBSPr6hPgF5dyPP5NXcXhUcb9QQ==", + "dependencies": { + "event-iterator": "^2.0.0", + "iso-url": "^1.1.2", + "it-stream-types": "^1.0.2", + "uint8arrays": "^3.0.0", + "ws": "^8.4.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@libp2p/websockets/node_modules/p-defer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.0.tgz", + "integrity": "sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@libp2p/websockets/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/@libp2p/websockets/node_modules/ws": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", + "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/@multiformats/mafmt": { "version": "11.0.2", "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-11.0.2.tgz", @@ -2494,6 +2818,14 @@ "npm": ">=7.0.0" } }, + "node_modules/@multiformats/multiaddr-to-uri": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-9.0.1.tgz", + "integrity": "sha512-kSyHZ2lKjoEzHu/TM4ZVwFj4AWV1B9qFBFJjYb/fK1NqrnrNb/M3uhoyckJvP7WZvpDsnEc7fUCpmPipDY6LMw==", + "dependencies": { + "@multiformats/multiaddr": "^10.1.1" + } + }, "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", @@ -3065,11 +3397,6 @@ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, - "node_modules/@types/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" - }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -3705,14 +4032,6 @@ "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", "dev": true }, - "node_modules/abortable-iterator": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-3.0.2.tgz", - "integrity": "sha512-qVP8HFfTpUQI2F+f1tpTriKDIZ4XrmwCrBCrQeRKO7DKWF3kgoT6NXiNDv2krrGcHxPwmI63eGQiec81sEaWIw==", - "dependencies": { - "get-iterator": "^1.0.2" - } - }, "node_modules/accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -4503,11 +4822,6 @@ "integrity": "sha512-CLOGsVDrVamzv8sXJGaILUVI6dsuAkouJP/n6t+OxLPeeA4DDby7zn9SB6EUpa1H7oIKoE+rMmkW80zYsFfUjA==", "dev": true }, - "node_modules/class-is": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -5387,16 +5701,6 @@ "node": ">=8" } }, - "node_modules/dns-over-http-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-1.2.3.tgz", - "integrity": "sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA==", - "dependencies": { - "debug": "^4.3.1", - "native-fetch": "^3.0.0", - "receptacle": "^1.3.2" - } - }, "node_modules/dns-query": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/dns-query/-/dns-query-0.11.1.tgz", @@ -5472,17 +5776,6 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "node_modules/electron-fetch": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.4.tgz", - "integrity": "sha512-+fBLXEy4CJWQ5bz8dyaeSG1hD6JJ15kBZyj3eh24pIVrd3hLM47H/umffrdQfS6GZ0falF0g9JT9f3Rs6AVUhw==", - "dependencies": { - "encoding": "^0.1.13" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/electron-to-chromium": { "version": "1.3.810", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.810.tgz", @@ -5509,14 +5802,6 @@ "node": ">= 0.8" } }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -6756,11 +7041,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" - }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -7221,6 +7501,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -7382,23 +7663,6 @@ "node": ">= 0.10" } }, - "node_modules/ip-address": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-8.1.0.tgz", - "integrity": "sha512-Wz91gZKpNKoXtqvY8ScarKYwhXoK4r/b5QuT+uywe/azv0/nUCo7Bh0IRRI7F9DHR06kJNWtzMGLIbXavngbKA==", - "dependencies": { - "jsbn": "1.1.0", - "sprintf-js": "1.1.2" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/ip-address/node_modules/sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" - }, "node_modules/ip-regex": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", @@ -7415,27 +7679,6 @@ "node": ">= 10" } }, - "node_modules/ipfs-utils": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-9.0.5.tgz", - "integrity": "sha512-GXWfsq/nKtwkcTI4+KGc4CU9EFXjtkWaGcFAsnm177kAhA0Fnn8aWNRaF/C0xFraUIl1wTAUTWkaGKigVyfsTw==", - "dependencies": { - "any-signal": "^3.0.0", - "buffer": "^6.0.1", - "electron-fetch": "^1.7.2", - "err-code": "^3.0.1", - "is-electron": "^2.2.0", - "iso-url": "^1.1.5", - "it-glob": "^1.0.1", - "it-to-stream": "^1.0.0", - "merge-options": "^3.0.4", - "nanoid": "^3.1.20", - "native-fetch": "^3.0.0", - "node-fetch": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "react-native-fetch-api": "^2.0.0", - "stream-to-it": "^0.2.2" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7572,11 +7815,6 @@ "node": ">=8" } }, - "node_modules/is-loopback-addr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", - "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" - }, "node_modules/is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -7972,15 +8210,6 @@ "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-0.1.1.tgz", "integrity": "sha512-ZLxL651N5w5SL/EIIcrXELgYrrkuEKj/TErG93C4lr6lNZziKsf338ljSG85PjQfu7Frg/1wESl5pLrPSFXI9g==" }, - "node_modules/it-glob": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-1.0.2.tgz", - "integrity": "sha512-Ch2Dzhw4URfB9L/0ZHyY+uqOnKvBNeS/SMcRiPmJfpHiM0TsUZn+GkpcZxAoF3dJVdPm/PuIk3A4wlV7SUo23Q==", - "dependencies": { - "@types/minimatch": "^3.0.4", - "minimatch": "^3.0.4" - } - }, "node_modules/it-handshake": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-3.0.1.tgz", @@ -8126,30 +8355,6 @@ "resolved": "https://registry.npmjs.org/it-take/-/it-take-1.0.2.tgz", "integrity": "sha512-u7I6qhhxH7pSevcYNaMECtkvZW365ARqAIt9K+xjdK1B2WUDEjQSfETkOCT8bxFq/59LqrN3cMLUtTgmDBaygw==" }, - "node_modules/it-to-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-to-stream/-/it-to-stream-1.0.0.tgz", - "integrity": "sha512-pLULMZMAB/+vbdvbZtebC0nWBTbG581lk6w8P7DfIIIKUfa8FbY7Oi0FxZcFPbxvISs7A9E+cMpLDBc1XhpAOA==", - "dependencies": { - "buffer": "^6.0.3", - "fast-fifo": "^1.0.0", - "get-iterator": "^1.0.2", - "p-defer": "^3.0.0", - "p-fifo": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "node_modules/it-ws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-4.0.0.tgz", - "integrity": "sha512-XmTzpMkevc6rUboy73r0CCNhciMmL/Yxir9O6FujRwdrjysztqLBQ1Xkr4CpY2m7BVSCObKotaCWJeZ29lOXRA==", - "dependencies": { - "buffer": "^6.0.3", - "event-iterator": "^2.0.0", - "iso-url": "^1.1.2", - "ws": "^7.3.1" - } - }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -8557,20 +8762,6 @@ "npm": ">=7.0.0" } }, - "node_modules/libp2p-bootstrap": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.14.0.tgz", - "integrity": "sha512-j3slZo5nOdA8wVlav8dRZeAXutZ7psz/f10DLoIEX/EFif7uU5oZfIYvjbVGo3ZDl+VQLo2tR0m1lV0westQ3g==", - "dependencies": { - "debug": "^4.3.1", - "mafmt": "^10.0.0", - "multiaddr": "^10.0.0", - "peer-id": "^0.16.0" - }, - "engines": { - "node": ">=15.0.0" - } - }, "node_modules/libp2p-crypto": { "version": "0.21.2", "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.21.2.tgz", @@ -8589,53 +8780,6 @@ "node": ">=12.0.0" } }, - "node_modules/libp2p-mplex": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/libp2p-mplex/-/libp2p-mplex-0.10.7.tgz", - "integrity": "sha512-21VV0DZWuOsHgitWy1GZD1M/kki3a/hVoAJ5QC48p01JNSK5W8gxRiZtq7cCGJ/xNpbQxvMlMtS5eq8CFRlysg==", - "dependencies": { - "abortable-iterator": "^3.0.2", - "bl": "^5.0.0", - "debug": "^4.3.1", - "err-code": "^3.0.1", - "it-pipe": "^1.1.0", - "it-pushable": "^1.4.1", - "varint": "^6.0.0" - } - }, - "node_modules/libp2p-utils": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.4.1.tgz", - "integrity": "sha512-kq/US2unamiyY+YwP47dO1uqpAdcbdYI2Fzi9JIEhjfPBaD1MR/uyQ/YP7ABthl3EaxAjIQYd1TVp85d6QKAtQ==", - "dependencies": { - "abortable-iterator": "^3.0.0", - "debug": "^4.3.0", - "err-code": "^3.0.1", - "ip-address": "^8.0.0", - "is-loopback-addr": "^1.0.0", - "multiaddr": "^10.0.0", - "private-ip": "^2.1.1" - } - }, - "node_modules/libp2p-websockets": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/libp2p-websockets/-/libp2p-websockets-0.16.2.tgz", - "integrity": "sha512-QGfo8jX1Ks16yi8C67CCyMW7k9cfCYiQ0lzKVJBud0fV3ymbMO2L8gzU6iXUUZTHILo8ka26zKhwQ4lmUMI+nA==", - "dependencies": { - "abortable-iterator": "^3.0.0", - "class-is": "^1.1.0", - "debug": "^4.3.1", - "err-code": "^3.0.1", - "ipfs-utils": "^9.0.1", - "it-ws": "^4.0.0", - "libp2p-utils": "^0.4.0", - "mafmt": "^10.0.0", - "multiaddr": "^10.0.0", - "multiaddr-to-uri": "^8.0.0", - "p-defer": "^3.0.0", - "p-timeout": "^4.1.0" - } - }, "node_modules/libp2p/node_modules/@libp2p/interfaces": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-2.0.4.tgz", @@ -9113,14 +9257,6 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, - "node_modules/mafmt": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-10.0.0.tgz", - "integrity": "sha512-K1bziJOXcnepfztu+2Xy9FLKVLaFMDuspmiyJIYRxnO0WOxFSV7XKSdMxMrVZxcvg1+YjlTIvSGTImUHU2k4Aw==", - "dependencies": { - "multiaddr": "^10.0.0" - } - }, "node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", @@ -9626,27 +9762,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "node_modules/multiaddr": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-10.0.1.tgz", - "integrity": "sha512-G5upNcGzEGuTHkzxezPrrD6CaIHR9uo+7MwqhNVcXTs33IInon4y7nMiGxl2CY5hG7chvYQUQhz5V52/Qe3cbg==", - "dependencies": { - "dns-over-http-resolver": "^1.2.3", - "err-code": "^3.0.1", - "is-ip": "^3.1.0", - "multiformats": "^9.4.5", - "uint8arrays": "^3.0.0", - "varint": "^6.0.0" - } - }, - "node_modules/multiaddr-to-uri": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/multiaddr-to-uri/-/multiaddr-to-uri-8.0.0.tgz", - "integrity": "sha512-dq4p/vsOOUdVEd1J1gl+R2GFrXJQH8yjLtz4hodqdVbieg39LvBOdMQRdQnfbg5LSM/q1BYNVf5CBbwZFFqBgA==", - "dependencies": { - "multiaddr": "^10.0.0" - } - }, "node_modules/multiformats": { "version": "9.6.5", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.6.5.tgz", @@ -9681,14 +9796,6 @@ "picocolors": "^1.0.0" } }, - "node_modules/native-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-3.0.0.tgz", - "integrity": "sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==", - "peerDependencies": { - "node-fetch": "*" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -9729,6 +9836,7 @@ "version": "2.6.7", "resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==", + "dev": true, "engines": { "node": "4.x || >=6.0.0" } @@ -10427,6 +10535,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "dev": true, "engines": { "node": ">=10" } @@ -10549,21 +10658,6 @@ "node": "*" } }, - "node_modules/peer-id": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.16.0.tgz", - "integrity": "sha512-EmL7FurFUduU9m1PS9cfJ5TAuCvxKQ7DKpfx3Yj6IKWyBRtosriFuOag/l3ni/dtPgPLwiA4R9IvpL7hsDLJuQ==", - "dependencies": { - "class-is": "^1.1.0", - "libp2p-crypto": "^0.21.0", - "multiformats": "^9.4.5", - "protobufjs": "^6.10.2", - "uint8arrays": "^3.0.0" - }, - "engines": { - "node": ">=15.0.0" - } - }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -11153,14 +11247,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-native-fetch-api": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-native-fetch-api/-/react-native-fetch-api-2.0.0.tgz", - "integrity": "sha512-GOA8tc1EVYLnHvma/TU9VTgLOyralO7eATRuCDchQveXW9Fr9vXygyq9iwqmM7YRZ8qRJfEt9xOS7OYMdJvRFw==", - "dependencies": { - "p-defer": "^3.0.0" - } - }, "node_modules/read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -11611,7 +11697,8 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "node_modules/sanitize-filename": { "version": "1.6.3", @@ -11977,14 +12064,6 @@ "readable-stream": "^3.5.0" } }, - "node_modules/stream-to-it": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", - "dependencies": { - "get-iterator": "^1.0.2" - } - }, "node_modules/streamroller": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.2.tgz", @@ -13427,26 +13506,6 @@ "typedarray-to-buffer": "^3.1.5" } }, - "node_modules/ws": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz", - "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", @@ -15022,6 +15081,29 @@ "@libp2p/interface-peer-id": "^1.0.0" } }, + "@libp2p/interface-stream-muxer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-1.1.0.tgz", + "integrity": "sha512-RvljPB4VIUwewAFyI23ldjmnjeh6b3grxjyqSFZvghtDrVgJqpEIHlm1F1pT2rdGG6vC0NIzSJGQ5p/rVPfUvA==", + "requires": { + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interfaces": "^3.0.0", + "it-stream-types": "^1.0.4" + }, + "dependencies": { + "@libp2p/interface-connection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-2.1.1.tgz", + "integrity": "sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^10.2.0", + "it-stream-types": "^1.0.4" + } + } + } + }, "@libp2p/interface-transport": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-1.0.2.tgz", @@ -15082,6 +15164,127 @@ } } }, + "@libp2p/mplex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/mplex/-/mplex-3.0.0.tgz", + "integrity": "sha512-vF8gUlGQfs6j2BmRdaKbKoyiB6ye9dP5rUO4Q2Ihy7wa3IyIJg4mYE8HpN7wr7LaFjspyS/ZgDXvtaJA1qSvUg==", + "requires": { + "@libp2p/components": "^2.0.0", + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-stream-muxer": "^1.0.1", + "@libp2p/logger": "^2.0.0", + "@libp2p/tracked-map": "^1.0.5", + "abortable-iterator": "^4.0.2", + "any-signal": "^3.0.0", + "err-code": "^3.0.1", + "it-pipe": "^2.0.3", + "it-pushable": "^3.0.0", + "it-stream-types": "^1.0.4", + "uint8arraylist": "^1.4.0", + "uint8arrays": "^3.0.0", + "varint": "^6.0.0" + }, + "dependencies": { + "@libp2p/components": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/components/-/components-2.0.1.tgz", + "integrity": "sha512-3+HgBnu7MbSBcAODtMRxSbdZ54vNB2TGxmPxeNhDBFb+jTw4pUwCeXUcTkSNzsY8cME0MhsEzQ7bwpdXa9xPeQ==", + "requires": { + "@libp2p/interface-address-manager": "^1.0.1", + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-connection-manager": "^1.0.0", + "@libp2p/interface-content-routing": "^1.0.0", + "@libp2p/interface-dht": "^1.0.0", + "@libp2p/interface-metrics": "^2.0.0", + "@libp2p/interface-peer-id": "^1.0.2", + "@libp2p/interface-peer-routing": "^1.0.0", + "@libp2p/interface-peer-store": "^1.0.0", + "@libp2p/interface-pubsub": "^1.0.0", + "@libp2p/interface-registrar": "^2.0.0", + "@libp2p/interface-transport": "^1.0.0", + "@libp2p/interfaces": "^3.0.2", + "err-code": "^3.0.1", + "interface-datastore": "^6.1.0" + } + }, + "@libp2p/interface-connection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-2.1.1.tgz", + "integrity": "sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^10.2.0", + "it-stream-types": "^1.0.4" + } + }, + "@libp2p/interface-metrics": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface-metrics/-/interface-metrics-2.0.0.tgz", + "integrity": "sha512-OUMspbgamrPgTQWA9zjyrcVQtXpWegSzPllDVwySBefv14l6AhpgicvVI8s+FPbzdKSj6AanlYDa7V8Ui/14CQ==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.0", + "it-stream-types": "^1.0.4" + } + }, + "@libp2p/interface-registrar": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface-registrar/-/interface-registrar-2.0.2.tgz", + "integrity": "sha512-HqDQua9J6T9KzrdYA9EhYsI0oc4CeSR1sfi0qdk073/IB3SlP+XtD7RzzVuGeyXjssqZtqf3RwjV7C+zOlHYlw==", + "requires": { + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-peer-id": "^1.0.0" + } + }, + "@libp2p/logger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-2.0.0.tgz", + "integrity": "sha512-aC1Yz4bni8Cui1tKCL5PzQSlS3BE/hhvyVnEHhcUz+GCo+MpbmyrZSPAb/m1e7bHrDDKkT1f9DSr7vgmS/NkuQ==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.2", + "debug": "^4.3.3", + "interface-datastore": "^6.1.0", + "multiformats": "^9.6.3" + } + }, + "abortable-iterator": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-4.0.2.tgz", + "integrity": "sha512-SJGELER5yXr9v3kiL6mT5RZ1qlyJ9hV4nm34+vfsdIM1lp3zENQvpsqKgykpFLgRMUn3lzlizLTpiOASW05/+g==", + "requires": { + "get-iterator": "^2.0.0", + "it-stream-types": "^1.0.3" + } + }, + "get-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.0.tgz", + "integrity": "sha512-BDJawD5PU2gZv6Vlp8O28H4GnZcsr3h9gZUvnAP5xXP3WOy/QAoOsyMepSkw21jur+4t5Vppde72ChjhTIzxzg==" + }, + "it-pipe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-2.0.3.tgz", + "integrity": "sha512-1bfNC0v8yFDQu5KwZpHZrVO+nxOIEXfrobYtv55NXcsMfGu2SueMOCyCm63khejA+sCU0gLcRFQIfKWlBNNTGw==", + "requires": { + "it-merge": "^1.0.4", + "it-pushable": "^2.0.0", + "it-stream-types": "^1.0.3" + }, + "dependencies": { + "it-pushable": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-2.0.2.tgz", + "integrity": "sha512-f/n6HqXGDbHvuMR/3UN+S6W4y/bS1Pxg6Lb0oVc5dbflxy5f3NKkizKs86B8vzqHnB9hm1YpE0pgcEvI3FKDQw==" + } + } + }, + "it-pushable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.0.0.tgz", + "integrity": "sha512-Lpo9Q6wghDDoX8RyA2vIkpNckd5E0EY7RzIKwgiTPakrTmwDw7tKMx6DDJ1ZXrunYnHdKHnKSHYJL3Csya5U2w==" + } + } + }, "@libp2p/multistream-select": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-1.0.6.tgz", @@ -15557,6 +15760,115 @@ } } }, + "@libp2p/websockets": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-3.0.1.tgz", + "integrity": "sha512-H9xyxvZ0+0SACIGY6Ppa19K3h567set8tfSnxy/fjzUAJRM6ZwYMROh5N0dMLjyl/vjqTNh5iyJmnO3upddGGA==", + "requires": { + "@libp2p/interface-connection": "^2.0.0", + "@libp2p/interface-transport": "^1.0.0", + "@libp2p/interfaces": "^3.0.1", + "@libp2p/logger": "^2.0.0", + "@libp2p/utils": "^3.0.0", + "@multiformats/mafmt": "^11.0.2", + "@multiformats/multiaddr": "^10.1.5", + "@multiformats/multiaddr-to-uri": "^9.0.0", + "abortable-iterator": "^4.0.2", + "err-code": "^3.0.1", + "it-ws": "^5.0.0", + "p-defer": "^4.0.0", + "p-timeout": "^5.0.2", + "wherearewe": "^1.0.0" + }, + "dependencies": { + "@libp2p/interface-connection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/interface-connection/-/interface-connection-2.1.1.tgz", + "integrity": "sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.0", + "@libp2p/interfaces": "^3.0.0", + "@multiformats/multiaddr": "^10.2.0", + "it-stream-types": "^1.0.4" + } + }, + "@libp2p/logger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-2.0.0.tgz", + "integrity": "sha512-aC1Yz4bni8Cui1tKCL5PzQSlS3BE/hhvyVnEHhcUz+GCo+MpbmyrZSPAb/m1e7bHrDDKkT1f9DSr7vgmS/NkuQ==", + "requires": { + "@libp2p/interface-peer-id": "^1.0.2", + "debug": "^4.3.3", + "interface-datastore": "^6.1.0", + "multiformats": "^9.6.3" + } + }, + "@libp2p/utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-3.0.0.tgz", + "integrity": "sha512-ik2IjnoO+73/5b3gSfXyMS3+eQAhNpzhzvvqQNOI8gcU6jcLvliStldwt1LKiMe9M3ZUOy6LHeB/3vF1dO9CSA==", + "requires": { + "@achingbrain/ip-address": "^8.1.0", + "@libp2p/interface-connection": "^2.1.0", + "@libp2p/interface-peer-store": "^1.0.0", + "@libp2p/logger": "^2.0.0", + "@multiformats/multiaddr": "^10.1.1", + "abortable-iterator": "^4.0.2", + "err-code": "^3.0.1", + "is-loopback-addr": "^2.0.1", + "it-stream-types": "^1.0.4", + "private-ip": "^2.1.1" + } + }, + "abortable-iterator": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-4.0.2.tgz", + "integrity": "sha512-SJGELER5yXr9v3kiL6mT5RZ1qlyJ9hV4nm34+vfsdIM1lp3zENQvpsqKgykpFLgRMUn3lzlizLTpiOASW05/+g==", + "requires": { + "get-iterator": "^2.0.0", + "it-stream-types": "^1.0.3" + } + }, + "get-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.0.tgz", + "integrity": "sha512-BDJawD5PU2gZv6Vlp8O28H4GnZcsr3h9gZUvnAP5xXP3WOy/QAoOsyMepSkw21jur+4t5Vppde72ChjhTIzxzg==" + }, + "is-loopback-addr": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.1.tgz", + "integrity": "sha512-SEsepLbdWFb13B6U0tt6dYcUM0iK/U7XOC43N70Z4Qb88WpNtp+ospyNI9ddpqncs7Z7brAEsVBTQpaqSNntIw==" + }, + "it-ws": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-5.0.2.tgz", + "integrity": "sha512-beq/nBWuKm2Ds4nYSfPuZRF0USVZJhsIvuUH3kRE5QdaCzivDK7zyeewDgsNBSPr6hPgF5dyPP5NXcXhUcb9QQ==", + "requires": { + "event-iterator": "^2.0.0", + "iso-url": "^1.1.2", + "it-stream-types": "^1.0.2", + "uint8arrays": "^3.0.0", + "ws": "^8.4.0" + } + }, + "p-defer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.0.tgz", + "integrity": "sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==" + }, + "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==" + }, + "ws": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.1.tgz", + "integrity": "sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==", + "requires": {} + } + } + }, "@multiformats/mafmt": { "version": "11.0.2", "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-11.0.2.tgz", @@ -15609,6 +15921,14 @@ } } }, + "@multiformats/multiaddr-to-uri": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-9.0.1.tgz", + "integrity": "sha512-kSyHZ2lKjoEzHu/TM4ZVwFj4AWV1B9qFBFJjYb/fK1NqrnrNb/M3uhoyckJvP7WZvpDsnEc7fUCpmPipDY6LMw==", + "requires": { + "@multiformats/multiaddr": "^10.1.1" + } + }, "@noble/ed25519": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.6.1.tgz", @@ -16067,11 +16387,6 @@ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, - "@types/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" - }, "@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -16545,14 +16860,6 @@ "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", "dev": true }, - "abortable-iterator": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-3.0.2.tgz", - "integrity": "sha512-qVP8HFfTpUQI2F+f1tpTriKDIZ4XrmwCrBCrQeRKO7DKWF3kgoT6NXiNDv2krrGcHxPwmI63eGQiec81sEaWIw==", - "requires": { - "get-iterator": "^1.0.2" - } - }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -17119,11 +17426,6 @@ "integrity": "sha512-CLOGsVDrVamzv8sXJGaILUVI6dsuAkouJP/n6t+OxLPeeA4DDby7zn9SB6EUpa1H7oIKoE+rMmkW80zYsFfUjA==", "dev": true }, - "class-is": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", - "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==" - }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -17807,16 +18109,6 @@ "path-type": "^4.0.0" } }, - "dns-over-http-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/dns-over-http-resolver/-/dns-over-http-resolver-1.2.3.tgz", - "integrity": "sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA==", - "requires": { - "debug": "^4.3.1", - "native-fetch": "^3.0.0", - "receptacle": "^1.3.2" - } - }, "dns-query": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/dns-query/-/dns-query-0.11.1.tgz", @@ -17880,14 +18172,6 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "electron-fetch": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.4.tgz", - "integrity": "sha512-+fBLXEy4CJWQ5bz8dyaeSG1hD6JJ15kBZyj3eh24pIVrd3hLM47H/umffrdQfS6GZ0falF0g9JT9f3Rs6AVUhw==", - "requires": { - "encoding": "^0.1.13" - } - }, "electron-to-chromium": { "version": "1.3.810", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.810.tgz", @@ -17911,14 +18195,6 @@ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", "dev": true }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "requires": { - "iconv-lite": "^0.6.2" - } - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -18838,11 +19114,6 @@ "has-symbols": "^1.0.1" } }, - "get-iterator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", - "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" - }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -19173,6 +19444,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } @@ -19286,22 +19558,6 @@ "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, - "ip-address": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-8.1.0.tgz", - "integrity": "sha512-Wz91gZKpNKoXtqvY8ScarKYwhXoK4r/b5QuT+uywe/azv0/nUCo7Bh0IRRI7F9DHR06kJNWtzMGLIbXavngbKA==", - "requires": { - "jsbn": "1.1.0", - "sprintf-js": "1.1.2" - }, - "dependencies": { - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" - } - } - }, "ip-regex": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", @@ -19312,27 +19568,6 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==" }, - "ipfs-utils": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-9.0.5.tgz", - "integrity": "sha512-GXWfsq/nKtwkcTI4+KGc4CU9EFXjtkWaGcFAsnm177kAhA0Fnn8aWNRaF/C0xFraUIl1wTAUTWkaGKigVyfsTw==", - "requires": { - "any-signal": "^3.0.0", - "buffer": "^6.0.1", - "electron-fetch": "^1.7.2", - "err-code": "^3.0.1", - "is-electron": "^2.2.0", - "iso-url": "^1.1.5", - "it-glob": "^1.0.1", - "it-to-stream": "^1.0.0", - "merge-options": "^3.0.4", - "nanoid": "^3.1.20", - "native-fetch": "^3.0.0", - "node-fetch": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "react-native-fetch-api": "^2.0.0", - "stream-to-it": "^0.2.2" - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -19424,11 +19659,6 @@ "ip-regex": "^4.0.0" } }, - "is-loopback-addr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", - "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" - }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -19724,15 +19954,6 @@ "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-0.1.1.tgz", "integrity": "sha512-ZLxL651N5w5SL/EIIcrXELgYrrkuEKj/TErG93C4lr6lNZziKsf338ljSG85PjQfu7Frg/1wESl5pLrPSFXI9g==" }, - "it-glob": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-1.0.2.tgz", - "integrity": "sha512-Ch2Dzhw4URfB9L/0ZHyY+uqOnKvBNeS/SMcRiPmJfpHiM0TsUZn+GkpcZxAoF3dJVdPm/PuIk3A4wlV7SUo23Q==", - "requires": { - "@types/minimatch": "^3.0.4", - "minimatch": "^3.0.4" - } - }, "it-handshake": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-3.0.1.tgz", @@ -19860,30 +20081,6 @@ "resolved": "https://registry.npmjs.org/it-take/-/it-take-1.0.2.tgz", "integrity": "sha512-u7I6qhhxH7pSevcYNaMECtkvZW365ARqAIt9K+xjdK1B2WUDEjQSfETkOCT8bxFq/59LqrN3cMLUtTgmDBaygw==" }, - "it-to-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-to-stream/-/it-to-stream-1.0.0.tgz", - "integrity": "sha512-pLULMZMAB/+vbdvbZtebC0nWBTbG581lk6w8P7DfIIIKUfa8FbY7Oi0FxZcFPbxvISs7A9E+cMpLDBc1XhpAOA==", - "requires": { - "buffer": "^6.0.3", - "fast-fifo": "^1.0.0", - "get-iterator": "^1.0.2", - "p-defer": "^3.0.0", - "p-fifo": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "it-ws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-4.0.0.tgz", - "integrity": "sha512-XmTzpMkevc6rUboy73r0CCNhciMmL/Yxir9O6FujRwdrjysztqLBQ1Xkr4CpY2m7BVSCObKotaCWJeZ29lOXRA==", - "requires": { - "buffer": "^6.0.3", - "event-iterator": "^2.0.0", - "iso-url": "^1.1.2", - "ws": "^7.3.1" - } - }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -20270,17 +20467,6 @@ } } }, - "libp2p-bootstrap": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.14.0.tgz", - "integrity": "sha512-j3slZo5nOdA8wVlav8dRZeAXutZ7psz/f10DLoIEX/EFif7uU5oZfIYvjbVGo3ZDl+VQLo2tR0m1lV0westQ3g==", - "requires": { - "debug": "^4.3.1", - "mafmt": "^10.0.0", - "multiaddr": "^10.0.0", - "peer-id": "^0.16.0" - } - }, "libp2p-crypto": { "version": "0.21.2", "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.21.2.tgz", @@ -20296,53 +20482,6 @@ "uint8arrays": "^3.0.0" } }, - "libp2p-mplex": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/libp2p-mplex/-/libp2p-mplex-0.10.7.tgz", - "integrity": "sha512-21VV0DZWuOsHgitWy1GZD1M/kki3a/hVoAJ5QC48p01JNSK5W8gxRiZtq7cCGJ/xNpbQxvMlMtS5eq8CFRlysg==", - "requires": { - "abortable-iterator": "^3.0.2", - "bl": "^5.0.0", - "debug": "^4.3.1", - "err-code": "^3.0.1", - "it-pipe": "^1.1.0", - "it-pushable": "^1.4.1", - "varint": "^6.0.0" - } - }, - "libp2p-utils": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.4.1.tgz", - "integrity": "sha512-kq/US2unamiyY+YwP47dO1uqpAdcbdYI2Fzi9JIEhjfPBaD1MR/uyQ/YP7ABthl3EaxAjIQYd1TVp85d6QKAtQ==", - "requires": { - "abortable-iterator": "^3.0.0", - "debug": "^4.3.0", - "err-code": "^3.0.1", - "ip-address": "^8.0.0", - "is-loopback-addr": "^1.0.0", - "multiaddr": "^10.0.0", - "private-ip": "^2.1.1" - } - }, - "libp2p-websockets": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/libp2p-websockets/-/libp2p-websockets-0.16.2.tgz", - "integrity": "sha512-QGfo8jX1Ks16yi8C67CCyMW7k9cfCYiQ0lzKVJBud0fV3ymbMO2L8gzU6iXUUZTHILo8ka26zKhwQ4lmUMI+nA==", - "requires": { - "abortable-iterator": "^3.0.0", - "class-is": "^1.1.0", - "debug": "^4.3.1", - "err-code": "^3.0.1", - "ipfs-utils": "^9.0.1", - "it-ws": "^4.0.0", - "libp2p-utils": "^0.4.0", - "mafmt": "^10.0.0", - "multiaddr": "^10.0.0", - "multiaddr-to-uri": "^8.0.0", - "p-defer": "^3.0.0", - "p-timeout": "^4.1.0" - } - }, "lilconfig": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", @@ -20657,14 +20796,6 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, - "mafmt": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-10.0.0.tgz", - "integrity": "sha512-K1bziJOXcnepfztu+2Xy9FLKVLaFMDuspmiyJIYRxnO0WOxFSV7XKSdMxMrVZxcvg1+YjlTIvSGTImUHU2k4Aw==", - "requires": { - "multiaddr": "^10.0.0" - } - }, "magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", @@ -21024,27 +21155,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "multiaddr": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-10.0.1.tgz", - "integrity": "sha512-G5upNcGzEGuTHkzxezPrrD6CaIHR9uo+7MwqhNVcXTs33IInon4y7nMiGxl2CY5hG7chvYQUQhz5V52/Qe3cbg==", - "requires": { - "dns-over-http-resolver": "^1.2.3", - "err-code": "^3.0.1", - "is-ip": "^3.1.0", - "multiformats": "^9.4.5", - "uint8arrays": "^3.0.0", - "varint": "^6.0.0" - } - }, - "multiaddr-to-uri": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/multiaddr-to-uri/-/multiaddr-to-uri-8.0.0.tgz", - "integrity": "sha512-dq4p/vsOOUdVEd1J1gl+R2GFrXJQH8yjLtz4hodqdVbieg39LvBOdMQRdQnfbg5LSM/q1BYNVf5CBbwZFFqBgA==", - "requires": { - "multiaddr": "^10.0.0" - } - }, "multiformats": { "version": "9.6.5", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.6.5.tgz", @@ -21069,12 +21179,6 @@ "picocolors": "^1.0.0" } }, - "native-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/native-fetch/-/native-fetch-3.0.0.tgz", - "integrity": "sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw==", - "requires": {} - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -21107,7 +21211,8 @@ "node-fetch": { "version": "npm:@achingbrain/node-fetch@2.6.7", "resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==" + "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==", + "dev": true }, "node-forge": { "version": "1.3.1", @@ -21629,7 +21734,8 @@ "p-timeout": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", - "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==" + "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "dev": true }, "p-try": { "version": "2.2.0", @@ -21716,18 +21822,6 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "peer-id": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.16.0.tgz", - "integrity": "sha512-EmL7FurFUduU9m1PS9cfJ5TAuCvxKQ7DKpfx3Yj6IKWyBRtosriFuOag/l3ni/dtPgPLwiA4R9IvpL7hsDLJuQ==", - "requires": { - "class-is": "^1.1.0", - "libp2p-crypto": "^0.21.0", - "multiformats": "^9.4.5", - "protobufjs": "^6.10.2", - "uint8arrays": "^3.0.0" - } - }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -22146,14 +22240,6 @@ "object-assign": "^4.1.1" } }, - "react-native-fetch-api": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-native-fetch-api/-/react-native-fetch-api-2.0.0.tgz", - "integrity": "sha512-GOA8tc1EVYLnHvma/TU9VTgLOyralO7eATRuCDchQveXW9Fr9vXygyq9iwqmM7YRZ8qRJfEt9xOS7OYMdJvRFw==", - "requires": { - "p-defer": "^3.0.0" - } - }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -22472,7 +22558,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "sanitize-filename": { "version": "1.6.3", @@ -22771,14 +22858,6 @@ "readable-stream": "^3.5.0" } }, - "stream-to-it": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", - "integrity": "sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ==", - "requires": { - "get-iterator": "^1.0.2" - } - }, "streamroller": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.2.tgz", @@ -23829,12 +23908,6 @@ "typedarray-to-buffer": "^3.1.5" } }, - "ws": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz", - "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw==", - "requires": {} - }, "xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", diff --git a/package.json b/package.json index 1e6f362e97..6e997ec502 100644 --- a/package.json +++ b/package.json @@ -69,10 +69,14 @@ "@chainsafe/libp2p-gossipsub": "^2.0.0", "@chainsafe/libp2p-noise": "^7.0.0", "@ethersproject/rlp": "^5.5.0", + "@libp2p/interface-peer-discovery": "^1.0.0", "@libp2p/interface-peer-id": "^1.0.2", + "@libp2p/interface-peer-info": "^1.0.1", "@libp2p/interface-peer-store": "^1.0.0", "@libp2p/interfaces": "^3.0.2", + "@libp2p/mplex": "^3.0.0", "@libp2p/peer-id": "^1.1.10", + "@libp2p/websockets": "^3.0.0", "@multiformats/multiaddr": "^10.2.0", "@noble/secp256k1": "^1.3.4", "debug": "^4.3.4", @@ -83,10 +87,7 @@ "it-pipe": "^1.1.0", "js-sha3": "^0.8.0", "libp2p": "^0.37.3", - "libp2p-bootstrap": "^0.14.0", "libp2p-crypto": "^0.21.2", - "libp2p-mplex": "^0.10.4", - "libp2p-websockets": "^0.16.1", "multiformats": "^9.6.5", "protons-runtime": "^1.0.4", "uint8arrays": "^3.0.0", diff --git a/src/lib/discovery/bootstrap.ts b/src/lib/discovery/bootstrap.ts index c4d84e48aa..e82e9d240a 100644 --- a/src/lib/discovery/bootstrap.ts +++ b/src/lib/discovery/bootstrap.ts @@ -1,3 +1,11 @@ +import type { + PeerDiscovery, + PeerDiscoveryEvents, +} from "@libp2p/interface-peer-discovery"; +import { symbol } from "@libp2p/interface-peer-discovery"; +import type { PeerInfo } from "@libp2p/interface-peer-info"; +import { CustomEvent, EventEmitter } from "@libp2p/interfaces/events"; +import { peerIdFromString } from "@libp2p/peer-id/src"; import { Multiaddr } from "@multiformats/multiaddr"; import debug from "debug"; @@ -5,7 +13,7 @@ import { DnsNodeDiscovery, NodeCapabilityCount } from "./dns"; import { getPredefinedBootstrapNodes } from "./predefined"; import { getPseudoRandomSubset } from "./random_subset"; -const dbg = debug("waku:discovery:bootstrap"); +const log = debug("waku:discovery:bootstrap"); /** * Setup discovery method used to bootstrap. @@ -35,8 +43,14 @@ export interface BootstrapOptions { peers?: string[] | Multiaddr[]; /** * Getter that retrieve multiaddrs of peers to connect to. + * will be called once. */ getPeers?: () => Promise; + /** + * The interval between emitting addresses in milliseconds. + * Used if [[peers]] is passed or a sync function is passed for [[getPeers]] + */ + interval?: number; /** * An EIP-1459 ENR Tree URL. For example: * "enrtree://AOFTICU2XWDULNLZGRMQS4RIZPAZEHYMV4FYHAPW563HNRAOERP7C@test.nodes.vac.dev" @@ -56,23 +70,50 @@ export interface BootstrapOptions { * * @throws if an invalid combination of options is passed, see [[BootstrapOptions]] for details. */ -export class Bootstrap { - public static DefaultMaxPeers = 1; +export class Bootstrap + extends EventEmitter + implements PeerDiscovery +{ + static DefaultMaxPeers = 1; - public readonly getBootstrapPeers: (() => Promise) | undefined; + private readonly asyncGetBootstrapPeers: + | (() => Promise) + | undefined; + private peers: PeerInfo[]; + private timer?: ReturnType; + private readonly interval: number; constructor(opts: BootstrapOptions) { + super(); + + const methods = [ + !!opts.default, + !!opts.peers, + !!opts.getPeers, + !!opts.enrUrl, + ].filter((x) => x); + if (methods.length > 1) { + throw new Error( + "Bootstrap does not support several discovery methods (yet)" + ); + } + + this.interval = opts.interval ?? 10000; + opts.default = + opts.default ?? (!opts.peers && !opts.getPeers && !opts.enrUrl); const maxPeers = opts.maxPeers ?? Bootstrap.DefaultMaxPeers; + this.peers = []; if (opts.default) { - dbg("Use hosted list of peers."); + log("Use hosted list of peers."); - this.getBootstrapPeers = (): Promise => { - return Promise.resolve( - getPredefinedBootstrapNodes(undefined, maxPeers) - ); - }; - } else if (opts.peers !== undefined && opts.peers.length > 0) { + this.peers = multiaddrsToPeerInfo( + getPredefinedBootstrapNodes(undefined, maxPeers) + ); + return; + } + + if (!!opts.peers && opts.peers.length > 0) { const allPeers: Multiaddr[] = opts.peers.map( (node: string | Multiaddr) => { if (typeof node === "string") { @@ -82,41 +123,121 @@ export class Bootstrap { } } ); - const peers = getPseudoRandomSubset(allPeers, maxPeers); - dbg( - "Use provided list of peers (reduced to maxPeers)", - allPeers.map((ma) => ma.toString()) + this.peers = multiaddrsToPeerInfo( + getPseudoRandomSubset(allPeers, maxPeers) ); - this.getBootstrapPeers = (): Promise => - Promise.resolve(peers); - } else if (typeof opts.getPeers === "function") { - dbg("Bootstrap: Use provided getPeers function."); + log( + "Use provided list of peers (reduced to maxPeers)", + this.peers.map((ma) => ma.toString()) + ); + return; + } + + if (typeof opts.getPeers === "function") { + log("Bootstrap: Use provided getPeers function."); const getPeers = opts.getPeers; - this.getBootstrapPeers = async (): Promise => { + this.asyncGetBootstrapPeers = async () => { const allPeers = await getPeers(); return getPseudoRandomSubset( allPeers, maxPeers ).map((node) => new Multiaddr(node)); }; - } else if (opts.enrUrl) { + return; + } + + if (opts.enrUrl) { const wantedNodeCapabilityCount = opts.wantedNodeCapabilityCount; if (!wantedNodeCapabilityCount) throw "`wantedNodeCapabilityCount` must be defined when using `enrUrl`"; const enrUrl = opts.enrUrl; - dbg("Use provided EIP-1459 ENR Tree URL."); + log("Use provided EIP-1459 ENR Tree URL."); const dns = DnsNodeDiscovery.dnsOverHttp(); - this.getBootstrapPeers = async (): Promise => { + this.asyncGetBootstrapPeers = async () => { const enrs = await dns.getPeers([enrUrl], wantedNodeCapabilityCount); - dbg(`Found ${enrs.length} peers`); + log(`Found ${enrs.length} peers`); return enrs.map((enr) => enr.getFullMultiaddrs()).flat(); }; - } else { - dbg("No bootstrap method specified, no peer will be returned"); - this.getBootstrapPeers = undefined; + + return; } } + + /** + * Start discovery process + */ + start(): void { + if (this.asyncGetBootstrapPeers) { + // TODO: This should emit the peer as they are discovered instead of having + // to wait for the full DNS discovery process to be done first. + // TODO: PeerInfo should be returned by discovery + this.asyncGetBootstrapPeers().then((peers) => { + this.peers = multiaddrsToPeerInfo(peers); + this._startTimer(); + }); + } else { + this._startTimer(); + } + } + + private _startTimer(): void { + if (this.peers) { + log("Starting bootstrap node discovery"); + if (this.timer != null) { + return; + } + + this.timer = setInterval(() => this._returnPeers(), this.interval); + + this._returnPeers(); + } + } + + _returnPeers(): void { + if (this.timer == null) { + return; + } + + this.peers.forEach((peerData) => { + this.dispatchEvent( + new CustomEvent("peer", { detail: peerData }) + ); + }); + } + + /** + * Stop emitting events + */ + stop(): void { + if (this.timer != null) { + clearInterval(this.timer); + } + + this.timer = undefined; + } + + get [symbol](): true { + return true; + } + + get [Symbol.toStringTag](): string { + return "@waku/bootstrap"; + } +} + +function multiaddrsToPeerInfo(mas: Multiaddr[]): PeerInfo[] { + return mas + .map((ma) => { + const peerIdStr = ma.getPeerId(); + const protocols: string[] = []; + return { + id: peerIdStr ? peerIdFromString(peerIdStr) : null, + multiaddrs: [ma.decapsulateCode(421)], + protocols, + }; + }) + .filter((peerInfo): peerInfo is PeerInfo => peerInfo.id !== null); } diff --git a/src/lib/waku.ts b/src/lib/waku.ts index 91298f3ecf..d7df8efc86 100644 --- a/src/lib/waku.ts +++ b/src/lib/waku.ts @@ -1,19 +1,13 @@ import { Noise } from "@chainsafe/libp2p-noise"; import type { PeerId } from "@libp2p/interface-peer-id"; +import { MuxedStream } from "@libp2p/interfaces/stream-muxer/types"; +import { Mplex } from "@libp2p/mplex"; +import { WebSockets } from "@libp2p/websockets"; +import filters from "@libp2p/websockets/filters"; import { Multiaddr, multiaddr } from "@multiformats/multiaddr"; import debug from "debug"; import { createLibp2p, Libp2p, Libp2pOptions } from "libp2p"; import Libp2pBootstrap from "libp2p-bootstrap"; -import { MuxedStream } from "libp2p-interfaces/dist/src/stream-muxer/types"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore: No types available -import Mplex from "libp2p-mplex"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore: No types available -import Websockets from "libp2p-websockets"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore: No types available -import filters from "libp2p-websockets/src/filters"; import PingService from "libp2p/src/ping"; import { Bootstrap, BootstrapOptions } from "./discovery"; @@ -24,8 +18,6 @@ import { WakuRelay } from "./waku_relay"; import { RelayCodecs, RelayPingContentTopic } from "./waku_relay/constants"; import { StoreCodecs, WakuStore } from "./waku_store"; -const websocketsTransportKey = Websockets.prototype[Symbol.toStringTag]; - export const DefaultPingKeepAliveValueSecs = 0; export const DefaultRelayKeepAliveValueSecs = 5 * 60; @@ -93,6 +85,35 @@ export interface CreateOptions { decryptionKeys?: Array; } +export async function createWaku(): Promise { + const libp2pOpts = { + transports: new WebSockets({ filter: filters.all }), + streamMuxers: [new Mplex()], + pubsub: new WakuRelay(), + connectionEncryption: [new Noise()], + }; + + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore: modules property is correctly set thanks to voodoo + const libp2p = await createLibp2p(libp2pOpts); + + const wakuStore = new WakuStore(libp2p, { + pubSubTopic: options?.pubSubTopic, + }); + const wakuLightPush = new WakuLightPush(libp2p); + const wakuFilter = new WakuFilter(libp2p); + + await libp2p.start(); + + return new Waku( + options ? options : {}, + libp2p, + wakuStore, + wakuLightPush, + wakuFilter + ); +} + export class Waku { public libp2p: Libp2p; public relay: WakuRelay;