Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update multiaddr #628

Merged
merged 1 commit into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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