From b31285eaecb602d39569ef2bf007f9563709793b Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 16 Apr 2021 17:42:50 +0100 Subject: [PATCH] chore: update multiaddr Pulls in new multiaddr --- package.json | 2 +- src/ipfsd-client.js | 8 ++++---- src/ipfsd-daemon.js | 8 ++++---- src/ipfsd-in-proc.js | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 5c42c7eb..e8e6cd8d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "ipfs-utils": "^6.0.6", "joi": "^17.2.1", "merge-options": "^3.0.1", - "multiaddr": "^8.0.0", + "multiaddr": "^9.0.1", "nanoid": "^3.1.3", "p-wait-for": "^3.1.0", "temp-write": "^4.0.0" diff --git a/src/ipfsd-client.js b/src/ipfsd-client.js index 86fcb365..f5d9dc80 100644 --- a/src/ipfsd-client.js +++ b/src/ipfsd-client.js @@ -1,6 +1,6 @@ 'use strict' -const multiaddr = require('multiaddr') +const { Multiaddr } = require('multiaddr') const http = require('ipfs-utils/src/http') const merge = require('merge-options').bind({ ignoreUndefined: true }) const debug = require('debug') @@ -47,7 +47,7 @@ class Client { */ _setApi (addr) { if (addr) { - this.apiAddr = multiaddr(addr) + this.apiAddr = new Multiaddr(addr) } } @@ -57,7 +57,7 @@ class Client { */ _setGateway (addr) { if (addr) { - this.gatewayAddr = multiaddr(addr) + this.gatewayAddr = new Multiaddr(addr) } } @@ -67,7 +67,7 @@ class Client { */ _setGrpc (addr) { if (addr) { - this.grpcAddr = multiaddr(addr) + this.grpcAddr = new Multiaddr(addr) } } diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 6cf19ff4..2546b23a 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -1,6 +1,6 @@ 'use strict' -const multiaddr = require('multiaddr') +const { Multiaddr } = require('multiaddr') const fs = require('fs-extra') const merge = require('merge-options').bind({ ignoreUndefined: true }) const debug = require('debug') @@ -58,7 +58,7 @@ class Daemon { * @param {string} addr */ _setApi (addr) { - this.apiAddr = multiaddr(addr) + this.apiAddr = new Multiaddr(addr) } /** @@ -66,7 +66,7 @@ class Daemon { * @param {string} addr */ _setGrpc (addr) { - this.grpcAddr = multiaddr(addr) + this.grpcAddr = new Multiaddr(addr) } /** @@ -74,7 +74,7 @@ class Daemon { * @param {string} addr */ _setGateway (addr) { - this.gatewayAddr = multiaddr(addr) + this.gatewayAddr = new Multiaddr(addr) } _createApi () { diff --git a/src/ipfsd-in-proc.js b/src/ipfsd-in-proc.js index f093b544..431e4bb8 100644 --- a/src/ipfsd-in-proc.js +++ b/src/ipfsd-in-proc.js @@ -1,6 +1,6 @@ 'use strict' -const multiaddr = require('multiaddr') +const { Multiaddr } = require('multiaddr') const merge = require('merge-options').bind({ ignoreUndefined: true }) const { repoExists, removeRepo, checkForRunningApi, tmpDir, defaultRepo } = require('./utils') const debug = require('debug') @@ -52,7 +52,7 @@ class InProc { * @param {string} addr */ _setApi (addr) { - this.apiAddr = multiaddr(addr) + this.apiAddr = new Multiaddr(addr) this.api = this.opts.ipfsHttpModule.create(addr) this.api.apiHost = this.apiAddr.nodeAddress().address this.api.apiPort = this.apiAddr.nodeAddress().port @@ -63,7 +63,7 @@ class InProc { * @param {string} addr */ _setGateway (addr) { - this.gatewayAddr = multiaddr(addr) + this.gatewayAddr = new Multiaddr(addr) this.api.gatewayHost = this.gatewayAddr.nodeAddress().address this.api.gatewayPort = this.gatewayAddr.nodeAddress().port }