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

Commit

Permalink
feat: create getters for peerInfo and peerBook
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun committed Jul 30, 2018
1 parent c964f08 commit 4ff95d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/custom-libp2p/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const assert = require('assert')
*/
const libp2pFactory = (_ipfsNode, _ipfsConfig) => {
// Set convenience variables to clearly showcase some of the useful things that are available
const peerInfo = _ipfsNode._peerInfo
const peerBook = _ipfsNode._peerBook
const peerInfo = _ipfsNode.peerInfo
const peerBook = _ipfsNode.peerBook
const bootstrapList = _ipfsConfig.Bootstrap

// Create our WebSocketStar transport and give it our PeerId, straight from the ipfs node
Expand Down
14 changes: 14 additions & 0 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ class IPFS extends EventEmitter {

boot(this)
}

/**
* @type {PeerBook}
*/
get peerBook() {
return this._peerInfoBook
}

/**
* @type {PeerInfo}
*/
get peerInfo() {
return this._peerInfo
}
}

exports = module.exports = IPFS
Expand Down

0 comments on commit 4ff95d6

Please sign in to comment.