Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 3b7309f

Browse files
committed
feat: create getters for peerInfo and peerBook
1 parent c7f447b commit 3b7309f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

examples/custom-libp2p/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const assert = require('assert')
2121
*/
2222
const libp2pFactory = (_ipfsNode, _ipfsConfig) => {
2323
// Set convenience variables to clearly showcase some of the useful things that are available
24-
const peerInfo = _ipfsNode._peerInfo
25-
const peerBook = _ipfsNode._peerBook
24+
const peerInfo = _ipfsNode.peerInfo
25+
const peerBook = _ipfsNode.peerBook
2626
const bootstrapList = _ipfsConfig.Bootstrap
2727

2828
// Create our WebSocketStar transport and give it our PeerId, straight from the ipfs node

src/core/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,20 @@ class IPFS extends EventEmitter {
153153

154154
boot(this)
155155
}
156+
157+
/**
158+
* @type {PeerBook}
159+
*/
160+
get peerBook () {
161+
return this._peerInfoBook
162+
}
163+
164+
/**
165+
* @type {PeerInfo}
166+
*/
167+
get peerInfo () {
168+
return this._peerInfo
169+
}
156170
}
157171

158172
exports = module.exports = IPFS

0 commit comments

Comments
 (0)