Skip to content

Commit

Permalink
fix: remove ipfs from identify multiaddrs
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Feb 14, 2019
1 parent a0ed23d commit 696f2a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ class Daemon {
enc.write(OkResponse({
identify: {
id: this.libp2p.peerInfo.id.toBytes(),
addrs: this.libp2p.peerInfo.multiaddrs.toArray().map(m => m.buffer)
// temporary removal of "/ipfs/..." from multiaddrs
// this will be solved in: https://github.com/libp2p/js-libp2p/issues/323
addrs: this.libp2p.peerInfo.multiaddrs.toArray().map(m => m.decapsulate('ipfs').buffer)
}
}))
break
Expand Down
3 changes: 2 additions & 1 deletion test/daemon.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ describe('daemon', () => {

const response = Response.decode(await stream.first())
expect(response.type).to.eql(Response.Type.OK)

expect(response.identify).to.eql({
id: daemon.libp2p.peerInfo.id.toBytes(),
addrs: daemon.libp2p.peerInfo.multiaddrs.toArray().map(m => m.buffer)
addrs: daemon.libp2p.peerInfo.multiaddrs.toArray().map(m => m.decapsulate('ipfs').buffer)
})
stream.end()
})
Expand Down

0 comments on commit 696f2a9

Please sign in to comment.