Skip to content

Commit

Permalink
chore: update multiaddr (#628)
Browse files Browse the repository at this point in the history
Pulls in new multiaddr
  • Loading branch information
achingbrain authored Apr 17, 2021
1 parent fdd717e commit 57308f2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions src/ipfsd-client.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -47,7 +47,7 @@ class Client {
*/
_setApi (addr) {
if (addr) {
this.apiAddr = multiaddr(addr)
this.apiAddr = new Multiaddr(addr)
}
}

Expand All @@ -57,7 +57,7 @@ class Client {
*/
_setGateway (addr) {
if (addr) {
this.gatewayAddr = multiaddr(addr)
this.gatewayAddr = new Multiaddr(addr)
}
}

Expand All @@ -67,7 +67,7 @@ class Client {
*/
_setGrpc (addr) {
if (addr) {
this.grpcAddr = multiaddr(addr)
this.grpcAddr = new Multiaddr(addr)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/ipfsd-daemon.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -58,23 +58,23 @@ class Daemon {
* @param {string} addr
*/
_setApi (addr) {
this.apiAddr = multiaddr(addr)
this.apiAddr = new Multiaddr(addr)
}

/**
* @private
* @param {string} addr
*/
_setGrpc (addr) {
this.grpcAddr = multiaddr(addr)
this.grpcAddr = new Multiaddr(addr)
}

/**
* @private
* @param {string} addr
*/
_setGateway (addr) {
this.gatewayAddr = multiaddr(addr)
this.gatewayAddr = new Multiaddr(addr)
}

_createApi () {
Expand Down
6 changes: 3 additions & 3 deletions src/ipfsd-in-proc.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 57308f2

Please sign in to comment.