diff --git a/config/factory.js b/config/factory.js index 126f009..03dcd46 100644 --- a/config/factory.js +++ b/config/factory.js @@ -4,12 +4,26 @@ module.exports = { test: true, disposable: true, ipfsModule: require('ipfs'), - ipfsHttpModule: require('ipfs-http-client') + init: false, + start: false, + ipfsOptions: { + init: { + bits: 2048 + }, + config: { + Addresses: { + API: '/ip4/127.0.0.1/tcp/0', + Swarm: ['/ip4/0.0.0.0/tcp/0'], + Gateway: '/ip4/0.0.0.0/tcp/0' + }, + Bootstrap: [] + } + } }, overrides: { - js: {}, go: { - args: ['--enable-pubsub-experiment'], + test: false, + ipfsHttpModule: require('ipfs-http-client'), ipfsBin: require('go-ipfs-dep').path() } } diff --git a/index.js b/index.js index 3831f46..380f2fc 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ -const Ctl = require('ipfsd-ctl') -const factoryCfg = require('./config/factory') -const factory = Ctl.createFactory(factoryCfg.defaults, factoryCfg.overrides) +exports.MemStore = require('./mem-store') +exports.swarm = require('./swarm') // Different abstract-leveldown implementations const implementations = require('./implementations') @@ -8,17 +7,16 @@ const properLevelModule = implementations .filter(i => i.key.indexOf('level') > -1) .map(i => i.module)[0] const defaultStorage = require('orbit-db-storage-adapter')(properLevelModule) +exports.defaultStorage = defaultStorage +exports.implementations = implementations +// Deprecated APIs +// startIpfs and stopIpfs will throw console.warn-ings exports.config = require('./config') exports.connectPeers = require('./connect-peers') -exports.defaultStorage = defaultStorage exports.getIpfsPeerId = require('./get-ipfs-peer-id') -exports.ipfsFactory = factory -exports.implementations = implementations -exports.localSwarm = require('./local-swarm') exports.spawnApi = require('./spawn-api') exports.startIpfs = require('./start-ipfs') exports.stopIpfs = require('./stop-ipfs') exports.testApis = require('./test-apis.js') exports.waitForPeers = require('./wait-for-peers') -exports.MemStore = require('./mem-store') diff --git a/local-swarm.js b/local-swarm.js deleted file mode 100644 index fd22287..0000000 --- a/local-swarm.js +++ /dev/null @@ -1,37 +0,0 @@ -const Combinatorics = require('js-combinatorics') -const Ctl = require('ipfsd-ctl') -const factoryCfg = require('./config/factory') -const factory = Ctl.createFactory(factoryCfg.defaults, factoryCfg.overrides) - -const connectPeers = require('./connect-peers') - -// Which IPFS implementations do we support? -const allowedTypes = ['proc', 'js', 'go'] - -// Extension of the factory prototype to create local connected clusters of -// various language implementations of IPFS, all connected -factory.constructor.prototype.localSwarm = async function (ipfsTypes) { - if (!Array.isArray(ipfsTypes)) { - return Promise.reject(new Error('localSwarm: First argument should be an array')) - } - - ipfsTypes.forEach((t) => { - if (allowedTypes.indexOf(t) === -1) { - throw new Error(`${t} is not a valid ipfs type. Supported types are: ${allowedTypes.join(', ')}`) - } - }) - - const nodes = await Promise.all(ipfsTypes.map(async (type) => { - return this.spawn({ type }) - })) - - // Connect all the nodes and wait for connecting - const permutations = Combinatorics.combination(nodes, 2).toArray() - - await Promise.all(permutations.map(async (nodePair) => { - await connectPeers(nodePair[0].api, nodePair[1].api) - })) - - // Return the apis - return this.controllers.map((ipfsd) => ipfsd.api) -} diff --git a/package-lock.json b/package-lock.json index eb3a897..6e6342c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -848,15 +848,6 @@ "once": "^1.3.0" } }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -1055,6 +1046,11 @@ "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" }, + "asmcrypto.js": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/asmcrypto.js/-/asmcrypto.js-2.3.2.tgz", + "integrity": "sha512-3FgFARf7RupsZETQ1nHnhLUUvpcttcCq1iZCaVAbJZbCZ5VNRrNyvpDyHTOb0KC3llFcsyOT/a99NZcCbeiEsA==" + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -1103,6 +1099,15 @@ "lodash": "^4.17.14" } }, + "async-iterator-to-pull-stream": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/async-iterator-to-pull-stream/-/async-iterator-to-pull-stream-1.3.0.tgz", + "integrity": "sha512-NjyhAEz/sx32olqgKIk/2xbWEM6o8qef1yetIgb0U/R3oBgndP1kE/0CslowH3jvnA94BO4I6OXpOkTKH7Z1AA==", + "requires": { + "get-iterator": "^1.0.2", + "pull-stream-to-async-iterator": "^1.0.1" + } + }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -1231,11 +1236,6 @@ "safe-buffer": "^5.0.1" } }, - "base32-encode": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/base32-encode/-/base32-encode-1.1.1.tgz", - "integrity": "sha512-eqa0BeGghj3guezlasdHJhr3+J5ZbbQvxeprkcDMbRQrjlqOT832IUDT4Al4ofAwekFYMqkkM9KMUHs9Cu0HKA==" - }, "base32.js": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz", @@ -1267,6 +1267,13 @@ "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { "tweetnacl": "^0.14.3" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + } } }, "bech32": { @@ -1636,21 +1643,6 @@ "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" }, - "buffer-split": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-split/-/buffer-split-1.0.0.tgz", - "integrity": "sha1-RCfb/1NzG2HXpxq6R/UDOWYTeEo=", - "requires": { - "buffer-indexof": "~0.0.0" - }, - "dependencies": { - "buffer-indexof": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-0.0.2.tgz", - "integrity": "sha1-7Q82t64WamanzRdMBGeuje3wCPU=" - } - } - }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -1721,6 +1713,11 @@ "write-file-atomic": "^3.0.0" } }, + "callbackify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/callbackify/-/callbackify-1.1.0.tgz", + "integrity": "sha1-0qNphtKKppcUUmwREgm+65l50x4=" + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -2131,47 +2128,12 @@ "integrity": "sha1-QAKofoUMv8n52XBrYPymE6MzbpA=" }, "dag-cbor-links": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/dag-cbor-links/-/dag-cbor-links-1.3.2.tgz", - "integrity": "sha512-QbGzsx6uOXkMo66tuG0EzwhARIZzyK1Kt0EsrFmysO+tpv7jfVLTWakYY7WeH6RD2sTPKHGpWlxaMCROPS6M8A==", - "requires": { - "cids": "^0.7.1", - "dag-cbor-sync": "^0.6.2" - }, - "dependencies": { - "cids": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", - "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", - "requires": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - } - }, - "multibase": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", - "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } - } - }, - "dag-cbor-sync": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/dag-cbor-sync/-/dag-cbor-sync-0.6.3.tgz", - "integrity": "sha512-nrnPol1rE09lLOoTPWmrswyqB0nuycCqlTr6iqjVAL7h0JzF51w4cjF2CSwmg79b13eNh+E2q2+/gz6qRrkFig==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/dag-cbor-links/-/dag-cbor-links-1.3.3.tgz", + "integrity": "sha512-wtFkHjTGoJ5pBRHecZy5TAkPd4z4CV6kek0ddNFE+FPzqROKqihKVLGMxtoEVkDB6Xzx518HuBj8eVK8HrcDhQ==", "requires": { - "borc": "^2.0.3", "cids": "^0.7.1", - "ipfs-block": "^0.8.0", - "is-circular": "^1.0.1", - "multihashing-async": "^0.8.0" + "ipld-dag-cbor": "^0.15.2" }, "dependencies": { "cids": { @@ -2292,25 +2254,15 @@ } }, "datastore-pubsub": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/datastore-pubsub/-/datastore-pubsub-0.3.0.tgz", - "integrity": "sha512-OlpwhvdHpZU0+JHgSLTGfafHifayS0zJa6Q+dH4dqQI+FEuUSjffBlL8uia8S8OY+r1fxVOpDmd/yCbx1J+EEg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/datastore-pubsub/-/datastore-pubsub-0.3.1.tgz", + "integrity": "sha512-2LAyVqmyUWBYTe6WNlpJumPGDDird1OYO0KRqJanPeFHzpN8dnoniUgGomjkV/CrLuscwnhd3TMeHH3YjTEvNg==", "requires": { + "buffer": "^5.6.0", "debug": "^4.1.1", "err-code": "^2.0.0", "interface-datastore": "~0.8.0", - "multibase": "~0.6.0" - }, - "dependencies": { - "multibase": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", - "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } + "multibase": "~0.7.0" } }, "dateformat": { @@ -2503,6 +2455,11 @@ "pinkie-promise": "^2.0.0" } }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -2959,23 +2916,6 @@ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", "integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q=" }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - }, - "dependencies": { - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true - } - } - }, "escape-goat": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", @@ -3672,6 +3612,11 @@ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==" }, + "events": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", + "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==" + }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -3737,35 +3682,6 @@ "tmp": "^0.0.33" } }, - "extract-zip": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", - "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", - "dev": true, - "requires": { - "concat-stream": "^1.6.2", - "debug": "^2.6.9", - "mkdirp": "^0.5.4", - "yauzl": "^2.10.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -3832,12 +3748,20 @@ "requires": { "flat-cache": "^1.2.1", "object-assign": "^4.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } } }, "file-type": { - "version": "14.1.4", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-14.1.4.tgz", - "integrity": "sha512-1n6FczX8n73Y/cLjTiMboeTGHfm/i2AWk2oQE7m9a/G5YTCZHCEHEGr32thhLm3iQNUYzTKVQUcYcNHtOLwqgQ==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-14.2.0.tgz", + "integrity": "sha512-CAkX5G5jq8LIgFu++dpM3giMZadYdU+QVQoPLajjNboo8IzaR4cKpBCVEuz+suhd/vHqoAJeSWhEubKjRPQHJg==", "requires": { "readable-web-to-node-stream": "^2.0.0", "strtok3": "^6.0.0", @@ -4061,6 +3985,11 @@ "number-is-nan": "^1.0.0" } }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -4684,9 +4613,9 @@ } }, "go-ipfs-dep": { - "version": "0.4.23-3", - "resolved": "https://registry.npmjs.org/go-ipfs-dep/-/go-ipfs-dep-0.4.23-3.tgz", - "integrity": "sha512-jdLKEax5pGVoPJn2ZayYSGt0SXPI9osr6cj87cWB9PGJ7p/tkPSzMHNpVHwYU1aY9SjUcuU8KzqMUn1KOCK5FA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/go-ipfs-dep/-/go-ipfs-dep-0.5.0.tgz", + "integrity": "sha512-Ycv47Nydg7C9ochR40LIlpRGnJAq7lh9S9o3NW3hXX03TZu7m9mx3LIzJia2zFJUdH7RhZ4103QCHmaQlFXCgQ==", "requires": { "go-platform": "^1.0.0", "gunzip-maybe": "^1.4.1", @@ -4727,9 +4656,9 @@ } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "graceful-readlink": { "version": "1.0.1", @@ -4915,6 +4844,11 @@ "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", "integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=" }, + "hi-base32": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.0.tgz", + "integrity": "sha512-DDRmxSyoYuvjUb9EnXdoiMChBZ7ZcUVJsK5Frd3kqMhuBxvmZdnBeynAVfj7/ECbn++CekcoprvC/rprHPAtow==" + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -4952,27 +4886,6 @@ "sshpk": "^1.7.0" } }, - "https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dev": true, - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -5187,9 +5100,9 @@ "integrity": "sha512-pKnZpbgCTfH/1NLIlOduP/V+WRXzC2MOz3Qo8xmxk8C5GudJLgK5QyLVXOSWy3ParAH7Eemurl3xjv/WXYFvMA==" }, "ipfs": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/ipfs/-/ipfs-0.43.0.tgz", - "integrity": "sha512-LJd+dcTu2ZPSZEpBcpCbjArhHsP6qRU58m0qyfLKmgCWUGTD6LzqzKlQ0P+l2YMpJLzYsuUMkjnZUZAvSAKvcQ==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/ipfs/-/ipfs-0.43.1.tgz", + "integrity": "sha512-N2/TxcRUPJ9kpxn2gnt5fCd8ZiuEYY2T5Mgoclgksnh4NzMY/Vd8OLliGO3wjGqH08FPYfkZOOu0KAc67Kdgpw==", "requires": { "@hapi/ammo": "^3.1.2", "@hapi/boom": "^7.4.3", @@ -5225,12 +5138,12 @@ "ipfs-block": "^0.8.1", "ipfs-block-service": "^0.16.0", "ipfs-core-utils": "^0.2.0", - "ipfs-http-client": "^44.0.0", + "ipfs-http-client": "^44.0.1", "ipfs-http-response": "^0.5.0", "ipfs-repo": "^1.0.1", "ipfs-unixfs": "^1.0.1", - "ipfs-unixfs-exporter": "^1.0.3", - "ipfs-unixfs-importer": "^1.0.3", + "ipfs-unixfs-exporter": "^2.0.0", + "ipfs-unixfs-importer": "^2.0.0", "ipfs-utils": "^2.2.0", "ipld": "^0.25.0", "ipld-bitcoin": "^0.3.0", @@ -5270,7 +5183,7 @@ "libp2p-record": "^0.7.0", "libp2p-secio": "^0.12.2", "libp2p-tcp": "^0.14.3", - "libp2p-webrtc-star": "^0.17.6", + "libp2p-webrtc-star": "^0.17.9", "libp2p-websockets": "^0.13.3", "mafmt": "^7.0.0", "merge-options": "^2.0.0", @@ -5301,6 +5214,42 @@ "varint": "^5.0.0", "yargs": "^15.1.0", "yargs-promise": "^1.1.0" + }, + "dependencies": { + "ipfs-http-client": { + "version": "44.0.1", + "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-44.0.1.tgz", + "integrity": "sha512-+QG9RdfB+tatxLoZCohVslDrFpmVK622fWbWwRPo5tQE/5ZAvXXxasgWuc1M3BvXkSIDvhFqf6lIdNawRfuMhA==", + "requires": { + "abort-controller": "^3.0.0", + "bignumber.js": "^9.0.0", + "bs58": "^4.0.1", + "buffer": "^5.4.2", + "cids": "^0.8.0", + "debug": "^4.1.0", + "form-data": "^3.0.0", + "ipfs-block": "^0.8.1", + "ipfs-core-utils": "^0.2.0", + "ipfs-utils": "^2.2.0", + "ipld-dag-cbor": "^0.15.1", + "ipld-dag-pb": "^0.18.3", + "ipld-raw": "^4.0.1", + "iso-url": "^0.4.7", + "it-tar": "^1.2.1", + "it-to-buffer": "^1.0.0", + "it-to-stream": "^0.1.1", + "merge-options": "^2.0.0", + "multiaddr": "^7.2.1", + "multiaddr-to-uri": "^5.1.0", + "multibase": "^0.7.0", + "multicodec": "^1.0.0", + "multihashes": "^0.4.14", + "nanoid": "^3.0.2", + "node-fetch": "^2.6.0", + "parse-duration": "^0.1.2", + "stream-to-it": "^0.2.0" + } + } } }, "ipfs-bitswap": { @@ -5397,37 +5346,276 @@ } }, "ipfs-http-client": { - "version": "44.0.0", - "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-44.0.0.tgz", - "integrity": "sha512-vFGM8eKipeJ7MEgare9zXVJqQ37pLUdNP4fpIvfzDfEgpK6OmJR3UaoZ1RtKwKGnHi/ADU3Dc5rGWd/YwiaR9g==", + "version": "41.0.1", + "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-41.0.1.tgz", + "integrity": "sha512-oyH0hXoB+jfz4NqM+SZSpk6c9wR+9uvUO+/0eQFT6B9Ludz4zR8T5MHo7bnQoVerj9Qlv0x0wO1ckSoekaSPpw==", "requires": { "abort-controller": "^3.0.0", + "async-iterator-to-pull-stream": "^1.3.0", "bignumber.js": "^9.0.0", + "bl": "^4.0.0", "bs58": "^4.0.1", "buffer": "^5.4.2", - "cids": "^0.8.0", + "callbackify": "^1.1.0", + "cids": "~0.7.1", "debug": "^4.1.0", + "err-code": "^2.0.0", + "explain-error": "^1.0.4", "form-data": "^3.0.0", - "ipfs-block": "^0.8.1", - "ipfs-core-utils": "^0.2.0", - "ipfs-utils": "^2.2.0", - "ipld-dag-cbor": "^0.15.1", - "ipld-dag-pb": "^0.18.3", - "ipld-raw": "^4.0.1", - "iso-url": "^0.4.7", - "it-tar": "^1.2.1", - "it-to-buffer": "^1.0.0", + "ipfs-block": "~0.8.1", + "ipfs-utils": "^0.4.2", + "ipld-dag-cbor": "~0.15.0", + "ipld-dag-pb": "^0.18.1", + "ipld-raw": "^4.0.0", + "is-ipfs": "~0.6.1", + "it-all": "^1.0.1", + "it-glob": "0.0.7", + "it-tar": "^1.1.1", "it-to-stream": "^0.1.1", + "iterable-ndjson": "^1.1.0", + "ky": "^0.15.0", + "ky-universal": "^0.3.0", "merge-options": "^2.0.0", - "multiaddr": "^7.2.1", - "multiaddr-to-uri": "^5.1.0", - "multibase": "^0.7.0", + "multiaddr": "^6.0.6", + "multiaddr-to-uri": "^5.0.0", + "multibase": "~0.6.0", "multicodec": "^1.0.0", - "multihashes": "^0.4.14", - "nanoid": "^3.0.2", - "node-fetch": "^2.6.0", - "parse-duration": "^0.1.2", - "stream-to-it": "^0.2.0" + "multihashes": "~0.4.14", + "parse-duration": "^0.1.1", + "peer-id": "~0.12.3", + "peer-info": "~0.15.1", + "promise-nodeify": "^3.0.1" + }, + "dependencies": { + "asn1.js": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.3.0.tgz", + "integrity": "sha512-WHnQJFcOrIWT1RLOkFFBQkFVvyt9BPOOrH+Dp152Zk4R993rSzXUGPmkybIcUFhHE2d/iHH+nCaOWVCDbO8fgA==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "cids": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", + "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", + "requires": { + "buffer": "^5.5.0", + "class-is": "^1.1.0", + "multibase": "~0.6.0", + "multicodec": "^1.0.0", + "multihashes": "~0.4.15" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" + }, + "ipfs-utils": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/ipfs-utils/-/ipfs-utils-0.4.2.tgz", + "integrity": "sha512-k/uNOniniqg7uCnHvmujis8ASNefn0url8GS7HaNLAhL3RV3dHBiibtQFp8JZ/zfN+80FrYJt7cPEzRbGbmJUA==", + "requires": { + "buffer": "^5.2.1", + "err-code": "^2.0.0", + "fs-extra": "^8.1.0", + "is-buffer": "^2.0.3", + "is-electron": "^2.2.0", + "is-pull-stream": "0.0.0", + "is-stream": "^2.0.0", + "it-glob": "0.0.7", + "kind-of": "^6.0.2", + "pull-stream-to-async-iterator": "^1.0.2", + "readable-stream": "^3.4.0" + } + }, + "is-ipfs": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/is-ipfs/-/is-ipfs-0.6.3.tgz", + "integrity": "sha512-HyRot1dvLcxImtDqPxAaY1miO6WsiP/z7Yxpg2qpaLWv5UdhAPtLvHJ4kMLM0w8GSl8AFsVF23PHe1LzuWrUlQ==", + "requires": { + "bs58": "^4.0.1", + "cids": "~0.7.0", + "mafmt": "^7.0.0", + "multiaddr": "^7.2.1", + "multibase": "~0.6.0", + "multihashes": "~0.4.13" + }, + "dependencies": { + "multiaddr": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-7.4.3.tgz", + "integrity": "sha512-gFjXmjcCMyrx5KF1QOohUQm6a3E2XF4kydvClS8DmRJkY3qJaDPNNe0OC7mWvVUE0nnE8HjyToQfABnpKClXRA==", + "requires": { + "buffer": "^5.5.0", + "cids": "~0.8.0", + "class-is": "^1.1.0", + "is-ip": "^3.1.0", + "multibase": "^0.7.0", + "varint": "^5.0.0" + }, + "dependencies": { + "cids": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.8.0.tgz", + "integrity": "sha512-HdKURxtSOnww3H28CJU2TauIklEBsOn+ouGl2EOnSfVCVkH6+sWTj7to2D/BmuWvwzEy2+ZIKdcIwsXHJBQVew==", + "requires": { + "buffer": "^5.5.0", + "class-is": "^1.1.0", + "multibase": "~0.7.0", + "multicodec": "^1.0.1", + "multihashes": "~0.4.17" + } + }, + "multibase": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } + } + } + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "libp2p-crypto": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/libp2p-crypto/-/libp2p-crypto-0.16.3.tgz", + "integrity": "sha512-ro7/5Tu+f8p2+qDS1JrROnO++nNaAaBFs+VVXVHLuTMnbnMASu1eUtSlWPk1uOwikAlBFTvfqe5J1bK6Bpq6Pg==", + "requires": { + "asmcrypto.js": "^2.3.2", + "asn1.js": "^5.0.1", + "async": "^2.6.1", + "bn.js": "^4.11.8", + "browserify-aes": "^1.2.0", + "bs58": "^4.0.1", + "iso-random-stream": "^1.1.0", + "keypair": "^1.0.1", + "libp2p-crypto-secp256k1": "~0.3.0", + "multihashing-async": "~0.5.1", + "node-forge": "~0.9.1", + "pem-jwk": "^2.0.0", + "protons": "^1.0.1", + "rsa-pem-to-jwk": "^1.1.3", + "tweetnacl": "^1.0.0", + "ursa-optional": "~0.10.0" + } + }, + "multiaddr": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-6.1.1.tgz", + "integrity": "sha512-Q1Ika0F9MNhMtCs62Ue+GWIJtRFEhZ3Xz8wH7/MZDVZTWhil1/H2bEGN02kUees3hkI3q1oHSjmXYDM0gxaFjQ==", + "requires": { + "bs58": "^4.0.1", + "class-is": "^1.1.0", + "hi-base32": "~0.5.0", + "ip": "^1.1.5", + "is-ip": "^2.0.0", + "varint": "^5.0.0" + }, + "dependencies": { + "is-ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-2.0.0.tgz", + "integrity": "sha1-aO6gfooKCpTC0IDdZ0xzGrKkYas=", + "requires": { + "ip-regex": "^2.0.0" + } + } + } + }, + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + }, + "multihashing-async": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.5.2.tgz", + "integrity": "sha512-mmyG6M/FKxrpBh9xQDUvuJ7BbqT93ZeEeH5X6LeMYKoYshYLr9BDdCsvDtZvn+Egf+/Xi+aOznrWL4vp3s+p0Q==", + "requires": { + "blakejs": "^1.1.0", + "js-sha3": "~0.8.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + }, + "peer-id": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.12.5.tgz", + "integrity": "sha512-3xVWrtIvNm9/OPzaQBgXDrfWNx63AftgFQkvqO6YSZy7sP3Fuadwwbn54F/VO9AnpyW/26i0WRQz9FScivXrmw==", + "requires": { + "async": "^2.6.3", + "class-is": "^1.1.0", + "libp2p-crypto": "~0.16.1", + "multihashes": "~0.4.15" + } + }, + "peer-info": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/peer-info/-/peer-info-0.15.1.tgz", + "integrity": "sha512-Y91Q2tZRC0CpSTPd1UebhGqniOrOAk/aj60uYUcWJXCoLTAnGu+4LJGoiay8ayudS6ice7l3SKhgL/cS62QacA==", + "requires": { + "mafmt": "^6.0.2", + "multiaddr": "^6.0.3", + "peer-id": "~0.12.2", + "unique-by": "^1.0.0" + }, + "dependencies": { + "mafmt": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-6.0.10.tgz", + "integrity": "sha512-FjHDnew6dW9lUu3eYwP0FvvJl9uvNbqfoJM+c1WJcSyutNEIlyu6v3f/rlPnD1cnmue38IjuHlhBdIh3btAiyw==", + "requires": { + "multiaddr": "^6.1.0" + } + } + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + } } }, "ipfs-http-response": { @@ -5696,56 +5884,44 @@ } }, "ipfs-unixfs": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-1.0.1.tgz", - "integrity": "sha512-P1G9eVywOFtItONEiAvOgPIUO7hZjBC1FK3iiTXRDOrtM8S1K0fxgF9lGG+mZUeE5WPjyiuQEiMrSmqym27Efw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-1.0.2.tgz", + "integrity": "sha512-+TucOvxUjSiNSn0eh7aiRaP+KkZC7IM8BnmVammbsUczKbzsWhxQfdgYRQk/btct/KvJeJkF0SVlKLd3MwJ/UQ==", "requires": { "err-code": "^2.0.0", - "protons": "^1.1.0" - }, - "dependencies": { - "protons": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/protons/-/protons-1.1.0.tgz", - "integrity": "sha512-rxf3et88VGRJkXIcDK1nemQM9OpnKsRVuZW+vkJLRmytA6530hQ+k/r2DpclNJCYF+xUl2MXsvRsK+MJgcbfEg==", - "requires": { - "protocol-buffers-schema": "^3.3.1", - "safe-buffer": "^5.1.1", - "signed-varint": "^2.0.1", - "varint": "^5.0.0" - } - } + "protons": "^1.2.0" } }, "ipfs-unixfs-exporter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-1.1.0.tgz", - "integrity": "sha512-hevdVh/XHHwZgYML83DUO9X65XBoAPQHGjaAKE7HRMcxh7okvrMJtIbR08CkfcNKrPCpdiPjyiaOM/Bnnom6eA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-2.0.1.tgz", + "integrity": "sha512-DyXM/D7I/dquiXP9HS1MsPwJZYht1KjJkRncgzHstQ6fepKPlC28n1cbPr43/JfYG0GfI5sjhvSI7w3XEou+PQ==", "requires": { + "buffer": "^5.6.0", "cids": "^0.8.0", "err-code": "^2.0.0", "hamt-sharding": "^1.0.0", - "ipfs-unixfs": "^1.0.1", + "ipfs-unixfs": "^1.0.2", "it-last": "^1.0.1", "multihashing-async": "^0.8.0" } }, "ipfs-unixfs-importer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-1.0.4.tgz", - "integrity": "sha512-l1kfIR1WlKkF3prbqG1kHrBwTsj0w5Jm2hTuYxcxdF4UU38Rto8FxmH7/QMIXbJeJgUBrBAcrXasS5T+UJrR9A==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-2.0.1.tgz", + "integrity": "sha512-N3PRdmreRz4WqaVPmgMSgvL8+mh4Xb7T0c/2kmsdJJem8Dorn0eYe5wJ7pk227uDqq/R6XxAN0dWZt5+hsnwFw==", "requires": { "bl": "^4.0.0", + "buffer": "^5.6.0", "err-code": "^2.0.0", "hamt-sharding": "^1.0.0", - "ipfs-unixfs": "^1.0.1", - "ipld-dag-pb": "^0.18.0", + "ipfs-unixfs": "^1.0.2", + "ipld-dag-pb": "^0.18.5", "it-all": "^1.0.1", "it-batch": "^1.0.3", "it-first": "^1.0.1", "it-parallel-batch": "^1.0.3", "merge-options": "^2.0.0", - "multicodec": "^1.0.0", "multihashing-async": "^0.8.0", "rabin-wasm": "^0.1.1" } @@ -5769,13 +5945,13 @@ } }, "ipfsd-ctl": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ipfsd-ctl/-/ipfsd-ctl-3.1.0.tgz", - "integrity": "sha512-nKvJpmeu83FODCTmNf1105/chOFak1lFY61IM6hbUWNcmyQ3sTohupZB7sB8ymY+kfqtM5kvZXA7KWuiMGK88Q==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/ipfsd-ctl/-/ipfsd-ctl-4.0.1.tgz", + "integrity": "sha512-hNxZqRnwO1aD+tN/rkDiDb2jVr+FE53vtKFi/HFfNgdOomWtnF/n9ZwCrgB9qXTBZQQXe0foxvN2d31ydb31xA==", "requires": { "@hapi/boom": "^8.0.1", - "@hapi/hapi": "^18.3.2", - "@hapi/joi": "^16.1.8", + "@hapi/hapi": "^18.4.1", + "@hapi/joi": "^17.1.1", "debug": "^4.1.1", "execa": "^4.0.0", "fs-extra": "^9.0.0", @@ -5786,6 +5962,21 @@ "temp-write": "^4.0.0" }, "dependencies": { + "@hapi/address": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-4.0.1.tgz", + "integrity": "sha512-0oEP5UiyV4f3d6cBL8F3Z5S7iWSX39Knnl0lY8i+6gfmmIBj44JCBNtcMgwyS+5v7j3VYavNay0NFHDS+UGQcw==", + "requires": { + "@hapi/hoek": "^9.0.0" + }, + "dependencies": { + "@hapi/hoek": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.0.4.tgz", + "integrity": "sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==" + } + } + }, "@hapi/boom": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-8.0.1.tgz", @@ -5794,16 +5985,48 @@ "@hapi/hoek": "8.x.x" } }, + "@hapi/formula": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-2.0.0.tgz", + "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==" + }, "@hapi/joi": { - "version": "16.1.8", - "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-16.1.8.tgz", - "integrity": "sha512-wAsVvTPe+FwSrsAurNt5vkg3zo+TblvC5Bb1zMVK6SJzZqw9UrJnexxR+76cpePmtUZKHAPxcQ2Bf7oVHyahhg==", + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-17.1.1.tgz", + "integrity": "sha512-p4DKeZAoeZW4g3u7ZeRo+vCDuSDgSvtsB/NpfjXEHTUjSeINAi/RrVOWiVQ1isaoLzMvFEhe8n5065mQq1AdQg==", + "requires": { + "@hapi/address": "^4.0.1", + "@hapi/formula": "^2.0.0", + "@hapi/hoek": "^9.0.0", + "@hapi/pinpoint": "^2.0.0", + "@hapi/topo": "^5.0.0" + }, + "dependencies": { + "@hapi/hoek": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.0.4.tgz", + "integrity": "sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==" + } + } + }, + "@hapi/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-vzXR5MY7n4XeIvLpfl3HtE3coZYO4raKXW766R6DZw/6aLqR26iuZ109K7a0NtF2Db0jxqh7xz2AxkUwpUFybw==" + }, + "@hapi/topo": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz", + "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==", "requires": { - "@hapi/address": "^2.1.2", - "@hapi/formula": "^1.2.0", - "@hapi/hoek": "^8.2.4", - "@hapi/pinpoint": "^1.0.2", - "@hapi/topo": "^3.1.3" + "@hapi/hoek": "^9.0.0" + }, + "dependencies": { + "@hapi/hoek": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.0.4.tgz", + "integrity": "sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==" + } } } } @@ -5872,16 +6095,17 @@ } }, "ipld-dag-pb": { - "version": "0.18.4", - "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.18.4.tgz", - "integrity": "sha512-T7Fa6xDGtWqRE3uE3bU0eflKATkZrBuh7LwFByCdz0lUpES6aMRDoUdIjlOxWAvEN01oUeT7jeeX/ZWINsI1gw==", + "version": "0.18.5", + "resolved": "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.18.5.tgz", + "integrity": "sha512-8IAPZrkRjgTpkxV9JOwXSBe0GXNxd4B2lubPgbifTGL92rZOEKWutpijsWsWvjXOltDFHKMQIIIhkgLC5RPqbA==", "requires": { "buffer": "^5.6.0", "cids": "~0.8.0", "class-is": "^1.1.0", "multicodec": "^1.0.1", "multihashing-async": "~0.8.1", - "protons": "^1.0.2" + "protons": "^1.0.2", + "stable": "^0.1.8" } }, "ipld-ethereum": { @@ -6028,15 +6252,16 @@ } }, "ipns": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/ipns/-/ipns-0.7.0.tgz", - "integrity": "sha512-Lnjv8i4iMHaDd/xZva+hypzqO100a4F29kcFNeEM8yTrf1dTx1Hg4cmrEPXAQZbJtvbdDKoTLQLZC7cjwYtZtg==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ipns/-/ipns-0.7.1.tgz", + "integrity": "sha512-2kKXu+AXlDXOxxjawey5H81al3xray/pUSHGpx6K7+VKgzCQr5A3PSuDRMFFiEst0nJ5lBvgMLpA+r3HBfUvlQ==", "requires": { - "base32-encode": "^1.1.0", + "buffer": "^5.6.0", "debug": "^4.1.1", "err-code": "^2.0.0", "interface-datastore": "^0.8.0", "libp2p-crypto": "^0.17.1", + "multibase": "^0.7.0", "multihashes": "~0.4.14", "peer-id": "^0.13.6", "protons": "^1.0.1", @@ -6191,10 +6416,14 @@ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" }, "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz", + "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=" + }, + "is-pull-stream": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/is-pull-stream/-/is-pull-stream-0.0.0.tgz", + "integrity": "sha1-o7w9HG0wVRUcRr3m85nv7SFEDKk=" }, "is-regex": { "version": "1.0.5", @@ -6415,14 +6644,14 @@ } }, "it-all": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.1.tgz", - "integrity": "sha512-DQ8MQXVfwCktZOja1xvKdsuka7E/OJHpLKLR3tMBmg6Kfo8Kob+XRE6pRfpbkXNsGyET4lMYrQ0y5T3XXF/Akw==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.2.tgz", + "integrity": "sha512-3hrCLLcuHS1/VUn1qETPuh9rFTw31SBCUUijjs41VJ+oQGx3H+3Lpxo1bFD3q3570w3o99a+sfRGic5PBBt3Vg==" }, "it-batch": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/it-batch/-/it-batch-1.0.3.tgz", - "integrity": "sha512-HCvnTVeA2jH32p1sh1B3f3E1zhXdADJKhoVFSRcVjQA6zpMRUjx2cUWKc7Y8Qa2moJDAHEQxMZS/OVDffek0rw==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/it-batch/-/it-batch-1.0.4.tgz", + "integrity": "sha512-hZ+gaj5MaECauRd+Ahvo9iAxg90YGVBg7AZ32wOeXJ08IRjfQRMSnZ9oA0JjNeJeSGuVjWf91UUD5y2SYmKlwQ==" }, "it-buffer": { "version": "0.1.2", @@ -6442,14 +6671,14 @@ } }, "it-drain": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.0.tgz", - "integrity": "sha512-4oqyA3xvisuRV9kPvMDRMKllupxNrTEj5ajs66l1XP7cf7uro2LQS/lPMh310eHTj/Qz3ieiER0xr/lmtkhpGw==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.1.tgz", + "integrity": "sha512-4aX8AsJWjRh0inNXGLa90fvxuB7vQY70WFasvskUMtpXXz8+MUH8R7PODBtn4yXCJ25ud2iRwWwa1g8DRDbrlA==" }, "it-first": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-first/-/it-first-1.0.1.tgz", - "integrity": "sha512-+Eka8awisZlNh9/zK0kuad/31PngGpVm9Vo/tb9KkeAKGKUMc2POMxFUvRzj93kODOyBSc0be8k3AbQ6xdPsyg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/it-first/-/it-first-1.0.2.tgz", + "integrity": "sha512-hU5ObR14987PR7l0J7dfWAgKYiWoKbXcoXKqhQDGgHSZML6UPmHSS9ILBGucZkoA2B152kEqEOllS4tVQq11fg==" }, "it-glob": { "version": "0.0.7", @@ -6501,9 +6730,9 @@ } }, "it-last": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-last/-/it-last-1.0.1.tgz", - "integrity": "sha512-U2dRwMb0cqz3OVc47y5FiGFzZwbEScHTc6RhTKOnKMidUpyjoX0Au6Zta5DQZSuwwB6RrQ6ao8jAFUN6SlyQWw==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/it-last/-/it-last-1.0.2.tgz", + "integrity": "sha512-zjWiVvkDXKxGA+u2ZNzq321RWnj52RLucsIX0Bve3NUX3X/b1RjtUufvUdjtkFtQLKG1yCf5+hxbdeIYiRT1rQ==" }, "it-length-prefixed": { "version": "3.0.1", @@ -6516,14 +6745,14 @@ } }, "it-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-map/-/it-map-1.0.1.tgz", - "integrity": "sha512-wvyFrogVIxaa2j9i93/z9glkoXOe0Az7+/xFWGF6zEAvMDneIqUzVHDDvysH1/ASZxEtk3K9hw+vthlsVRX8gg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/it-map/-/it-map-1.0.2.tgz", + "integrity": "sha512-WTy7ZK4MDo5B9JgcGz2VLwDxqItUHzv8Mg0YzVM7jhcqY8EdjUuMoAcL7PqzJed+TMy/AYorw47Muc87sdD4sA==" }, "it-multipart": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/it-multipart/-/it-multipart-1.0.2.tgz", - "integrity": "sha512-nUdSYGzhl3DYJSFEzAcMm/3ycMfZ0h0p2XQ8K8wEfT7fRlGVtWN5YZXeIZemPHe/bIHVwXch6FCZzIhGukmiGw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/it-multipart/-/it-multipart-1.0.3.tgz", + "integrity": "sha512-8PSjOl5OSx2fCbBJ73uV4ZVMY0Q/yCQrWHNk6XYXYDwByH5rnSBYEyuSSiOM2grDLY39atybbKTbMi3GWEbACA==", "requires": { "buffer": "^5.5.0", "buffer-indexof": "^1.1.1", @@ -6539,11 +6768,11 @@ } }, "it-parallel-batch": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/it-parallel-batch/-/it-parallel-batch-1.0.3.tgz", - "integrity": "sha512-i2AnxP28P+50RYeHTORWRhfj8n/xd/2gCsnkF6+ze8C7f6TklGRIlxGVeZ58z3STvz04WR9eUf2iij/KT6WP2A==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/it-parallel-batch/-/it-parallel-batch-1.0.4.tgz", + "integrity": "sha512-YyIa0urQO7C/YmWaKAXILv7glvvsfM9jsL+u1CUQxyO8vslLyv9i3LT8AFC55Y9r6xT3A4jK9FhaXND2NmcPFw==", "requires": { - "it-batch": "^1.0.3" + "it-batch": "^1.0.4" } }, "it-pb-rpc": { @@ -6600,9 +6829,9 @@ } }, "it-to-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/it-to-buffer/-/it-to-buffer-1.0.1.tgz", - "integrity": "sha512-7ncNESNc5v2baA5CTTd89L4Nzd/44Yts2GZYep6ENLfDcXQpNAM0xlWBSQUvcsqf50Vov5cANI4NstX6BdH6Pg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/it-to-buffer/-/it-to-buffer-1.0.2.tgz", + "integrity": "sha512-mTuceNC6deSbANZSQFxNRwFlVPvIZkjzxX10mOBxgzzhBGOkih2+OkOyGbhhcGNu/jxd4hk8qkjjOipx+tNIGA==", "requires": { "buffer": "^5.5.0" } @@ -6927,6 +7156,11 @@ "json-buffer": "3.0.0" } }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, "knex": { "version": "0.8.6", "resolved": "https://registry.npmjs.org/knex/-/knex-0.8.6.tgz", @@ -7034,28 +7268,18 @@ } } }, - "latency-monitor": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/latency-monitor/-/latency-monitor-0.2.1.tgz", - "integrity": "sha1-QEPV8j3obiv872ztSjtbki4d1+0=", + "ky": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/ky/-/ky-0.15.0.tgz", + "integrity": "sha512-6IlJRPFHq4ZKRRa9lyh6YqHqlmddAkfyXI9CYvZpLQtg7fQvwncPHyHrmtXAHKCqHOilINPMT88eW6FTA3HwkA==" + }, + "ky-universal": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.3.0.tgz", + "integrity": "sha512-CM4Bgb2zZZpsprcjI6DNYTaH3oGHXL2u7BU4DK+lfCuC4snkt9/WRpMYeKbBbXscvKkeqBwzzjFX2WwmKY5K/A==", "requires": { - "debug": "^2.6.0", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } + "abort-controller": "^3.0.0", + "node-fetch": "^2.6.0" } }, "latest-version": { @@ -7374,9 +7598,9 @@ } }, "libp2p": { - "version": "0.27.6", - "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.27.6.tgz", - "integrity": "sha512-MDfDWqqdKaC0HyHMiH2H1MBUxqku5HQiSo1vTXbzwaaebSAP7k/9XMBK3pKcaC+CdNxN5Ewjj3t8aurmZyf1Yg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.27.7.tgz", + "integrity": "sha512-CIgw49z+sSgg/2kUPb53fVKJh2Oxttfjw1oKmRBuakhfhVmpAvOcpmrxSjGifeWreuRu20sva19u2xJ5tAWGyA==", "requires": { "abort-controller": "^3.0.0", "aggregate-error": "^3.0.1", @@ -7385,30 +7609,32 @@ "class-is": "^1.1.0", "debug": "^4.1.1", "err-code": "^2.0.0", + "events": "^3.1.0", "hashlru": "^2.3.0", + "ipfs-utils": "^2.2.0", "it-all": "^1.0.1", - "it-buffer": "^0.1.1", + "it-buffer": "^0.1.2", "it-handshake": "^1.0.1", - "it-length-prefixed": "^3.0.0", + "it-length-prefixed": "^3.0.1", "it-pipe": "^1.1.0", "it-protocol-buffers": "^0.2.0", - "latency-monitor": "~0.2.1", - "libp2p-crypto": "^0.17.1", - "libp2p-interfaces": "^0.2.3", + "libp2p-crypto": "^0.17.6", + "libp2p-interfaces": "^0.2.8", "libp2p-utils": "^0.1.2", "mafmt": "^7.0.0", "merge-options": "^2.0.0", "moving-average": "^1.0.0", - "multiaddr": "^7.2.1", + "multiaddr": "^7.4.3", "multistream-select": "^0.15.0", "mutable-proxy": "^1.0.0", "p-any": "^3.0.0", "p-fifo": "^1.0.0", - "p-settle": "^4.0.0", - "peer-id": "^0.13.4", + "p-settle": "^4.0.1", + "peer-id": "^0.13.11", "peer-info": "^0.17.0", "protons": "^1.0.1", "retimer": "^2.0.0", + "streaming-iterables": "^4.1.0", "timeout-abort-controller": "^1.0.0", "xsalsa20": "^1.0.2" } @@ -7445,14 +7671,14 @@ }, "dependencies": { "node-gyp-build": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.1.tgz", - "integrity": "sha512-XyCKXsqZfLqHep1hhsMncoXuUNt/cXCjg1+8CLbu69V1TKuPiOeSGbL9n+k/ByKH8UT0p4rdIX8XkTRZV0i7Sw==" + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.2.tgz", + "integrity": "sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA==" }, "secp256k1": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.0.tgz", - "integrity": "sha512-0w0zse+Iku13O58SVE9/DhyCKWNsKb+n/vMqLOGICgSqxWuXZs+eajBf9uVOgk5QfNvTY/mx0QSqYxkcz802dw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-iGRjbGAKfXMqhtdkkuNxsgJQfJO8Oo78Rm7DAvsG3XKngq+nJIOGqrCSXcQqIVsmCj0wFanE5uTKFxV3T9j2wg==", "requires": { "elliptic": "^6.5.2", "node-addon-api": "^2.0.0", @@ -7461,6 +7687,33 @@ } } }, + "libp2p-crypto-secp256k1": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/libp2p-crypto-secp256k1/-/libp2p-crypto-secp256k1-0.3.1.tgz", + "integrity": "sha512-evrfK/CeUSd/lcELUdDruyPBvxDmLairth75S32OLl3H+++2m2fV24JEtxzdFS9JH3xEFw0h6JFO8DBa1bP9dA==", + "requires": { + "async": "^2.6.2", + "bs58": "^4.0.1", + "multihashing-async": "~0.6.0", + "nodeify": "^1.0.1", + "safe-buffer": "^5.1.2", + "secp256k1": "^3.6.2" + }, + "dependencies": { + "multihashing-async": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/multihashing-async/-/multihashing-async-0.6.0.tgz", + "integrity": "sha512-Qv8pgg99Lewc191A5nlXy0bSd2amfqlafNJZmarU6Sj7MZVjpR94SCxQjf4DwPtgWZkiLqsjUQBXA2RSq+hYyA==", + "requires": { + "blakejs": "^1.1.0", + "js-sha3": "~0.8.0", + "multihashes": "~0.4.13", + "murmurhash3js": "^3.0.1", + "nodeify": "^1.0.1" + } + } + } + }, "libp2p-delegated-content-routing": { "version": "0.4.5", "resolved": "https://registry.npmjs.org/libp2p-delegated-content-routing/-/libp2p-delegated-content-routing-0.4.5.tgz", @@ -7473,6 +7726,42 @@ "p-defer": "^3.0.0", "p-queue": "^6.3.0", "peer-info": "^0.17.5" + }, + "dependencies": { + "ipfs-http-client": { + "version": "44.0.1", + "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-44.0.1.tgz", + "integrity": "sha512-+QG9RdfB+tatxLoZCohVslDrFpmVK622fWbWwRPo5tQE/5ZAvXXxasgWuc1M3BvXkSIDvhFqf6lIdNawRfuMhA==", + "requires": { + "abort-controller": "^3.0.0", + "bignumber.js": "^9.0.0", + "bs58": "^4.0.1", + "buffer": "^5.4.2", + "cids": "^0.8.0", + "debug": "^4.1.0", + "form-data": "^3.0.0", + "ipfs-block": "^0.8.1", + "ipfs-core-utils": "^0.2.0", + "ipfs-utils": "^2.2.0", + "ipld-dag-cbor": "^0.15.1", + "ipld-dag-pb": "^0.18.3", + "ipld-raw": "^4.0.1", + "iso-url": "^0.4.7", + "it-tar": "^1.2.1", + "it-to-buffer": "^1.0.0", + "it-to-stream": "^0.1.1", + "merge-options": "^2.0.0", + "multiaddr": "^7.2.1", + "multiaddr-to-uri": "^5.1.0", + "multibase": "^0.7.0", + "multicodec": "^1.0.0", + "multihashes": "^0.4.14", + "nanoid": "^3.0.2", + "node-fetch": "^2.6.0", + "parse-duration": "^0.1.2", + "stream-to-it": "^0.2.0" + } + } } }, "libp2p-delegated-peer-routing": { @@ -7485,6 +7774,42 @@ "p-queue": "^6.3.0", "peer-id": "^0.13.11", "peer-info": "^0.17.5" + }, + "dependencies": { + "ipfs-http-client": { + "version": "44.0.1", + "resolved": "https://registry.npmjs.org/ipfs-http-client/-/ipfs-http-client-44.0.1.tgz", + "integrity": "sha512-+QG9RdfB+tatxLoZCohVslDrFpmVK622fWbWwRPo5tQE/5ZAvXXxasgWuc1M3BvXkSIDvhFqf6lIdNawRfuMhA==", + "requires": { + "abort-controller": "^3.0.0", + "bignumber.js": "^9.0.0", + "bs58": "^4.0.1", + "buffer": "^5.4.2", + "cids": "^0.8.0", + "debug": "^4.1.0", + "form-data": "^3.0.0", + "ipfs-block": "^0.8.1", + "ipfs-core-utils": "^0.2.0", + "ipfs-utils": "^2.2.0", + "ipld-dag-cbor": "^0.15.1", + "ipld-dag-pb": "^0.18.3", + "ipld-raw": "^4.0.1", + "iso-url": "^0.4.7", + "it-tar": "^1.2.1", + "it-to-buffer": "^1.0.0", + "it-to-stream": "^0.1.1", + "merge-options": "^2.0.0", + "multiaddr": "^7.2.1", + "multiaddr-to-uri": "^5.1.0", + "multibase": "^0.7.0", + "multicodec": "^1.0.0", + "multihashes": "^0.4.14", + "nanoid": "^3.0.2", + "node-fetch": "^2.6.0", + "parse-duration": "^0.1.2", + "stream-to-it": "^0.2.0" + } + } } }, "libp2p-floodsub": { @@ -7548,13 +7873,14 @@ } }, "libp2p-kad-dht": { - "version": "0.18.6", - "resolved": "https://registry.npmjs.org/libp2p-kad-dht/-/libp2p-kad-dht-0.18.6.tgz", - "integrity": "sha512-uYoJF6BR0B+8w6/lRqDpVleEqWWv7gd4rign/fkP0zmdD5DYrUYu78NsPVxyXH1UZ5LGwM3xJs9OqMrBt+sqXA==", + "version": "0.18.7", + "resolved": "https://registry.npmjs.org/libp2p-kad-dht/-/libp2p-kad-dht-0.18.7.tgz", + "integrity": "sha512-qaePQ+hS/1mFsot9HquGETvHhSmiyznyV+UOlHsTdhfUTu5bZEeTefoQDqJZBeZCi1IaEJi1e3Ep+IFJsJFpbg==", "requires": { "abort-controller": "^3.0.0", "async": "^2.6.2", "base32.js": "~0.1.0", + "buffer": "^5.6.0", "cids": "~0.8.0", "debug": "^4.1.1", "err-code": "^2.0.0", @@ -7565,7 +7891,7 @@ "it-pipe": "^1.1.0", "k-bucket": "^5.0.0", "libp2p-crypto": "~0.17.1", - "libp2p-interfaces": "^0.2.3", + "libp2p-interfaces": "^0.2.8", "libp2p-record": "~0.7.0", "multihashes": "~0.4.15", "multihashing-async": "~0.8.0", @@ -7650,11 +7976,11 @@ } }, "libp2p-record": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/libp2p-record/-/libp2p-record-0.7.2.tgz", - "integrity": "sha512-s7b3DCweCO6Vq5owk8qjiheUFmLRFfCIrUbFHBY4jdU4ZkP+ZmrAKhx+burPDbqQjhqs1swNJU4Ls77Uf+KY+w==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/libp2p-record/-/libp2p-record-0.7.3.tgz", + "integrity": "sha512-a6MrDeVqIkAUaDaiS3vWFu2OblpuBaBmY3bfQY+ZcEI/C2lWB0MixIby9RhrTmR+rqM+W3yoDLQa+clm1HVLhw==", "requires": { - "buffer-split": "^1.0.0", + "buffer": "^5.6.0", "err-code": "^2.0.0", "multihashes": "~0.4.15", "multihashing-async": "^0.8.0", @@ -7681,9 +8007,9 @@ } }, "libp2p-tcp": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.14.4.tgz", - "integrity": "sha512-7oU1ACrK6j5m3A08hrL7Ad0901shfljDtEk1Jdj3JWfQbUvvOIj8lzXUpMtwGZrNY5ar1gVCrH3zyHa4xohINw==", + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.14.5.tgz", + "integrity": "sha512-BLTtCe7jMYCfzrY1j4KAa3iByMZD5fgkH1bQ0WNCn/ye3w5mDemEgOT6+4p8/wuv2e0QXldGRB/DHUqB8lyNFw==", "requires": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", @@ -7708,13 +8034,14 @@ } }, "libp2p-webrtc-star": { - "version": "0.17.9", - "resolved": "https://registry.npmjs.org/libp2p-webrtc-star/-/libp2p-webrtc-star-0.17.9.tgz", - "integrity": "sha512-bbk/nbft26j2aOuBDi37ovdHUWmMqW7/O/EoIgZWK9K4CCy1YOussEcjFMSezKVVjlB6SUn97U3AojHv12EhUA==", + "version": "0.17.10", + "resolved": "https://registry.npmjs.org/libp2p-webrtc-star/-/libp2p-webrtc-star-0.17.10.tgz", + "integrity": "sha512-9kJhfeu8t33V8dqsNCV5JkUPUMaUV4mw0rhSLeq5aXLAQ0nyxyGua6XdCNxW4Pz1tDMF0H24AAiH/0bnhmvHkQ==", "requires": { "@hapi/hapi": "^18.4.0", "@hapi/inert": "^5.2.2", "abortable-iterator": "^3.0.0", + "buffer": "^5.6.0", "class-is": "^1.1.0", "debug": "^4.1.1", "err-code": "^2.0.0", @@ -8121,30 +8448,17 @@ "brorand": "^1.0.1" } }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", - "dev": true - }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" }, "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "requires": { - "mime-db": "1.43.0" - }, - "dependencies": { - "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" - } + "mime-db": "1.44.0" } }, "mimic-fn": { @@ -8430,17 +8744,6 @@ } } }, - "mocha-headless-chrome": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/mocha-headless-chrome/-/mocha-headless-chrome-2.0.3.tgz", - "integrity": "sha512-U6aG6hGx6QV9Yi/fFhlW4muET7OdFjNXWv/MMiUHmEymndm7SubTnKgrvioFhpGG9NMK+kynqFVSvnTu7UPMcQ==", - "dev": true, - "requires": { - "args": "^5.0.0", - "mkdirp": "^0.5.1", - "puppeteer": "^1.17.0" - } - }, "mongo-unit": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/mongo-unit/-/mongo-unit-1.5.1.tgz", @@ -8943,6 +9246,11 @@ "p-defer": "^3.0.0" } }, + "murmurhash3js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/murmurhash3js/-/murmurhash3js-3.0.1.tgz", + "integrity": "sha1-Ppg+W0fCoG9DpxMXTn5DXKBEuZg=" + }, "murmurhash3js-revisited": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz", @@ -9094,6 +9402,15 @@ "process-on-spawn": "^1.0.0" } }, + "nodeify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nodeify/-/nodeify-1.0.1.tgz", + "integrity": "sha1-ZKtpp7268DzhB7TwM1yHwLnpGx0=", + "requires": { + "is-promise": "~1.0.0", + "promise": "~1.3.0" + } + }, "nopt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", @@ -9275,9 +9592,9 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", + "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=" }, "object-component": { "version": "0.0.3", @@ -9361,6 +9678,14 @@ "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==" }, + "optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "requires": { + "wordwrap": "~0.0.2" + } + }, "optional": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/optional/-/optional-0.1.4.tgz", @@ -9988,9 +10313,9 @@ } }, "portfinder": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz", - "integrity": "sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg==", + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.26.tgz", + "integrity": "sha512-Xi7mKxJHHMI3rIUrnm/jjUgwhbYMkp/XKEcZX3aG4BrumLpq3nmoQMX+ClYnDZnZ/New7IatC1no5RX0zo1vXQ==", "requires": { "async": "^2.6.2", "debug": "^3.1.1", @@ -10060,6 +10385,19 @@ "optional": "^0.1.3" } }, + "promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-1.3.0.tgz", + "integrity": "sha1-5cyaTIJ45GZP/twBx9qEhCsEAXU=", + "requires": { + "is-promise": "~1" + } + }, + "promise-nodeify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/promise-nodeify/-/promise-nodeify-3.0.1.tgz", + "integrity": "sha512-ghsSuzZXJX8iO7WVec2z7GI+Xk/EyiD+JZK7AZKhUqYfpLa/Zs4ylUD+CwwnKlG6G3HnkUPMAi6PO7zeqGKssg==" + }, "promise-timeout": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/promise-timeout/-/promise-timeout-1.3.0.tgz", @@ -10083,6 +10421,14 @@ "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.8.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } } }, "proper-lockfile": { @@ -10101,9 +10447,9 @@ "integrity": "sha512-G/2kcamPF2S49W5yaMGdIpkG6+5wZF0fzBteLKgEHjbNzqjZQ85aAs1iJGto31EJaSTkNvHs5IXuHSaTLWBAiA==" }, "protons": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/protons/-/protons-1.0.2.tgz", - "integrity": "sha512-PexfP8Vh9pLMa5jUWJZLqofoQYmLUTrqLYAtqNoxwgm2ixxqLQz2BHJ7XEPCS4ZhTx/n5MXWpcT6P91oM+mgOQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/protons/-/protons-1.2.0.tgz", + "integrity": "sha512-V6wwlbbgZ6qtqd1zRSk7HqvwkoadmeNntUlqd1On9vHyC1tPI6H8GJotfup+9hG2FsDQK+MctaLrSouyunfxNg==", "requires": { "buffer": "^5.5.0", "protocol-buffers-schema": "^3.3.1", @@ -10111,12 +10457,6 @@ "varint": "^5.0.0" } }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -10153,6 +10493,19 @@ "safe-buffer": "^5.1.2" } }, + "pull-stream": { + "version": "3.6.14", + "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.14.tgz", + "integrity": "sha512-KIqdvpqHHaTUA2mCYcLG1ibEbu/LCKoJZsBWyv9lSYtPkJPBq8m3Hxa103xHi6D2thj5YXa0TqK3L3GUkwgnew==" + }, + "pull-stream-to-async-iterator": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pull-stream-to-async-iterator/-/pull-stream-to-async-iterator-1.0.2.tgz", + "integrity": "sha512-c3KRs2EneuxP7b6pG9fvQTIjatf33RbIErhbQ75s5r2MI6E8R74NZC1nJgXc8kcmqiQxmr+TWY+WwK2mWaUnlA==", + "requires": { + "pull-stream": "^3.6.9" + } + }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -10185,33 +10538,6 @@ "escape-goat": "^2.0.0" } }, - "puppeteer": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.20.0.tgz", - "integrity": "sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ==", - "dev": true, - "requires": { - "debug": "^4.1.0", - "extract-zip": "^1.6.6", - "https-proxy-agent": "^2.2.1", - "mime": "^2.0.3", - "progress": "^2.0.1", - "proxy-from-env": "^1.0.0", - "rimraf": "^2.6.1", - "ws": "^6.1.0" - }, - "dependencies": { - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, "pushdata-bitcoin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz", @@ -10671,15 +10997,29 @@ "bn.js": "^4.11.1" } }, - "run-async": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", - "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", - "dev": true, + "rsa-pem-to-jwk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/rsa-pem-to-jwk/-/rsa-pem-to-jwk-1.1.3.tgz", + "integrity": "sha1-JF52vbfnI0z+58oDLTG1TDj6uY4=", + "requires": { + "object-assign": "^2.0.0", + "rsa-unpack": "0.0.6" + } + }, + "rsa-unpack": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/rsa-unpack/-/rsa-unpack-0.0.6.tgz", + "integrity": "sha1-9Q69VqYoN45jHylxYQJs6atO3bo=", "requires": { - "is-promise": "^2.1.0" + "optimist": "~0.3.5" } }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, "run-parallel": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", @@ -11222,13 +11562,12 @@ } }, "sqlite3": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.1.1.tgz", - "integrity": "sha512-CvT5XY+MWnn0HkbwVKJAyWEMfzpAPwnTiB3TobA5Mri44SrTovmmh499NPQP+gatkeOipqPlBLel7rn4E/PCQg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.2.0.tgz", + "integrity": "sha512-roEOz41hxui2Q7uYnWsjMOTry6TcNUNmp8audCx18gF10P2NknwdpF+E+HKvz/F2NvPKGGBF4NGc+ZPQ+AABwg==", "requires": { "nan": "^2.12.1", - "node-pre-gyp": "^0.11.0", - "request": "^2.87.0" + "node-pre-gyp": "^0.11.0" } }, "sshpk": { @@ -11251,9 +11590,19 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" } } }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" + }, "standard": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/standard/-/standard-12.0.1.tgz", @@ -11839,9 +12188,9 @@ } }, "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "type-check": { "version": "0.3.2", @@ -12176,6 +12525,11 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -12212,9 +12566,9 @@ } }, "ws": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", - "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.5.tgz", + "integrity": "sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA==" }, "xdg-basedir": { "version": "4.0.0", diff --git a/package.json b/package.json index 2c1f9a4..5b2e9e8 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,11 @@ "license": "ISC", "dependencies": { "fruitdown": "^1.0.2", - "go-ipfs-dep": "~0.4.23-3", + "go-ipfs-dep": "~0.5.0", "ipfs": "~0.43.0", - "ipfs-http-client": "^44.0.0", + "ipfs-http-client": "~41.0.1", "ipfs-repo": "^1.0.1", - "ipfsd-ctl": "^3.1.0", + "ipfsd-ctl": "^4.0.1", "js-combinatorics": "^0.5.5", "jsondown": "^1.0.0", "localstorage-down": "^0.6.7", @@ -41,7 +41,6 @@ "devDependencies": { "assert": "^2.0.0", "mocha": "^6.2.2", - "mocha-headless-chrome": "^2.0.3", "nyc": "^15.0.1", "standard": "^12.0.1" } diff --git a/test/start-stop.spec.js b/test/start-stop.spec.js deleted file mode 100644 index 4cd4c9b..0000000 --- a/test/start-stop.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -const { - startIpfs, - stopIpfs, - testApis -} = require('../') - -describe.skip('Start and stop (deprecated)', function () { - Object.keys(testApis).forEach((api) => { - let ipfsd - - it(`starts a ${api} node`, async () => { - ipfsd = await startIpfs(api) - }) - - it(`stops an ${api} node`, async () => { - await stopIpfs(ipfsd.api) - }) - }) -}) diff --git a/test/workflow.spec.js b/test/workflow.spec.js deleted file mode 100644 index 1a1d03e..0000000 --- a/test/workflow.spec.js +++ /dev/null @@ -1,104 +0,0 @@ -const { - ipfsFactory, - connectPeers, - waitForPeers, - getIpfsPeerId -} = require('../') - -const assert = require('assert') - -describe('Manual workflow', function () { - before(() => {}) - - it('creates a ipfsFactory with the correct options', () => { - assert(ipfsFactory.opts.test) - assert(ipfsFactory.opts.disposable) - assert(ipfsFactory.opts.type === 'proc') - }) - - it('manually spawns an in-process node', async () => { await ipfsFactory.spawn() }) - it('manually spawns a go node', async () => { await ipfsFactory.spawn({ type: 'go' }) }) - it('manually spawns a go node with pubsub', async () => { - const ipfs = await ipfsFactory.spawnApi({ type: 'go' }) - await ipfs.pubsub.ls() - }) - - it('manually spawns two nodes and then connects them', async () => { - const jsIpfs = await ipfsFactory.spawnApi() - const goIpfs = await ipfsFactory.spawnApi({ type: 'go' }) - - await connectPeers(jsIpfs, goIpfs) - }) - - // TODO: This is pretty flaky, need to find out why and fix - it('manually spawns two nodes and waits for them to connect', async () => { - const topic = 'test-topic' - const jsIpfs = await ipfsFactory.spawnApi() - const goIpfs = await ipfsFactory.spawnApi({ type: 'go' }) - - const goIpfsId = await getIpfsPeerId(goIpfs) - - await connectPeers(jsIpfs, goIpfs) - - await jsIpfs.pubsub.subscribe(topic, () => {}) - await goIpfs.pubsub.subscribe(topic, () => {}) - - await waitForPeers(jsIpfs, [goIpfsId], topic) - - await jsIpfs.pubsub.unsubscribe(topic) - await goIpfs.pubsub.unsubscribe(topic) - }) - - it('manually spawns two nodes and times out if they never connect', (done) => { - (async () => { - const jsIpfs = await ipfsFactory.spawn() - const goIpfs = await ipfsFactory.spawn({ type: 'go' }) - - const goIpfsId = await getIpfsPeerId(goIpfs.api) - - waitForPeers(jsIpfs.api, [goIpfsId], null).catch(() => { - assert(true) - done() - }) - })() - }) -}) - -describe('localSwarm workflow', function () { - this.timeout(10000) - - it('throws an error if localSwarm is called without an array', (done) => { - ipfsFactory.localSwarm('foo').catch((e) => { - assert.strictEqual(e.message, 'localSwarm: First argument should be an array') - done() - }) - }) - - it('throws an error if localSwarm is called with an invalid IPFS type', (done) => { - ipfsFactory.localSwarm(['French']).catch((e) => { - assert.strictEqual(e.message, 'French is not a valid ipfs type. Supported types are: proc, js, go') - done() - }) - }) - - // Test a random selection of 2 through 10 nodes - const availableTypes = ['proc', 'go'] - ;[2, 3, 4, 5, 6, 7, 8, 9, 10].forEach((length) => { - const randomType = () => availableTypes[(Math.floor(Math.random() * 2))] - const nodeTypes = Array.from({ length }, () => randomType()) - - it(`localSwarm (${length}): ${nodeTypes.join(', ')}`, async () => { - const nodes = await ipfsFactory.localSwarm(nodeTypes) - assert.strictEqual(nodes.length, length) - - for (const node of nodes) { - assert.strictEqual((await node.swarm.peers()).length, length - 1) - } - }) - }) - - afterEach(async () => { - await ipfsFactory.clean() - assert.strictEqual(ipfsFactory.controllers.length, 0) - }) -})