Skip to content

Commit

Permalink
chore: update peer store api
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Apr 23, 2020
1 parent 4fdaf0f commit 31b9069
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
"it-length-prefixed": "^3.0.0",
"it-pipe": "^1.1.0",
"it-pushable": "^1.4.0",
"libp2p": "^0.27.6",
"libp2p": "libp2p/js-libp2p#chore/deprecate-old-peer-store-api",
"libp2p-bootstrap": "^0.10.3",
"libp2p-floodsub": "^0.20.0",
"libp2p-gossipsub": "^0.2.1",
"libp2p-kad-dht": "^0.18.3",
"libp2p-kad-dht": "^0.19.0-pre.0",
"libp2p-mplex": "^0.9.3",
"libp2p-noise": "^1.0.0",
"libp2p-secio": "^0.12.2",
Expand Down
6 changes: 3 additions & 3 deletions src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class Daemon {
[PeerstoreRequest.Type.GET_PROTOCOLS]: function * (daemon) {
try {
const peerId = PeerId.createFromBytes(peerStore.id)
const peerInfo = daemon.libp2p.peerStore.get(peerId.toB58String())
const peerInfo = daemon.libp2p.peerStore.get(peerId)
const protos = Array.from(peerInfo.protocols)
yield OkResponse({ peerStore: { protos } })
} catch (err) {
Expand Down Expand Up @@ -282,7 +282,7 @@ class Daemon {
type: DHTResponse.Type.VALUE,
peer: {
id: peer.id.toBytes(),
addrs: peer.multiaddrs.toArray().map(m => m.buffer)
addrs: peer.multiaddrInfos.map(mi => mi.multiaddr.buffer)
}
}
})
Expand Down Expand Up @@ -311,7 +311,7 @@ class Daemon {
type: DHTResponse.Type.VALUE,
peer: {
id: provider.id.toBytes(),
addrs: provider.multiaddrs.toArray().map(m => m.buffer)
addrs: provider.multiaddrInfos.map(mi => mi.multiaddr.buffer)
}
})
}
Expand Down

0 comments on commit 31b9069

Please sign in to comment.