diff --git a/package-lock.json b/package-lock.json index f2c07eb..452c994 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,20 @@ "name": "ocean-protocol", "version": "0.0.1", "dependencies": { + "@chainsafe/libp2p-noise": "^16.0.0", + "@chainsafe/libp2p-yamux": "^7.0.1", + "@libp2p/bootstrap": "^11.0.6", + "@libp2p/circuit-relay-v2": "^2.1.1", + "@libp2p/crypto": "^4.1.5", + "@libp2p/dcutr": "^2.0.6", + "@libp2p/identify": "^3.0.6", + "@libp2p/kad-dht": "^13.1.2", + "@libp2p/mdns": "^11.0.6", + "@libp2p/peer-id-factory": "^4.2.4", + "@libp2p/ping": "^2.0.6", + "@libp2p/tcp": "^10.0.7", + "@libp2p/websockets": "^9.0.6", + "@multiformats/multiaddr": "^12.3.1", "@oceanprotocol/lib": "^3.3.3", "axios": "^1.7.7", "chai": "^4.3.10", @@ -16,9 +30,13 @@ "crypto-js": "^4.2.0", "ethers": "^5.7.2", "fs": "^0.0.1-security", + "ip": "^2.0.1", + "it-pipe": "^3.0.1", + "libp2p": "^2.1.5", "node-polyfill-webpack-plugin": "^4.0.0", "os": "^0.1.2", - "path": "^0.12.7" + "path": "^0.12.7", + "private-ip": "^3.0.2" }, "devDependencies": { "@types/chai": "^5.0.0", @@ -45,12 +63,6 @@ "vscode": "^1.93.0" } }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz", - "integrity": "sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==", - "license": "MIT" - }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -58,6 +70,89 @@ "dev": true, "license": "MIT" }, + "node_modules/@chainsafe/as-chacha20poly1305": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@chainsafe/as-chacha20poly1305/-/as-chacha20poly1305-0.1.0.tgz", + "integrity": "sha512-BpNcL8/lji/GM3+vZ/bgRWqJ1q5kwvTFmGPk7pxm/QQZDbaMI98waOHjEymTjq2JmdD/INdNBFOVSyJofXg7ew==", + "license": "Apache-2.0" + }, + "node_modules/@chainsafe/as-sha256": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.4.2.tgz", + "integrity": "sha512-HJ8GZBRjLeWtRsAXf3EbNsNzmTGpzTFjfpSf4yHkLYC+E52DhT6hwz+7qpj6I/EmFzSUm5tYYvT9K8GZokLQCQ==", + "license": "Apache-2.0" + }, + "node_modules/@chainsafe/is-ip": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@chainsafe/is-ip/-/is-ip-2.0.2.tgz", + "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==", + "license": "MIT" + }, + "node_modules/@chainsafe/libp2p-noise": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-16.0.0.tgz", + "integrity": "sha512-8rqr8V1RD2/lVbfL0Bb//N8iPOFof11cUe8v8z8xJT7fUhCAbtCCSM4jbwI4HCnw0MvHLmcpmAfDCFRwcWzoeA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/as-chacha20poly1305": "^0.1.0", + "@chainsafe/as-sha256": "^0.4.1", + "@libp2p/crypto": "^5.0.0", + "@libp2p/interface": "^2.0.0", + "@libp2p/peer-id": "^5.0.0", + "@noble/ciphers": "^0.6.0", + "@noble/curves": "^1.1.0", + "@noble/hashes": "^1.3.1", + "it-length-prefixed": "^9.0.1", + "it-length-prefixed-stream": "^1.0.0", + "it-pair": "^2.0.6", + "it-pipe": "^3.0.1", + "it-stream-types": "^2.0.1", + "protons-runtime": "^5.5.0", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^5.0.0", + "wherearewe": "^2.0.1" + } + }, + "node_modules/@chainsafe/libp2p-noise/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@chainsafe/libp2p-yamux": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-7.0.1.tgz", + "integrity": "sha512-949MI0Ll0AsYq1gUETZmL/MijwX0jilOQ1i4s8wDEXGiMhuPWWiMsPgEnX6n+VzFmTrfNYyGaaJj5/MqxV9y/g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.0.0", + "@libp2p/utils": "^6.0.0", + "get-iterator": "^2.0.1", + "it-foreach": "^2.0.6", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@chainsafe/netmask": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@chainsafe/netmask/-/netmask-2.0.0.tgz", + "integrity": "sha512-I3Z+6SWUoaljh3TBzCnCxjlUyN8tA+NAk5L6m9IxvCf1BENQTePzPMis97CoN/iMW1St3WN+AWCCRp+TTBRiDg==", + "license": "MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -1137,11 +1232,609 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", + "license": "MIT" + }, + "node_modules/@libp2p/bootstrap": { + "version": "11.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/bootstrap/-/bootstrap-11.0.6.tgz", + "integrity": "sha512-ZoK3F5cci2rLBC5RZiz+hRD0HadWQ6CUsCzPCx40GrxPfd6t45lDeRnEeknrpR1ddVDh+PtSX+S8wYShfIGDfw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/peer-id": "^5.0.4", + "@multiformats/mafmt": "^12.1.6", + "@multiformats/multiaddr": "^12.2.3" + } + }, + "node_modules/@libp2p/circuit-relay-v2": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/circuit-relay-v2/-/circuit-relay-v2-2.1.1.tgz", + "integrity": "sha512-WU4SYIevohUSWrCLfe+g/mwriIdir+T+pSlxXkOyr8ptX14K+cvo2mvmsB15KgTVxXh36sgeHqC/saYuPMi9Dw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/peer-collections": "^6.0.6", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/peer-record": "^8.0.6", + "@libp2p/utils": "^6.0.6", + "@multiformats/mafmt": "^12.1.6", + "@multiformats/multiaddr": "^12.2.3", + "any-signal": "^4.1.1", + "it-protobuf-stream": "^1.1.3", + "it-stream-types": "^2.0.1", + "multiformats": "^13.1.0", + "p-defer": "^4.0.1", + "progress-events": "^1.0.0", + "protons-runtime": "^5.4.0", + "race-signal": "^1.0.2", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/crypto": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-4.1.9.tgz", + "integrity": "sha512-8Cf2VKh0uC/rQLvTLSloIOMqUvf4jsSTHXgjWQRf47lDNJlNNI0wSv2S6gakT72GZsRV/jCjYwKPqRlsa5S0iA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^1.7.0", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/crypto/node_modules/@libp2p/interface": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.7.0.tgz", + "integrity": "sha512-/zFyaIaIGW0aihhsH7/93vQdpWInUzFocxF11RO/029Y6h0SVjs24HHbils+DqaFDTqN+L7oNlBx2rM2MnmTjA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.2.3", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/dcutr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/dcutr/-/dcutr-2.0.6.tgz", + "integrity": "sha512-rplt0iHqSkIiKi5I3TbLXgQD6IOUyRBUxgTnKmuTcKlKqWXN8A0FkZ0+ppzVzFEQfu2aeL7w49iQt+s1yY9MYA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/utils": "^6.0.6", + "@multiformats/multiaddr": "^12.2.3", + "@multiformats/multiaddr-matcher": "^1.2.1", + "delay": "^6.0.0", + "it-protobuf-stream": "^1.1.3", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/identify": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-3.0.6.tgz", + "integrity": "sha512-9SxR8TjQwKEJVYJ9Ld0kjxSdaZE6XgDNj/gmKiPhBJ0N5yn9zmtyvJZ9O0bojhASDblUswDl6GJXwszNTM61qg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/peer-record": "^8.0.6", + "@libp2p/utils": "^6.0.6", + "@multiformats/multiaddr": "^12.2.3", + "@multiformats/multiaddr-matcher": "^1.2.1", + "it-drain": "^3.0.7", + "it-parallel": "^3.0.7", + "it-protobuf-stream": "^1.1.3", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0", + "wherearewe": "^2.0.1" + } + }, + "node_modules/@libp2p/identify/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/interface": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.1.2.tgz", + "integrity": "sha512-uD4NapC+1qGX7RmgC1aehQm3pMs1MpO1DwuhUlAo1M6CyNxfs1Ha9jhg2T+G4u4CAJM6wffZTyPGnKnrR+M8Fw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.2.3", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/interface-internal": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.0.6.tgz", + "integrity": "sha512-tfhDZr1Y8Wd4kV8hwqvOn5VW3PfR1OOsvLLiQ4k1HwpfIJEPxFwXKrs0S+gBwXRxcfXH7bfBOPYQmLKNYOEjlA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/peer-collections": "^6.0.6", + "@multiformats/multiaddr": "^12.2.3", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/kad-dht": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/@libp2p/kad-dht/-/kad-dht-13.1.2.tgz", + "integrity": "sha512-9p3SIa1Ab8s2xkEnFZ0m/Cdl0Npqfn+QdfU/jRPrYGEQz6K+qX1e1W4Yx5zGbFvBw9tDLFUSJJ4c/qcbzVnrxg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/peer-collections": "^6.0.6", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/record": "^4.0.4", + "@libp2p/utils": "^6.0.6", + "@multiformats/multiaddr": "^12.2.3", + "any-signal": "^4.1.1", + "hashlru": "^2.3.0", + "interface-datastore": "^8.3.0", + "it-drain": "^3.0.7", + "it-length": "^3.0.6", + "it-length-prefixed": "^9.0.4", + "it-map": "^3.1.0", + "it-merge": "^3.0.5", + "it-parallel": "^3.0.7", + "it-pipe": "^3.0.1", + "it-protobuf-stream": "^1.1.3", + "it-take": "^3.0.5", + "multiformats": "^13.1.0", + "p-defer": "^4.0.1", + "p-event": "^6.0.1", + "p-queue": "^8.0.1", + "progress-events": "^1.0.0", + "protons-runtime": "^5.4.0", + "race-signal": "^1.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/kad-dht/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/logger": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.0.tgz", + "integrity": "sha512-hmkk1TONYRe+kKs5QTxkayIfj9qicp8hcrJ1Ac9QfTW/jdaUlnqd1uop4QcOD5GV6qNMq+v1qaMFWFYSN9RcPA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@multiformats/multiaddr": "^12.2.3", + "interface-datastore": "^8.3.0", + "multiformats": "^13.1.0", + "weald": "^1.0.2" + } + }, + "node_modules/@libp2p/mdns": { + "version": "11.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/mdns/-/mdns-11.0.6.tgz", + "integrity": "sha512-ExlnA+uV5sOJMYtwZginBN+WVvVK6DUYID2Hn/p88QoKnGWaYob7zHHrhf6NQEa3Y+qx6bQZQdh9YWDpjvv6DA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/utils": "^6.0.6", + "@multiformats/multiaddr": "^12.2.3", + "@types/multicast-dns": "^7.2.4", + "dns-packet": "^5.6.1", + "multicast-dns": "^7.2.5" + } + }, + "node_modules/@libp2p/multistream-select": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-6.0.5.tgz", + "integrity": "sha512-iOMHcF/NzeShmnRLf9KI39bgfxptklbf6Tv9NvBbICfYO/IJB6KDI6bOif5eXXqUqZjHrQJ3jrRppOEwk2HV4g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "it-length-prefixed": "^9.0.4", + "it-length-prefixed-stream": "^1.1.7", + "it-stream-types": "^2.0.1", + "p-defer": "^4.0.1", + "race-signal": "^1.0.2", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-collections": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.6.tgz", + "integrity": "sha512-kBrLKX/6kaVqm/W5Q9SP/XRTCb5qzN+J7XM9iZJIIHu4kJ4KvR3HRoTDtkvOeh9yqe4SBA0/2mOBwf1y2AjUTA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/utils": "^6.0.6", + "multiformats": "^13.2.2" + } + }, + "node_modules/@libp2p/peer-id": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.4.tgz", + "integrity": "sha512-CHNbQ4Odlc+YDTtv6BzWdGSaJ1I3Wb6iHNV7YB59v0ivSsd0NzlR31qWpK/ByUAMT+hfzQzR1dK9s3e7zS4/zQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "multiformats": "^13.1.0", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-id-factory": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-4.2.4.tgz", + "integrity": "sha512-NDQ/qIWpcAG/6xQjyut6xCkrYYAoCaI/33Z+7yzo5qFODwLfNonLzSTasnA6jhuvHn33aHnD1qhdpFkmstxtNQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^4.1.9", + "@libp2p/interface": "^1.7.0", + "@libp2p/peer-id": "^4.2.4", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/interface": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.7.0.tgz", + "integrity": "sha512-/zFyaIaIGW0aihhsH7/93vQdpWInUzFocxF11RO/029Y6h0SVjs24HHbils+DqaFDTqN+L7oNlBx2rM2MnmTjA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.2.3", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "multiformats": "^13.1.0", + "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.2.4.tgz", + "integrity": "sha512-mvvsVxt4HkF14BrTNKbqr14VObW+KBJBWu1Oe6BFCoDttGMQLaI+PdduE1r6Tquntv5IONBqoITgD7ow5dQ+vQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^1.7.0", + "multiformats": "^13.1.0", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-id/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-record": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-8.0.6.tgz", + "integrity": "sha512-KHCExg/1VWncwtuwOroyPAiA9EAJHuahGGykDvgOdbPn8Gpw/45yPjbSR66M6sdQvsHT3r58V2OL0qZKkMI3eQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/utils": "^6.0.6", + "@multiformats/multiaddr": "^12.2.3", + "multiformats": "^13.2.2", + "protons-runtime": "^5.4.0", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-store": { + "version": "11.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-11.0.6.tgz", + "integrity": "sha512-OmaPWfBvrY/5Kv8KZqyeAxPhVCuKb3lRYLVmOMjrVbLKBB4G+lHbdQdHBHKmwBPVl/3PkJOx25usMn8cqvfI6w==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/peer-collections": "^6.0.6", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/peer-record": "^8.0.6", + "@multiformats/multiaddr": "^12.2.3", + "interface-datastore": "^8.3.0", + "it-all": "^3.0.6", + "mortice": "^3.0.4", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/peer-store/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/ping": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/ping/-/ping-2.0.6.tgz", + "integrity": "sha512-+OIQ95gRrAxjEA4pPJZV4Tt+lIJoS42RuDSWJAco9jc+OMKmgowXOcBE/rCqeczccElDBVmhN2kvR4NwV+x9wQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@multiformats/multiaddr": "^12.2.3", + "it-byte-stream": "^1.1.0", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/ping/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/record": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/record/-/record-4.0.4.tgz", + "integrity": "sha512-wEEeHXGNIcc8HtGbgGMuSHbboUWMxKG7OxALFwkE+KACgfRJZTESOp6XIdZnyC0r9lfEFsjF01pFKBTzoBmWEQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/tcp": { + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-10.0.7.tgz", + "integrity": "sha512-4Z1MnFSRdUPz1swlrodaEupNKCtx2G6mZ2hVymY3ndSd6YVYGojMCuYecIBNzzq6x9o/OM3DKioVjXmDIigo4Q==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/utils": "^6.0.6", + "@multiformats/mafmt": "^12.1.6", + "@multiformats/multiaddr": "^12.2.3", + "@types/sinon": "^17.0.3", + "p-defer": "^4.0.1", + "progress-events": "^1.0.0", + "race-event": "^1.3.0", + "stream-to-it": "^1.0.1" + } + }, + "node_modules/@libp2p/utils": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.0.6.tgz", + "integrity": "sha512-OGUdK0LCYIeTAc/a80Mmq4c0hsR6oegfW768hYwPZ4RDrBT2WRIyIM8B6qI9KR2n9fg+F+iAbltrjhgOlDoc7g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/logger": "^5.1.0", + "@multiformats/multiaddr": "^12.2.3", + "@sindresorhus/fnv1a": "^3.1.0", + "@types/murmurhash3js-revisited": "^3.0.3", + "any-signal": "^4.1.1", + "delay": "^6.0.0", + "get-iterator": "^2.0.1", + "is-loopback-addr": "^2.0.2", + "it-foreach": "^2.1.1", + "it-pipe": "^3.0.1", + "it-pushable": "^3.2.3", + "it-stream-types": "^2.0.1", + "murmurhash3js-revisited": "^3.0.0", + "netmask": "^2.0.2", + "p-defer": "^4.0.1", + "race-event": "^1.3.0", + "race-signal": "^1.0.2", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/utils/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/websockets": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-9.0.6.tgz", + "integrity": "sha512-w5gRe0lL+qSxKaoyoXm5dzatgv2o9mmzsKPtlW2N6pi/DMVenJoUpDCvHlYHpp4qJAgMgJHDWXHmH0O3d3beiQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@libp2p/utils": "^6.0.6", + "@multiformats/mafmt": "^12.1.6", + "@multiformats/multiaddr": "^12.2.3", + "@multiformats/multiaddr-to-uri": "^10.0.1", + "@types/ws": "^8.5.10", + "it-ws": "^6.1.1", + "p-defer": "^4.0.1", + "progress-events": "^1.0.0", + "race-signal": "^1.0.2", + "wherearewe": "^2.0.1", + "ws": "^8.17.0" + } + }, + "node_modules/@multiformats/dns": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@multiformats/dns/-/dns-1.0.6.tgz", + "integrity": "sha512-nt/5UqjMPtyvkG9BQYdJ4GfLK3nMqGpFZOzf4hAmIa0sJh2LlS9YKXZ4FgwBDsaHvzZqR/rUFIywIc7pkHNNuw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@types/dns-packet": "^5.6.5", + "buffer": "^6.0.3", + "dns-packet": "^5.6.1", + "hashlru": "^2.3.0", + "p-queue": "^8.0.1", + "progress-events": "^1.0.0", + "uint8arrays": "^5.0.2" + } + }, + "node_modules/@multiformats/mafmt": { + "version": "12.1.6", + "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", + "integrity": "sha512-tlJRfL21X+AKn9b5i5VnaTD6bNttpSpcqwKVmDmSHLwxoz97fAHaepqFOk/l1fIu94nImIXneNbhsJx/RQNIww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.0.0" + } + }, + "node_modules/@multiformats/multiaddr": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.3.1.tgz", + "integrity": "sha512-yoGODQY4nIj41ENJClucS8FtBoe8w682bzbKldEQr9lSlfdHqAsRC+vpJAOBpiMwPps1tHua4kxrDmvprdhoDQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "@chainsafe/netmask": "^2.0.0", + "@multiformats/dns": "^1.0.3", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@multiformats/multiaddr-matcher": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.2.6.tgz", + "integrity": "sha512-lqD3BqVs0ee1YUMY6am2HTJq6TYf3sQaVK8s+0Ns7FbbOsFv5j76cBkP3BSET6vIO+SGx6/K6Ns8zQI5ofiQUA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "@multiformats/multiaddr": "^12.0.0", + "multiformats": "^13.0.0" + } + }, + "node_modules/@multiformats/multiaddr-to-uri": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-10.1.0.tgz", + "integrity": "sha512-ZNwSAx3ssBWwd4y0LKrOsq9xG7LBHboQxnUdSduNc2fTh/NS1UjA2slgUy6KHxH5k9S2DSus0iU2CoyJyN0/pg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^12.3.0" + } + }, + "node_modules/@noble/ciphers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.6.0.tgz", + "integrity": "sha512-mIbq/R9QXk5/cTfESb1OKtyFnk7oc1Om/8onA1158K9/OZUQFDEVy55jVTato+xmp3XX6F6Qh0zz0Nc1AxAlRQ==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@noble/curves": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "peer": true, "dependencies": { "@noble/hashes": "1.4.0" }, @@ -1153,7 +1846,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "peer": true, "engines": { "node": ">= 16" }, @@ -1199,125 +1891,17 @@ "node": ">= 8" } }, - "node_modules/@oasisprotocol/deoxysii": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@oasisprotocol/deoxysii/-/deoxysii-0.0.5.tgz", - "integrity": "sha512-a6wYPjk8ALDIiQW/971AKOTSTY1qSdld+Y05F44gVZvlb3FOyHfgbIxXm7CZnUG1A+jK49g5SCWYP+V3/Tc75Q==", - "license": "MIT", - "dependencies": { - "bsaes": "0.0.2", - "uint32": "^0.2.1" - } - }, - "node_modules/@oasisprotocol/sapphire-paratime": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@oasisprotocol/sapphire-paratime/-/sapphire-paratime-1.3.2.tgz", - "integrity": "sha512-98EQ2BrT0942B0VY50PKcJ6xmUAcz71y8OBMizP6oBJIh0+ogw/z3r5z4veJitMXM4zQbh5wOFaS9eOcKWX5FA==", - "license": "Apache-2.0", - "dependencies": { - "@noble/hashes": "1.3.2", - "@oasisprotocol/deoxysii": "0.0.5", - "cborg": "1.10.2", - "ethers": "6.10.0", - "tweetnacl": "1.0.3", - "type-fest": "2.19.0" - } - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "license": "MIT", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "license": "MIT", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/@types/node": { - "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", - "license": "MIT" - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/ethers": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.10.0.tgz", - "integrity": "sha512-nMNwYHzs6V1FR3Y4cdfxSQmNgZsRj1RiTU25JwvnJLmyzw9z3SKxNc2XKDuiXXo/v9ds5Mp9m6HBabgYQQ26tA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@adraffy/ens-normalize": "1.10.0", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "18.15.13", - "aes-js": "4.0.0-beta.5", - "tslib": "2.4.0", - "ws": "8.5.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "license": "0BSD" - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "license": "Unlicense" - }, - "node_modules/@oasisprotocol/sapphire-paratime/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@oceanprotocol/contracts": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-2.2.0.tgz", "integrity": "sha512-QhewXdtTebycRSZEdkAdvJkSMMnGZyxldlw2eX4VOJto8wymyNdxuhjL/tiaZ5xO7SS5BqURricx9170hfh2kQ==" }, "node_modules/@oceanprotocol/lib": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-3.4.2.tgz", - "integrity": "sha512-Xr/0coXw2eymjivozSwrffukPthCjOLJPbXhUtpv048ZslDdv/OaiEh5iciyx5rZBInh2cHVOaRb8Q0Lj69krQ==", - "license": "Apache-2.0", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-3.3.3.tgz", + "integrity": "sha512-d98X3tBsfbtUJe90wmXI2HcabE3jyY+5628md6vpuItBCnSZgHIQaFvvND2jRThNEmr+4axavylNk/BS3muA5g==", "dependencies": { - "@oasisprotocol/sapphire-paratime": "^1.3.2", - "@oceanprotocol/contracts": "^2.2.0", + "@oceanprotocol/contracts": "^2.0.3", "cross-fetch": "^4.0.0", "crypto-js": "^4.1.1", "decimal.js": "^10.4.1", @@ -1386,6 +1970,18 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@sindresorhus/fnv1a": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/fnv1a/-/fnv1a-3.1.0.tgz", + "integrity": "sha512-KV321z5m/0nuAg83W1dPLy85HpHDk7Sdi4fJbwvacWsEhAh+rZUW4ZfGcXmUIvjZg4ss2bcwNlRhJ7GBEUG08w==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -1466,6 +2062,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/dns-packet": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/@types/dns-packet/-/dns-packet-5.6.5.tgz", + "integrity": "sha512-qXOC7XLOEe43ehtWJCMnQXvgcIpv6rPmQ1jXT98Ad8A3TB1Ue50jsCbSSSyuazScEuZ/Q026vHbrOTVkmwA+7Q==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -1507,6 +2112,22 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/multicast-dns": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/multicast-dns/-/multicast-dns-7.2.4.tgz", + "integrity": "sha512-ib5K4cIDR4Ro5SR3Sx/LROkMDa0BHz0OPaCBL/OSPDsAXEGZ3/KQeS6poBKYVN7BfjXDL9lWNwzyHVgt/wkyCw==", + "license": "MIT", + "dependencies": { + "@types/dns-packet": "*", + "@types/node": "*" + } + }, + "node_modules/@types/murmurhash3js-revisited": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.3.tgz", + "integrity": "sha512-QvlqvYtGBYIDeO8dFdY4djkRubcrc+yTJtBc7n8VZPlJDUS/00A+PssbvERM8f9bYRmcaSEHPZgZojeQj7kzAA==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.16.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", @@ -1534,6 +2155,12 @@ "@types/node": "*" } }, + "node_modules/@types/retry": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", + "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==", + "license": "MIT" + }, "node_modules/@types/secp256k1": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", @@ -1543,6 +2170,21 @@ "@types/node": "*" } }, + "node_modules/@types/sinon": { + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", + "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==", + "license": "MIT", + "dependencies": { + "@types/sinonjs__fake-timers": "*" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", + "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", + "license": "MIT" + }, "node_modules/@types/vscode": { "version": "1.93.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.93.0.tgz", @@ -1550,6 +2192,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/ws": { + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.6.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.6.0.tgz", @@ -2061,12 +2712,6 @@ "node": ">=0.4.0" } }, - "node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", - "license": "MIT" - }, "node_modules/agent-base": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", @@ -2141,6 +2786,16 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-signal": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", + "integrity": "sha512-iADenERppdC+A2YKbOXXB2WUeABLaM6qnpZ70kZbPZ1cZMMJ7eF+3CaYm+/PhBizgkzlvssC7QuHS30oOiQYWA==", + "license": "Apache-2.0 OR MIT", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -2201,6 +2856,20 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "license": "MIT" }, + "node_modules/asn1js": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.5.tgz", + "integrity": "sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==", + "license": "BSD-3-Clause", + "dependencies": { + "pvtsutils": "^1.3.2", + "pvutils": "^1.1.3", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/assert": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", @@ -2694,15 +3363,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/bsaes": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/bsaes/-/bsaes-0.0.2.tgz", - "integrity": "sha512-iVxJFMOvCUG85sX2UVpZ9IgvH6Jjc5xpd/W8pALvFE7zfCqHkV7hW3M2XZtpg9biPS0K4Eka96bbNNgLohcpgQ==", - "license": "MIT", - "dependencies": { - "uint32": "^0.2.1" - } - }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -2916,15 +3576,6 @@ "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "peer": true }, - "node_modules/cborg": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/cborg/-/cborg-1.10.2.tgz", - "integrity": "sha512-b3tFPA9pUr2zCUiCfRd2+wok2/LBSNUMKOuRRok+WlvvAgEt/PlbgPTsZUcwCOs53IJvLgTp0eotwtosE6njug==", - "license": "Apache-2.0", - "bin": { - "cborg": "cli.js" - } - }, "node_modules/chai": { "version": "4.3.10", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", @@ -3503,6 +4154,25 @@ "node": ">=0.10" } }, + "node_modules/datastore-core": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-10.0.2.tgz", + "integrity": "sha512-B3WXxI54VxJkpXxnYibiF17si3bLXE1XOjrJB7wM5co9fx2KOEkiePDGiCCEtnapFHTnmAnYCPdA7WZTIpdn/A==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/logger": "^5.0.1", + "interface-datastore": "^8.0.0", + "interface-store": "^6.0.0", + "it-drain": "^3.0.7", + "it-filter": "^3.1.1", + "it-map": "^3.1.1", + "it-merge": "^3.0.5", + "it-pipe": "^3.0.1", + "it-pushable": "^3.2.3", + "it-sort": "^3.0.6", + "it-take": "^3.0.6" + } + }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -3636,6 +4306,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delay": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", + "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -3700,6 +4382,18 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "license": "MIT" }, + "node_modules/dns-packet": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", + "license": "MIT", + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/dom-walk": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", @@ -4395,6 +5089,12 @@ "es5-ext": "~0.10.14" } }, + "node_modules/event-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/event-iterator/-/event-iterator-2.0.0.tgz", + "integrity": "sha512-KGft0ldl31BZVV//jj+IAIGCxkvvUkkON+ScH6zfoX+l+omX6001ggyRSpI0Io2Hlro0ThXotswCtfzS8UkIiQ==", + "license": "MIT" + }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", @@ -4833,21 +5533,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -4894,6 +5579,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-2.0.1.tgz", + "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==", + "license": "MIT" + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -5162,7 +5853,13 @@ "minimalistic-assert": "^1.0.1" } }, - "node_modules/hasown": { + "node_modules/hashlru": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.3.0.tgz", + "integrity": "sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A==", + "license": "MIT" + }, + "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", @@ -5426,6 +6123,22 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, + "node_modules/interface-datastore": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.3.1.tgz", + "integrity": "sha512-3r0ETmHIi6HmvM5sc09QQiCD3gUfwtEM/AAChOyAd/UAKT69uk8LXfTSUBufbUIO/dU65Vj8nb9O6QjwW8vDSQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "interface-store": "^6.0.0", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/interface-store": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-6.0.2.tgz", + "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/interpret": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", @@ -5436,6 +6149,24 @@ "node": ">=10.13.0" } }, + "node_modules/ip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", + "license": "MIT" + }, + "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==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -5500,6 +6231,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-electron": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", + "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==", + "license": "MIT" + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -5576,6 +6313,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-loopback-addr": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-2.0.2.tgz", + "integrity": "sha512-26POf2KRCno/KTNL5Q0b/9TYnL00xEsSaLfiFRmjM7m7Lw7ZMmFybzzuX4CcsLAluZGd+niLUiMRxEooVE3aqg==", + "license": "MIT" + }, "node_modules/is-nan": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", @@ -5592,6 +6335,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-network-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", + "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -5616,7 +6371,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5749,6 +6503,226 @@ "node": ">=8" } }, + "node_modules/it-all": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-3.0.6.tgz", + "integrity": "sha512-HXZWbxCgQZJfrv5rXvaVeaayXED8nTKx9tj9fpBhmcUJcedVZshMMMqTj0RG2+scGypb9Ut1zd1ifbf3lA8L+Q==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-byte-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.1.0.tgz", + "integrity": "sha512-WWponBWdKEa6o2U3NX+wGMY8X1EkWXcQvpC+3CUqKb4ZzK30q3EPqiTjFxLf9tNVgdF/MNAtx/XclpVfgaz9KQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-queueless-pushable": "^1.0.0", + "it-stream-types": "^2.0.1", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-drain": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-3.0.7.tgz", + "integrity": "sha512-vy6S1JKjjHSIFHgBpLpD1zhkCRl3z1zYWUxE14+kAYf+BL9ssWSFImJfhl361IIcwr0ofw8etzg11VqqB+ntUA==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-filter": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/it-filter/-/it-filter-3.1.1.tgz", + "integrity": "sha512-TOXmVuaSkxlLp2hXKoMTra0WMZMKVFxE3vSsbIA+PbADNCBAHhjJ/lM31vBOUTddHMO34Ku++vU8T9PLlBxQtg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-foreach": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-2.1.1.tgz", + "integrity": "sha512-ID4Gxnavk/LVQLQESAQ9hR6dR63Ih6X+8VdxEktX8rpz2dCGAbZpey/eljTNbMfV2UKXHiu6UsneoNBZuac97g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-length": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-length/-/it-length-3.0.6.tgz", + "integrity": "sha512-R7bxHAzpRzYz7vghc2DDH7x4KXvEkeLfN/h316++jzbkEHIRXbEPLbE20p5yrqqBdOeK6/FRUDuHlTJ0H1hysw==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-length-prefixed": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.1.0.tgz", + "integrity": "sha512-kx2UTJuy7/lsT3QUzf50NjfxU1Z4P4wlvYp6YnR5Nc61P8XKfy+QtiJi1VLojA+Kea7vMbB4002rIij1Ol9hcw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-reader": "^6.0.1", + "it-stream-types": "^2.0.1", + "uint8-varint": "^2.0.1", + "uint8arraylist": "^2.0.0", + "uint8arrays": "^5.0.1" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-length-prefixed-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.2.0.tgz", + "integrity": "sha512-vX7dzSl/2UMYYsAr0FQdPNVR5xYEETaeboZ+eXxNBjgARuvxnWA6OedW8lC5/J3ebMTC98JhA3eH76eTijUOsA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-byte-stream": "^1.0.0", + "it-stream-types": "^2.0.1", + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-map": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/it-map/-/it-map-3.1.1.tgz", + "integrity": "sha512-9bCSwKD1yN1wCOgJ9UOl+46NQtdatosPWzxxUk2NdTLwRPXLh+L7iwCC9QKsbgM60RQxT/nH8bKMqm3H/o8IHQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-peekable": "^3.0.0" + } + }, + "node_modules/it-merge": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/it-merge/-/it-merge-3.0.5.tgz", + "integrity": "sha512-2l7+mPf85pyRF5pqi0dKcA54E5Jm/2FyY5GsOaN51Ta0ipC7YZ3szuAsH8wOoB6eKY4XsU4k2X+mzPmFBMayEA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-pushable": "^3.2.3" + } + }, + "node_modules/it-pair": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/it-pair/-/it-pair-2.0.6.tgz", + "integrity": "sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-stream-types": "^2.0.1", + "p-defer": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-parallel": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/it-parallel/-/it-parallel-3.0.8.tgz", + "integrity": "sha512-URLhs6eG4Hdr4OdvgBBPDzOjBeSSmI+Kqex2rv/aAyYClME26RYHirLVhZsZP5M+ZP6M34iRlXk8Wlqtezuqpg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "p-defer": "^4.0.1" + } + }, + "node_modules/it-peekable": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/it-peekable/-/it-peekable-3.0.5.tgz", + "integrity": "sha512-JWQOGMt6rKiPcY30zUVMR4g6YxkpueTwHVE7CMs/aGqCf4OydM6w+7ZM3PvmO1e0TocjuR4aL8xyZWR46cTqCQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-pipe": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz", + "integrity": "sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-merge": "^3.0.0", + "it-pushable": "^3.1.2", + "it-stream-types": "^2.0.1" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-protobuf-stream": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/it-protobuf-stream/-/it-protobuf-stream-1.1.5.tgz", + "integrity": "sha512-H70idW45As3cEbU4uSoZ9IYHUIV3YM69/2mmXYR7gOlPabWjuyNi3/abK11geiiq3la27Sos/mXr68JljjKtEQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-length-prefixed-stream": "^1.0.0", + "it-stream-types": "^2.0.1", + "uint8arraylist": "^2.4.8" + } + }, + "node_modules/it-pushable": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-3.2.3.tgz", + "integrity": "sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "p-defer": "^4.0.0" + } + }, + "node_modules/it-queueless-pushable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/it-queueless-pushable/-/it-queueless-pushable-1.0.0.tgz", + "integrity": "sha512-HbcAbcuQj7a9EBxiRCZ+77FxWutgs/pY5ZvEyQnylWPGNFojCLAUwhcZjf5OuEQ9+y+vSa7w1GQBe8xJdmIn5A==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "p-defer": "^4.0.1", + "race-signal": "^1.0.2" + } + }, + "node_modules/it-reader": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz", + "integrity": "sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-stream-types": "^2.0.1", + "uint8arraylist": "^2.0.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/it-sort": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-sort/-/it-sort-3.0.6.tgz", + "integrity": "sha512-aNrlZAXB8vWBd42tCpaXGL6CJVJNDW3OLczmdt6g0k/s9Z6evkTdgU2LjwW5SNNeX41sF+C8MjV+OcVf93PsPw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-all": "^3.0.0" + } + }, + "node_modules/it-stream-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/it-stream-types/-/it-stream-types-2.0.2.tgz", + "integrity": "sha512-Rz/DEZ6Byn/r9+/SBCuJhpPATDF9D+dz5pbgSUyBsCDtza6wtNATrz/jz1gDyNanC3XdLboriHnOC925bZRBww==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-take": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/it-take/-/it-take-3.0.6.tgz", + "integrity": "sha512-uqw3MRzf9to1SOLxaureGa73lK8k8ZB/asOApTAkvrzUqCznGtKNgPFH7uYIWlt4UuWq/hU6I+U4Fm5xpjN8Vg==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/it-ws": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-6.1.5.tgz", + "integrity": "sha512-uWjMtpy5HqhSd/LlrlP3fhYrr7rUfJFFMABv0F5d6n13Q+0glhZthwUKpEAVhDrXY95Tb1RB5lLqqef+QbVNaw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@types/ws": "^8.2.2", + "event-iterator": "^2.0.0", + "it-stream-types": "^2.0.1", + "uint8arrays": "^5.0.0", + "ws": "^8.4.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -5954,6 +6928,56 @@ "node": ">= 0.8.0" } }, + "node_modules/libp2p": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-2.1.5.tgz", + "integrity": "sha512-rIa6jbNA/SiIG9ybwFGXUeKiz6JWjj3wxJYCN3GalJQaMK3MQT/nGymgSkQq+CT+YFNsureXmJbxXTtPIVNxOA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.0.4", + "@libp2p/interface": "^2.1.2", + "@libp2p/interface-internal": "^2.0.6", + "@libp2p/logger": "^5.1.0", + "@libp2p/multistream-select": "^6.0.5", + "@libp2p/peer-collections": "^6.0.6", + "@libp2p/peer-id": "^5.0.4", + "@libp2p/peer-store": "^11.0.6", + "@libp2p/utils": "^6.0.6", + "@multiformats/dns": "^1.0.6", + "@multiformats/multiaddr": "^12.2.3", + "@multiformats/multiaddr-matcher": "^1.2.1", + "any-signal": "^4.1.1", + "datastore-core": "^10.0.0", + "interface-datastore": "^8.3.0", + "it-byte-stream": "^1.0.12", + "it-merge": "^3.0.5", + "it-parallel": "^3.0.7", + "merge-options": "^3.0.4", + "multiformats": "^13.1.0", + "p-defer": "^4.0.1", + "p-retry": "^6.2.0", + "progress-events": "^1.0.0", + "race-event": "^1.3.0", + "race-signal": "^1.0.2", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/libp2p/node_modules/@libp2p/crypto": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.4.tgz", + "integrity": "sha512-v5xsngOlDu8JP3GQDvK+2YYzTELl7/aPfXPbIzKEcy7ON2hu79t1BZMuavjPsr+WWIPNg5yKst6IJfRilzwXRQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/interface": "^2.1.2", + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0", + "asn1js": "^3.0.5", + "multiformats": "^13.1.0", + "protons-runtime": "^5.4.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, "node_modules/lie": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", @@ -6092,6 +7116,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/merge-options": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "license": "MIT", + "dependencies": { + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -6482,6 +7518,17 @@ "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==", "peer": true }, + "node_modules/mortice": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.4.tgz", + "integrity": "sha512-MUHRCAztSl4v/dAmK8vbYi5u1n9NZtQu4H3FsqS7qgMFQIAFw9lTpHiErd9kJpapqmvEdD1L3dUmiikifAvLsQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "observable-webworkers": "^2.0.1", + "p-queue": "^8.0.1", + "p-timeout": "^6.0.0" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6523,6 +7570,19 @@ "ieee754": "^1.1.13" } }, + "node_modules/multicast-dns": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", + "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", + "license": "MIT", + "dependencies": { + "dns-packet": "^5.2.2", + "thunky": "^1.0.2" + }, + "bin": { + "multicast-dns": "cli.js" + } + }, "node_modules/multicodec": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", @@ -6533,6 +7593,12 @@ "varint": "^5.0.0" } }, + "node_modules/multiformats": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.0.tgz", + "integrity": "sha512-CBiqvsufgmpo01VT5ze94O+uc+Pbf6f/sThlvWss0sBZmAOu6GQn5usrYV2sf2mr17FWYc0rO8c/CNe2T90QAA==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/multihashes": { "version": "0.4.21", "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", @@ -6579,6 +7645,15 @@ "buffer": "^5.5.0" } }, + "node_modules/murmurhash3js-revisited": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", + "integrity": "sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/nano-json-stream-parser": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", @@ -6607,6 +7682,15 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "license": "MIT" }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/next-tick": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", @@ -6861,6 +7945,16 @@ "http-https": "^1.0.0" } }, + "node_modules/observable-webworkers": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/observable-webworkers/-/observable-webworkers-2.0.1.tgz", + "integrity": "sha512-JI1vB0u3pZjoQKOK1ROWzp0ygxSi7Yb0iR+7UNsw4/Zn4cQ0P3R7XL38zac/Dy2tEA7Lg88/wIJTjF8vYXZ0uw==", + "license": "Apache-2.0 OR MIT", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -7058,6 +8152,33 @@ "node": ">=12.20" } }, + "node_modules/p-defer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-4.0.1.tgz", + "integrity": "sha512-Mr5KC5efvAK5VUptYEIopP1bakB85k2IWXaRC0rsh1uwn1L6M0LVml8OIQ4Gudg4oyZakf7FmeRLkMMtZW1i5A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-event": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-6.0.1.tgz", + "integrity": "sha512-Q6Bekk5wpzW5qIyUP4gdMEujObYstZl6DMMOSenwBvV0BlE5LkDwkjs5yHbZmdCEq2o4RJx4tE1vwxFVf2FG1w==", + "license": "MIT", + "dependencies": { + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -7090,6 +8211,57 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/p-retry": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz", + "integrity": "sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA==", + "license": "MIT", + "dependencies": { + "@types/retry": "0.12.2", + "is-network-error": "^1.0.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -7445,6 +8617,30 @@ "node": ">=6.0.0" } }, + "node_modules/private-ip": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/private-ip/-/private-ip-3.0.2.tgz", + "integrity": "sha512-2pkOVPGYD/4QyAg95c6E/4bLYXPthT5Xw4ocXYzIIsMBhskOMn6IwkWXmg6ZiA6K58+O6VD/n02r1hDhk7vDPw==", + "license": "MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "ip-regex": "^5.0.0", + "ipaddr.js": "^2.1.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/private-ip/node_modules/ipaddr.js": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", + "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -7459,6 +8655,23 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "license": "MIT" }, + "node_modules/progress-events": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/progress-events/-/progress-events-1.0.1.tgz", + "integrity": "sha512-MOzLIwhpt64KIVN64h1MwdKWiyKFNc/S6BoYKPIVUHFg0/eIEyBulhWCgn678v/4c0ri3FdGuzXymNCv02MUIw==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/protons-runtime": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.5.0.tgz", + "integrity": "sha512-EsALjF9QsrEk6gbCx3lmfHxVN0ah7nG3cY7GySD4xf4g8cr7g543zB88Foh897Sr1RQJ9yDCUsoT1i1H/cVUFA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8-varint": "^2.0.2", + "uint8arraylist": "^2.4.3", + "uint8arrays": "^5.0.1" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -7523,6 +8736,24 @@ "node": ">=6" } }, + "node_modules/pvtsutils": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz", + "integrity": "sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.6.1" + } + }, + "node_modules/pvutils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.3.tgz", + "integrity": "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -7592,6 +8823,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/race-event": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/race-event/-/race-event-1.3.0.tgz", + "integrity": "sha512-kaLm7axfOnahIqD3jQ4l1e471FIFcEGebXEnhxyLscuUzV8C94xVHtWEqDDXxll7+yu/6lW0w1Ff4HbtvHvOHg==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/race-signal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/race-signal/-/race-signal-1.1.0.tgz", + "integrity": "sha512-VqsW1uzCXfKBd2DhA3K3NhQlqQr04+5WQ7+kHpf1HzT01Q+ePSFWZdQHXKZPuLmm2eXTZM1XLO76cq15ZRAaEA==", + "license": "Apache-2.0 OR MIT" + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -7829,6 +9072,15 @@ "dev": true, "license": "ISC" }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -8314,6 +9566,15 @@ "node": ">= 6" } }, + "node_modules/stream-to-it": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-1.0.1.tgz", + "integrity": "sha512-AqHYAYPHcmvMrcLNgncE/q0Aj/ajP6A4qGhxP6EVn7K3YTNs0bJpJyk57wc2Heb7MUL64jurvmnmui8D9kjZgA==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "it-stream-types": "^2.0.1" + } + }, "node_modules/strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -8459,7 +9720,6 @@ "version": "9.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -8806,6 +10066,12 @@ "dev": true, "license": "MIT" }, + "node_modules/thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "license": "MIT" + }, "node_modules/timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -8958,8 +10224,7 @@ "node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" }, "node_modules/tty-browserify": { "version": "0.0.1", @@ -9060,11 +10325,33 @@ "node": ">=14.17" } }, - "node_modules/uint32": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/uint32/-/uint32-0.2.1.tgz", - "integrity": "sha512-d3i8kc/4s1CFW5g3FctmF1Bu2GVXGBMTn82JY2BW0ZtTtI8pRx1YWGPCFBwRF4uYVSJ7ua4y+qYEPqS+x+3w7Q==", - "license": "Do, what You want" + "node_modules/uint8-varint": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.4.tgz", + "integrity": "sha512-FwpTa7ZGA/f/EssWAb5/YV6pHgVF1fViKdW8cWaEarjB8t7NyofSWBdOTyFPaGuUG4gx3v1O3PQ8etsiOs3lcw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8arraylist": "^2.0.0", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/uint8arraylist": { + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.8.tgz", + "integrity": "sha512-vc1PlGOzglLF0eae1M8mLRTBivsvrGsdmJ5RbK3e+QRvRLOZfZhQROTwH/OfyF3+ZVUg9/8hE8bmKP2CvP9quQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8arrays": "^5.0.1" + } + }, + "node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } }, "node_modules/ultron": { "version": "1.1.1", @@ -9292,6 +10579,25 @@ "node": ">=10.13.0" } }, + "node_modules/weald": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/weald/-/weald-1.0.3.tgz", + "integrity": "sha512-h5pTSGRApQotfZ8Goqe5Jrg6iOjx4uXB55I00A+WRMZbhbiWfUatr6fMLt6UNrURzqXaX/ZDhIvcDzs1TEzz4Q==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "ms": "^3.0.0-canary.1", + "supports-color": "^9.4.0" + } + }, + "node_modules/weald/node_modules/ms": { + "version": "3.0.0-canary.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-3.0.0-canary.1.tgz", + "integrity": "sha512-kh8ARjh8rMN7Du2igDRO9QJnqCb2xYTJxyQYK7vJJS4TvLLmsbyhiKpSW+t+y26gyOyMd0riphX0GeWKU3ky5g==", + "license": "MIT", + "engines": { + "node": ">=12.13" + } + }, "node_modules/web3": { "version": "1.10.4", "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.4.tgz", @@ -9872,6 +11178,19 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/wherearewe": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wherearewe/-/wherearewe-2.0.1.tgz", + "integrity": "sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "is-electron": "^2.2.0" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -10038,16 +11357,16 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "license": "MIT", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { diff --git a/package.json b/package.json index 9249fc5..d48289d 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,20 @@ "webpack-cli": "^5.1.4" }, "dependencies": { + "@chainsafe/libp2p-noise": "^16.0.0", + "@chainsafe/libp2p-yamux": "^7.0.1", + "@libp2p/bootstrap": "^11.0.6", + "@libp2p/circuit-relay-v2": "^2.1.1", + "@libp2p/crypto": "^4.1.5", + "@libp2p/dcutr": "^2.0.6", + "@libp2p/identify": "^3.0.6", + "@libp2p/kad-dht": "^13.1.2", + "@libp2p/mdns": "^11.0.6", + "@libp2p/peer-id-factory": "^4.2.4", + "@libp2p/ping": "^2.0.6", + "@libp2p/tcp": "^10.0.7", + "@libp2p/websockets": "^9.0.6", + "@multiformats/multiaddr": "^12.3.1", "@oceanprotocol/lib": "^3.3.3", "axios": "^1.7.7", "chai": "^4.3.10", @@ -82,9 +96,13 @@ "crypto-js": "^4.2.0", "ethers": "^5.7.2", "fs": "^0.0.1-security", + "ip": "^2.0.1", + "it-pipe": "^3.0.1", + "libp2p": "^2.1.5", "node-polyfill-webpack-plugin": "^4.0.0", "os": "^0.1.2", - "path": "^0.12.7" + "path": "^0.12.7", + "private-ip": "^3.0.2" }, "activationEvents": [ "onCommand:ocean-protocol.searchAssets", diff --git a/src/@types/monitor.ts b/src/@types/monitor.ts new file mode 100644 index 0000000..20c827c --- /dev/null +++ b/src/@types/monitor.ts @@ -0,0 +1,60 @@ +export interface NodeIpAndDns { + ip: string + port: number + dns: string + relay: boolean + relayNode: string +} + +export interface NodeLocation { + id: string + ip: string + country?: string + city?: string + lat?: number + lon?: number +} +export interface NodeCheckResult { + peerId: string + ipAddrs: NodeIpAndDns + success: boolean + errorCause: string + status: string + deltaTime: number +} + +export interface NodeStatus { + id: string + location: NodeLocation + ipAndDns: NodeIpAndDns + eligible: boolean + eligibilityCauseStr: string + uptime: number + lastCheck: number + address: string + allowedAdmins: string[] + codeHash: string + http: boolean + p2p: boolean + indexer: any[] + platform: any + provider: any[] + publicKey: string + supportedStorage: any + version: string +} + +export interface GeneralStatus { + id: number + week: number + totalUptime: number + lastRun: number +} + +export interface NodeWeeklyUptime { + nodeId: string + week: number + address: string + uptime: number + lastCheck: number +} diff --git a/src/@types/p2p.ts b/src/@types/p2p.ts new file mode 100644 index 0000000..97b756b --- /dev/null +++ b/src/@types/p2p.ts @@ -0,0 +1,93 @@ +import { Stream } from 'stream' +export interface DenyList { + peers: string[] + ips: string[] +} + +export interface OceanNodeKeys { + peerId: any + publicKey: any + privateKey: any + ethAddress: string +} +export interface P2PStatusResponse { + httpStatus: number + error?: string + headers?: any +} +export interface P2PCommandResponse { + status: P2PStatusResponse + stream: Stream | null +} + +export interface OceanNodeP2PConfig { + bootstrapNodes: string[] + enableIPV4: boolean + enableIPV6: boolean + ipV4BindAddress: string | null + ipV4BindTcpPort: number | null + ipV4BindWsPort: number | null + ipV6BindAddress: string | null + ipV6BindTcpPort: number | null + ipV6BindWsPort: number | null + pubsubPeerDiscoveryInterval: number + dhtMaxInboundStreams: number + dhtMaxOutboundStreams: number + mDNSInterval: number + connectionsMaxParallelDials: number + connectionsDialTimeout: number + announceAddresses: string[] + filterAnnouncedAddresses: string[] + autoNat: boolean + upnp: boolean + enableCircuitRelayServer: boolean + enableCircuitRelayClient: boolean + circuitRelays: number + announcePrivateIp: boolean + minConnections: number + maxConnections: number + autoDialPeerRetryThreshold: number + autoDialConcurrency: number + maxPeerAddrsToDial: number + autoDialInterval: number +} + +export interface OceanNodeProvider { + chainId: string + network: string +} + +export interface OceanNodeIndexer { + chainId: string + network: string + block?: string // mark it as optional until the functionality is done +} +export interface StorageTypes { + ipfs: boolean + arwave: boolean + url: boolean +} + +export interface OceanNodeStatus { + id: string + publicKey: string + address: string + version: string + http: boolean + p2p: boolean + provider: OceanNodeProvider[] + indexer: OceanNodeIndexer[] + supportedStorage: StorageTypes + platform: any + uptime?: number // seconds since start + codeHash?: string + allowedAdmins?: string[] + // detailed information + c2dClusters?: any + supportedSchemas?: any +} + +export interface OceanNodeConfig { + keys: OceanNodeKeys + p2pConfig: OceanNodeP2PConfig | null +} diff --git a/src/extension.ts b/src/extension.ts index 3eef73d..7e492ab 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -5,14 +5,29 @@ import { ethers } from 'ethers' import * as fs from 'fs' import { createAsset } from './helpers/publish' import fetch from 'cross-fetch' +import { OceanP2P } from './helpers/oceanNode' import { download } from './helpers/download' globalThis.fetch = fetch +const node = new OceanP2P() -export function activate(context: vscode.ExtensionContext) { +async function startOceanNode(): Promise { + await node.start() + // sleep for 3 seconds + await new Promise((resolve) => setTimeout(resolve, 3000)) + + const thisNodeId = node._config.keys.peerId.toString() + console.log('Node ' + thisNodeId + ' started.') + vscode.window.showInformationMessage(`Ocean Node started with ID: ${thisNodeId}`) + return thisNodeId +} + +export async function activate(context: vscode.ExtensionContext) { console.log('Ocean Protocol extension is now active!') - const provider = new OceanProtocolViewProvider(context.extensionUri) + const nodeId = await startOceanNode() + + const provider = new OceanProtocolViewProvider(context.extensionUri, nodeId) context.subscriptions.push( vscode.window.registerWebviewViewProvider( @@ -95,17 +110,6 @@ export function activate(context: vscode.ExtensionContext) { const signer = new ethers.Wallet(privateKey, provider) - // Test provider connectivity - try { - provider.network - } catch (networkError) { - console.error('Error connecting to network:', networkError) - vscode.window.showErrorMessage( - `Error connecting to network: ${networkError.message}` - ) - return - } - const aquarius = new Aquarius(config.aquariusUrl) const urlAssetId = await createAsset( @@ -136,6 +140,29 @@ export function activate(context: vscode.ExtensionContext) { } ) + let getOceanPeers = vscode.commands.registerCommand( + 'ocean-protocol.getOceanPeers', + async () => { + try { + const peers = await node.getOceanPeers() + if (peers && peers.length > 0) { + vscode.window.showInformationMessage(`Ocean Peers:\n${peers.join('\n')}`) + } else { + vscode.window.showInformationMessage('No Ocean Peers found.') + } + } catch (error) { + console.error('Error getting Ocean Peers:', error) + if (error instanceof Error) { + vscode.window.showErrorMessage(`Error getting Ocean Peers: ${error.message}`) + } else { + vscode.window.showErrorMessage( + 'An unknown error occurred while getting Ocean Peers.' + ) + } + } + } + ) + let downloadAsset = vscode.commands.registerCommand( 'ocean-protocol.downloadAsset', async (config: any, filePath: string, privateKey: string, assetDid: string) => { @@ -202,7 +229,5 @@ export function activate(context: vscode.ExtensionContext) { } ) - context.subscriptions.push(getAssetDetails, publishAsset, downloadAsset) + context.subscriptions.push(getAssetDetails, publishAsset, downloadAsset, getOceanPeers) } - -export function deactivate() {} diff --git a/src/helpers/constants.ts b/src/helpers/constants.ts new file mode 100644 index 0000000..3822233 --- /dev/null +++ b/src/helpers/constants.ts @@ -0,0 +1,28 @@ +export const defaultBootstrapAddresses = [ + '/ip4/212.146.66.248/tcp/30080/p2p/16Uiu2HAmTC7cW9fb5ooFUupm6sAkcRJHHLGhiq2Bor8CzAAwFJCo', + '/dns4/node1.oceanprotocol.com/tcp/9000/p2p/16Uiu2HAmLhRDqfufZiQnxvQs2XHhd6hwkLSPfjAQg1gH8wgRixiP', + // '/dns4/node1.oceanprotocol.com/tcp/9001/ws/p2p/16Uiu2HAmLhRDqfufZiQnxvQs2XHhd6hwkLSPfjAQg1gH8wgRixiP', + // '/dns6/node1.oceanprotocol.com/tcp/9002/p2p/16Uiu2HAmLhRDqfufZiQnxvQs2XHhd6hwkLSPfjAQg1gH8wgRixiP', + // '/dns6/node1.oceanprotocol.com/tcp/9003/ws/p2p/16Uiu2HAmLhRDqfufZiQnxvQs2XHhd6hwkLSPfjAQg1gH8wgRixiP', + // node 2 + '/dns4/node2.oceanprotocol.com/tcp/9000/p2p/16Uiu2HAmHwzeVw7RpGopjZe6qNBJbzDDBdqtrSk7Gcx1emYsfgL4', + // '/dns4/node2.oceanprotocol.com/tcp/9001/ws/p2p/16Uiu2HAmHwzeVw7RpGopjZe6qNBJbzDDBdqtrSk7Gcx1emYsfgL4', + // '/dns6/node2.oceanprotocol.com/tcp/9002/p2p/16Uiu2HAmHwzeVw7RpGopjZe6qNBJbzDDBdqtrSk7Gcx1emYsfgL4', + // '/dns6/node2.oceanprotocol.com/tcp/9003/ws/p2p/16Uiu2HAmHwzeVw7RpGopjZe6qNBJbzDDBdqtrSk7Gcx1emYsfgL4', + // node 3 + '/dns4/node3.oceanprotocol.com/tcp/9000/p2p/16Uiu2HAmBKSeEP3v4tYEPsZsZv9VELinyMCsrVTJW9BvQeFXx28U', + // '/dns4/node3.oceanprotocol.com/tcp/9001/ws/p2p/16Uiu2HAmBKSeEP3v4tYEPsZsZv9VELinyMCsrVTJW9BvQeFXx28U', + // '/dns6/node3.oceanprotocol.com/tcp/9002/p2p/16Uiu2HAmBKSeEP3v4tYEPsZsZv9VELinyMCsrVTJW9BvQeFXx28U', + // '/dns6/node3.oceanprotocol.com/tcp/9003/ws/p2p/16Uiu2HAmBKSeEP3v4tYEPsZsZv9VELinyMCsrVTJW9BvQeFXx28U', + // node 4 + '/dns4/node4.oceanprotocol.com/tcp/9000/p2p/16Uiu2HAmSTVTArioKm2wVcyeASHYEsnx2ZNq467Z4GMDU4ErEPom' + // '/dns4/node4.oceanprotocol.com/tcp/9001/ws/p2p/16Uiu2HAmSTVTArioKm2wVcyeASHYEsnx2ZNq467Z4GMDU4ErEPom', + // '/dns6/node4.oceanprotocol.com/tcp/9002/p2p/16Uiu2HAmSTVTArioKm2wVcyeASHYEsnx2ZNq467Z4GMDU4ErEPom', + // '/dns6/node4.oceanprotocol.com/tcp/9003/ws/p2p/16Uiu2HAmSTVTArioKm2wVcyeASHYEsnx2ZNq467Z4GMDU4ErEPom' +] +export const OPFNodes = [ + 'https://node1.oceanprotocol.com:8000', + 'https://node2.oceanprotocol.com:8000', + 'https://node3.oceanprotocol.com:8000', + 'https://node4.oceanprotocol.com:8000' +] diff --git a/src/helpers/ip.ts b/src/helpers/ip.ts new file mode 100644 index 0000000..d1efc43 --- /dev/null +++ b/src/helpers/ip.ts @@ -0,0 +1,135 @@ +import is_ip_private from 'private-ip' +import ip from 'ip' +import { type Multiaddr, multiaddr } from '@multiformats/multiaddr' +import dns from 'dns' +import { NodeIpAndDns } from '../@types/monitor' + +function lookupPromise(addr: string) { + return new Promise((resolve, reject) => { + dns.lookup(addr, (err, address) => { + if (err) { + reject(err) + } + resolve(address) + }) + }) +} + +export async function extractPublicIp(addrs: Multiaddr[]): Promise { + const ipFound: NodeIpAndDns = { + ip: null, + dns: null, + port: 0, + relay: false, + relayNode: null + } + + for (const addr of addrs) { + try { + const maddr = multiaddr(addr) + const protos = maddr.protos() + if (protos.some((e) => e.name === 'p2p-circuit')) { + // it's a relay, don't count it + continue + } + + for (const index in protos) { + const proto = protos[index] + if (proto.name === 'dns4' || proto.name === 'dns6') { + // we have a dns, let's resolve it + try { + // console.log("Resolving "+maddr.nodeAddress().address) + const resolved = await lookupPromise(maddr.nodeAddress().address as string) + // console.log('Resolved:') + // console.log(resolved) + if ( + ip.isLoopback(resolved as string) || + is_ip_private(resolved as string) || + ip.isPrivate(resolved as string) + ) { + // console.log((resolved as string) + ' is loopback/private. carry on') + continue + } else { + // console.log( + // 'Returning ip ' + resolved + ' and dns ' + maddr.nodeAddress().address + // ) + return { + ip: resolved as string, + dns: maddr.nodeAddress().address, + port: maddr.nodeAddress().port, + relay: false, + relayNode: null + } + } + } catch (e) {} + } + } + } catch (e) {} + } + // we have no dns, so let's get the first public ip + for (const addr of addrs) { + // console.log('Trying ' + addr.multiaddr) + try { + const maddr = multiaddr(addr) + const protos = maddr.protos() + if (protos.some((e) => e.name === 'p2p-circuit')) { + // it's a relay, don't count it + continue + } + for (const index in protos) { + const proto = protos[index] + // console.log('proto obj') + // console.log(proto) + if (proto.name === 'ip4' || proto.name === 'ip66') { + // we have an ip, let's check it for private classes + if ( + ip.isLoopback(maddr.nodeAddress().address) || + is_ip_private(maddr.nodeAddress().address) || + ip.isPrivate(maddr.nodeAddress().address) + ) { + // console.log(maddr.nodeAddress().address + ' is loopback/private. carry on') + continue + } else { + // console.log('Returning only ip ' + maddr.nodeAddress().address) + return { + ip: maddr.nodeAddress().address, + dns: null, + port: maddr.nodeAddress().port, + relay: false, + relayNode: null + } + } + } + } + } catch (e) { + // we reach this part when having circuit relay. this is fine + console.error(e) + } + } + + // we have no dns,no ip , maybe circuit relays + for (const addr of addrs) { + // console.log('Trying ' + addr) + try { + const maddr = multiaddr(addr) + const protos = maddr.protos() + if (protos.some((e) => e.name === 'p2p-circuit')) { + for (const index in protos) { + const proto = protos[index] + if (proto.name === 'p2p-circuit' || proto.name === 'p2p-circuit') { + return { + ip: null, + dns: null, + port: maddr.nodeAddress().port, + relay: true, + relayNode: maddr.nodeAddress().address + } + } + } + } + } catch (e) { + console.error(e) + } + } + return ipFound +} diff --git a/src/helpers/oceanNode.ts b/src/helpers/oceanNode.ts new file mode 100644 index 0000000..108d88c --- /dev/null +++ b/src/helpers/oceanNode.ts @@ -0,0 +1,592 @@ +import EventEmitter from 'node:events' +import { ethers } from 'ethers' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { bootstrap } from '@libp2p/bootstrap' +import { noise } from '@chainsafe/libp2p-noise' +import { mdns } from '@libp2p/mdns' +import { yamux } from '@chainsafe/libp2p-yamux' +import { peerIdFromString } from '@libp2p/peer-id' +import { pipe } from 'it-pipe' + +import { circuitRelayTransport } from '@libp2p/circuit-relay-v2' +import { tcp } from '@libp2p/tcp' +import { webSockets } from '@libp2p/websockets' +import { createLibp2p, Libp2p } from 'libp2p' +import { identify } from '@libp2p/identify' +import { ping } from '@libp2p/ping' +import { dcutr } from '@libp2p/dcutr' +import { kadDHT, passthroughMapper } from '@libp2p/kad-dht' + +import { Transform } from 'stream' + +import is_ip_private from 'private-ip' +import ip from 'ip' +import { type Multiaddr, multiaddr } from '@multiformats/multiaddr' +import { createFromPrivKey } from '@libp2p/peer-id-factory' +import { keys } from '@libp2p/crypto' +import { Wallet } from 'ethers' + +import { OceanNodeConfig, OceanNodeKeys, P2PCommandResponse } from '../@types/p2p' +import { NodeIpAndDns, NodeCheckResult } from '../@types/monitor' +import { defaultBootstrapAddresses } from './constants' +import { extractPublicIp } from './ip' + +EventEmitter.defaultMaxListeners = 500 + +// utils +export function hexStringToByteArray(hexString: any) { + if (hexString.length % 2 !== 0) { + throw new Error('Must have an even number of hex digits to convert to bytes') + } /* w w w. jav a2 s . c o m */ + const numBytes = hexString.length / 2 + const byteArray = new Uint8Array(numBytes) + for (let i = 0; i < numBytes; i++) { + byteArray[i] = parseInt(hexString.substr(i * 2, 2), 16) + } + return byteArray +} +function generateNewPrivateKey(): string { + const wallet = ethers.Wallet.createRandom() + return wallet.privateKey +} +export async function getPeerIdFromPrivateKey( + privateKey: string +): Promise { + const key = new keys.supportedKeys.secp256k1.Secp256k1PrivateKey( + hexStringToByteArray(privateKey.slice(2)) + ) + + return { + peerId: await createFromPrivKey(key), + publicKey: key.public.bytes, + // Notes: + // using 'key.public.bytes' gives extra 4 bytes: 08021221 + // using (key as any)._publicKey is stripping this same 4 bytes at the beginning: 08021221 + // when getting the peer details with 'peerIdFromString(peerName)' it returns the version with the 4 extra bytes + // and we also need to send that to the client, so he can uncompress the public key correctly and perform the check and the encryption + // so it would make more sense to use this value on the configuration + privateKey: (key as any)._key, + ethAddress: new Wallet(privateKey.substring(2)).address + } +} + +export class OceanP2P extends EventEmitter { + _libp2p: any + _topic: string + _options: any + _peers: any[] + _connections: {} + _protocol: string + _publicAddress: string + _publicKey: Uint8Array + _privateKey: Uint8Array + _analyzeRemoteResponse: Transform + _pendingAdvertise: string[] = [] + _config: OceanNodeConfig + constructor() { + super() + } + + async start(options: any = null) { + this._topic = 'oceanprotocol' + const privateKey = generateNewPrivateKey() + this._config = { + keys: await getPeerIdFromPrivateKey(privateKey), + p2pConfig: { + bootstrapNodes: defaultBootstrapAddresses, + enableIPV4: true, + enableIPV6: false, + ipV4BindAddress: '0.0.0.0', + ipV4BindTcpPort: 0, + ipV4BindWsPort: 9001, + ipV6BindAddress: '::1', + ipV6BindTcpPort: 9002, + ipV6BindWsPort: 9003, + announceAddresses: [], + pubsubPeerDiscoveryInterval: 3000, + dhtMaxInboundStreams: 500, + dhtMaxOutboundStreams: 500, + mDNSInterval: 20e3, + connectionsMaxParallelDials: 100 * 25, + connectionsDialTimeout: 30e3, + upnp: false, + autoNat: false, + enableCircuitRelayServer: false, + enableCircuitRelayClient: false, + circuitRelays: 0, + announcePrivateIp: false, + filterAnnouncedAddresses: ['172.15.0.0/24'], + minConnections: 2, + maxConnections: 6000, + autoDialPeerRetryThreshold: 1000 * 120, + autoDialConcurrency: 500, + maxPeerAddrsToDial: 25, + autoDialInterval: 5000 + } + } + this._libp2p = await this.createNode(this._config) + this._options = options + this._peers = [] + this._connections = {} + this._protocol = '/ocean/nodes/1.0.0' + + this._analyzeRemoteResponse = new Transform({ + transform(chunk, encoding, callback) { + callback(null, chunk.toString().toUpperCase()) + } + }) + } + + shouldAnnounce(addr: any) { + try { + const maddr = multiaddr(addr) + // always filter loopback + if (ip.isLoopback(maddr.nodeAddress().address)) { + return false + } + // check filters + for (const filter of this._config.p2pConfig.filterAnnouncedAddresses) { + if (ip.cidrSubnet(filter).contains(maddr.nodeAddress().address)) { + return false + } + } + if ( + this._config.p2pConfig.announcePrivateIp === false && + (is_ip_private(maddr.nodeAddress().address) || + ip.isPrivate(maddr.nodeAddress().address)) + ) { + // disabled logs because of flooding + // P2P_LOGGER.debug( + // 'Deny announcement of private address ' + maddr.nodeAddress().address + // ) + return false + } else { + // disabled logs because of flooding + // P2P_LOGGER.debug('Allow announcement of ' + maddr.nodeAddress().address) + return true + } + } catch (e) { + // we reach this part when having circuit relay. this is fine + return true + } + } + + async createNode(config: OceanNodeConfig): Promise { + try { + this._publicAddress = config.keys.peerId.toString() + this._publicKey = config.keys.publicKey + this._privateKey = config.keys.privateKey + /** @type {import('libp2p').Libp2pOptions} */ + // start with some default, overwrite based on config later + const servicesConfig = { + identify: identify(), + dht: kadDHT({ + // this is necessary because this node is not connected to the public network + // it can be removed if, for example bootstrappers are configured + allowQueryWithZeroPeers: true, + maxInboundStreams: config.p2pConfig.dhtMaxInboundStreams, + maxOutboundStreams: config.p2pConfig.dhtMaxOutboundStreams, + pingTimeout: 1300, + pingConcurrency: 20, + clientMode: false, // this should be true for edge devices + kBucketSize: 20, + protocol: '/ocean/nodes/1.0.0/kad/1.0.0', + peerInfoMapper: passthroughMapper + // protocolPrefix: '/ocean/nodes/1.0.0' + // randomWalk: { + // enabled: true, // Allows to disable discovery (enabled by default) + // interval: 300e3, + // timeout: 10e3 + // } + }), + ping: ping(), + dcutr: dcutr() + } + const bindInterfaces = [] + if (config.p2pConfig.enableIPV4) { + bindInterfaces.push( + `/ip4/${config.p2pConfig.ipV4BindAddress}/tcp/${config.p2pConfig.ipV4BindTcpPort}` + ) + bindInterfaces.push( + `/ip4/${config.p2pConfig.ipV4BindAddress}/tcp/${config.p2pConfig.ipV4BindWsPort}/ws` + ) + } + if (config.p2pConfig.enableIPV6) { + bindInterfaces.push( + `/ip6/${config.p2pConfig.ipV6BindAddress}/tcp/${config.p2pConfig.ipV6BindTcpPort}` + ) + bindInterfaces.push( + `/ip6/${config.p2pConfig.ipV6BindAddress}/tcp/${config.p2pConfig.ipV6BindWsPort}/ws` + ) + } + // const transports = [webSockets(), tcp()] + const transports = [ + webSockets(), + tcp(), + circuitRelayTransport({ + discoverRelays: 0 + }) + ] + + let addresses = {} + if ( + config.p2pConfig.announceAddresses && + config.p2pConfig.announceAddresses.length > 0 + ) { + addresses = { + listen: bindInterfaces, + announceFilter: (multiaddrs: any[]) => + multiaddrs.filter((m) => this.shouldAnnounce(m)), + announce: config.p2pConfig.announceAddresses + } + } else { + addresses = { + listen: bindInterfaces, + announceFilter: (multiaddrs: any[]) => + multiaddrs.filter((m) => this.shouldAnnounce(m)) + } + } + let options = { + addresses, + peerId: config.keys.peerId, + transports, + streamMuxers: [yamux()], + connectionEncryption: [ + noise() + // plaintext() + ], + services: servicesConfig, + connectionManager: { + maxParallelDials: config.p2pConfig.connectionsMaxParallelDials, // 150 total parallel multiaddr dials + dialTimeout: config.p2pConfig.connectionsDialTimeout, // 10 second dial timeout per peer dial + minConnections: config.p2pConfig.minConnections, + maxConnections: config.p2pConfig.maxConnections, + autoDialPeerRetryThreshold: config.p2pConfig.autoDialPeerRetryThreshold, + autoDialConcurrency: config.p2pConfig.autoDialConcurrency, + maxPeerAddrsToDial: config.p2pConfig.maxPeerAddrsToDial, + autoDialInterval: config.p2pConfig.autoDialInterval + } + } + if (config.p2pConfig.bootstrapNodes && config.p2pConfig.bootstrapNodes.length > 0) { + options = { + ...options, + ...{ + peerDiscovery: [ + bootstrap({ + list: config.p2pConfig.bootstrapNodes, + timeout: 20000, // in ms, + tagName: 'bootstrap', + tagValue: 50, + tagTTL: 120000 + }), + mdns({ + interval: config.p2pConfig.mDNSInterval + }) + ] + } + } + } else { + // only mdns & pubsubPeerDiscovery + options = { + ...options, + ...{ + peerDiscovery: [ + mdns({ + interval: config.p2pConfig.mDNSInterval + }) + ] + } + } + } + const node = await createLibp2p(options) + await node.start() + + return node + } catch (e) {} + return null + } + + async getAllPeerStore() { + const s = await this._libp2p.peerStore.all() + return s + // for await (const peer of this._libp2p.peerRouting.getClosestPeers(s[0].id.toString())) { + // console.log(peer.id, peer.multiaddrs) + // } + } + + async getNetworkingStats() { + const ret: any = {} + ret.binds = await this._libp2p.components.addressManager.getListenAddrs() + ret.listen = await this._libp2p.components.transportManager.getAddrs() + ret.observing = await this._libp2p.components.addressManager.getObservedAddrs() + ret.announce = await this._libp2p.components.addressManager.getAnnounceAddrs() + ret.connections = await this._libp2p.getConnections() + return ret + } + + async getRunningOceanPeers() { + return await this.getOceanPeers(true, false) + } + + async getKnownOceanPeers() { + return await this.getOceanPeers(false, true) + } + + async getAllOceanPeers() { + return await this.getOceanPeers(true, true) + } + + async getOceanPeers(running: boolean = true, known: boolean = true) { + const peers: string[] = [] + try { + if (known) { + // get p2p peers and filter them by protocol + for (const peer of await this._libp2p.peerStore.all()) { + if (!peers.includes(peer.id.toString())) { + peers.push(peer.id.toString()) + } + } + } + } catch (e) { + console.error(e) + } + return peers + } + + async hasPeer(peer: any) { + const s = await this._libp2p.peerStore.all() + return Boolean(s.find((p: any) => p.toString() === peer.toString())) + } + + async sendTo( + multiaddrs: Multiaddr[], + message: string, + sink: any + ): Promise { + const maxRetries = process.env.DIAL_PROTOCOL_RETRIES + ? parseInt(process.env.DIAL_PROTOCOL_RETRIES) + : 2 + + let stream + let attempt = 0 + const response: P2PCommandResponse = { + status: { httpStatus: 200, error: '' }, + stream: null + } + while (attempt < maxRetries) { + try { + attempt += 1 + stream = await this._libp2p.dialProtocol(multiaddrs, this._protocol, { + signal: AbortSignal.timeout(3000), + priority: 100, + runOnTransientConnection: true + }) + } catch (e) { + if (attempt >= maxRetries) { + response.status.httpStatus = 404 + response.status.error = e.message + ? `Cannot connect to peer(${e.message})` + : 'Cannot connect to peer' + return response + } + await new Promise((resolve) => setTimeout(resolve, 1000)) + } + } + + if (stream) { + response.stream = stream + try { + await pipe( + // Source data + [uint8ArrayFromString(message)], + // Write to the stream, and pass its output to the next function + stream, + // this is the anayze function + // doubler as any, + // Sink function + sink + ) + } catch (err) { + // console.log(`Unable to send P2P message: ${err.message}`) + response.status.httpStatus = 404 + response.status.error = err.message + } + } else { + response.status.httpStatus = 404 + response.status.error = 'Unable to get remote P2P stream (null)' + // console.log(response.status.error) + } + + return response + } + + /** + * Is the message intended for this peer or we need to connect to another one? + * @param targetPeerID the target node id + * @returns true if the message is intended for this peer, false otherwise + */ + isTargetPeerSelf(targetPeerID: string): boolean { + return targetPeerID === this.getPeerId() + } + + getPeerId(): string { + return this._config.keys.peerId.toString() + } + + async checkPeer(peer: string, addrs: any, deltaTime: number): Promise { + let peerId = null + let success = false + let errorCause + let ipAddrs: NodeIpAndDns = { + ip: null, + dns: null, + port: 0, + relay: false, + relayNode: null + } + let status: any + // console.log('Start checking ' + peer) + + try { + peerId = peerIdFromString(peer) + } catch (e) { + errorCause = 'Invalid peer' + } + let peerData = null + const multiaddrs: Multiaddr[] = [] + // we need to take peerData + // search peerStore and dht only if we don't have addresses + if (addrs.length < 1) { + // first from our peerStore, maybe we are already connected + // then we must fetch additional multiaddrs from DHT + try { + // console.log('Search peer store') + peerData = await this._libp2p.peerStore.get(peerId, { + signal: AbortSignal.timeout(2000) + }) + if (peerData) { + for (const x of peerData.addresses) { + multiaddrs.push(x.multiaddr) + } + } + } catch (e) { + // console.log(e) + } + try { + // console.log('Search dht') + peerData = await this._libp2p.peerRouting.findPeer(peerId, { + signal: AbortSignal.timeout(5000), + useCache: false + }) + if (peerData) { + for (const index in peerData.multiaddrs) { + multiaddrs.push(peerData.multiaddrs[index]) + } + } + } catch (e) { + // console.log(e) + } + } else { + for (const x of addrs) { + multiaddrs.push(x) + } + } + // now we should have peer multiaddrs + if (multiaddrs.length < 1) { + errorCause = 'No peer data' + peerId = null + } else { + ipAddrs = await extractPublicIp(multiaddrs) + if (ipAddrs.ip == null && ipAddrs.relay === false) { + errorCause = 'No public IP' + peerId = null + } + } + if (peerId) { + let chunks: string = '' + const sink = async function (source: any) { + let first = true + for await (const chunk of source) { + if (first) { + first = false + try { + const str = uint8ArrayToString(chunk.subarray()) // Obs: we need to specify the length of the subarrays + const decoded = JSON.parse(str) + } catch (e) { + console.log(e) + } + } else { + const str = uint8ArrayToString(chunk.subarray()) + chunks = chunks.concat(str) + return str + } + } + } + // when dialing a peer using multiaddrs, we need to make that + // all multiaddrs have peerID + // or + // none of the multiaddrs have peerID + let finalmultiaddrs: Multiaddr[] = [] + const finalmultiaddrsWithAddress: Multiaddr[] = [] + const finalmultiaddrsWithOutAddress: Multiaddr[] = [] + for (const x of multiaddrs) { + if (x.toString().includes(peer)) { + try { + finalmultiaddrsWithAddress.push(multiaddr(x.toString())) + } catch (e) { + // + } + } else { + let sd = x.toString() + if (x.toString().includes('p2p-circuit')) { + sd = sd + '/p2p/' + peerId + } + try { + finalmultiaddrsWithOutAddress.push(multiaddr(sd)) + } catch (e) { + // + } + } + } + if (finalmultiaddrsWithAddress.length > finalmultiaddrsWithOutAddress.length) { + finalmultiaddrs = finalmultiaddrsWithAddress + } else { + finalmultiaddrs = finalmultiaddrsWithOutAddress + } + const tr = await this.sendTo( + finalmultiaddrs, + JSON.stringify({ + command: 'status', + node: peerId + }), + sink + ) + // console.log(tr) + if (tr.status.httpStatus === 200) { + status = chunks + success = true + } else { + errorCause = tr.status.error + } + } + // if (!success) { + // // at least get status + // status = await getNodeStatusFromOPF(peer) + // } + // return await updateNodeStatus(peer, ipAddrs, success, errorCause, status, deltaTime) + if (success) { + console.log('Eligible ' + peer + ': IPs:' + JSON.stringify(ipAddrs)) + } else { + console.log( + 'Not eligible ' + + peer + + ': IPs:' + + JSON.stringify(ipAddrs) + + ' cause:' + + errorCause + ) + } + return { peerId: peer, ipAddrs, success, errorCause, status, deltaTime } + } +} diff --git a/src/viewProvider.ts b/src/viewProvider.ts index 8e3cb79..2efb62d 100644 --- a/src/viewProvider.ts +++ b/src/viewProvider.ts @@ -5,7 +5,10 @@ export class OceanProtocolViewProvider implements vscode.WebviewViewProvider { private _view?: vscode.WebviewView - constructor(private readonly _extensionUri: vscode.Uri) {} + constructor( + private readonly _extensionUri: vscode.Uri, + private nodeId: string + ) {} public resolveWebviewView( webviewView: vscode.WebviewView, @@ -50,6 +53,9 @@ export class OceanProtocolViewProvider implements vscode.WebviewViewProvider { case 'openFilePicker': this.openFilePicker() break + case 'getOceanPeers': // Add this case + vscode.commands.executeCommand('ocean-protocol.getOceanPeers') + break } }) } @@ -73,6 +79,11 @@ export class OceanProtocolViewProvider implements vscode.WebviewViewProvider { } private _getHtmlForWebview(webview: vscode.Webview) { + // Escape the nodeId to prevent XSS + const nodeId = this.nodeId + .replace(/&/g, '&') + .replace(//g, '>') return ` @@ -200,6 +211,18 @@ export class OceanProtocolViewProvider implements vscode.WebviewViewProvider {
+
+ P2P +
+
+
+ +
${nodeId || 'Connecting...'}
+
+ +
+
+
Download Asset
@@ -238,6 +261,10 @@ export class OceanProtocolViewProvider implements vscode.WebviewViewProvider { document.getElementById('setupHeader').addEventListener('click', () => toggleSection('setup')); document.getElementById('getAssetHeader').addEventListener('click', () => toggleSection('getAsset')); document.getElementById('publishHeader').addEventListener('click', () => toggleSection('publish')); + document.getElementById('p2pHeader').addEventListener('click', () => toggleSection('p2p')); + document.getElementById('getOceanPeersBtn').addEventListener('click', () => { + vscode.postMessage({ type: 'getOceanPeers' }); + }); document.getElementById('downloadHeader').addEventListener('click', () => toggleSection('download')); }); @@ -273,6 +300,9 @@ export class OceanProtocolViewProvider implements vscode.WebviewViewProvider { selectedFilePath = message.filePath; document.getElementById('selectedFilePath').textContent = 'Selected file: ' + selectedFilePath; break; + case 'nodeId': + document.getElementById('nodeIdDisplay').textContent = message.nodeId; + break; } });