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

Commit

Permalink
feat: new libp2p-api
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 27, 2017
1 parent 670662e commit 7bf75d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"hapi-set-header": "^1.0.2",
"hoek": "^4.1.0",
"ipfs-api": "^13.0.0",
"ipfs-bitswap": "~0.10.0",
"ipfs-bitswap": "~0.11.0",
"ipfs-block": "~0.6.0",
"ipfs-block-service": "~0.9.0",
"ipfs-multipart": "~0.1.0",
Expand All @@ -112,9 +112,9 @@
"ipld-resolver": "~0.11.0",
"isstream": "^0.1.2",
"joi": "^10.3.1",
"libp2p-floodsub": "~0.7.5",
"libp2p-ipfs-browser": "~0.20.1",
"libp2p-ipfs-nodejs": "~0.20.1",
"libp2p-floodsub": "~0.8.0",
"libp2p-ipfs-browser": "~0.21.0",
"libp2p-ipfs-nodejs": "~0.21.0",
"lodash.flatmap": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.has": "^4.5.2",
Expand All @@ -127,9 +127,9 @@
"multihashes": "~0.4.5",
"once": "^1.4.0",
"path-exists": "^3.0.0",
"peer-book": "~0.3.1",
"peer-id": "~0.8.4",
"peer-info": "~0.8.4",
"peer-book": "~0.3.2",
"peer-id": "~0.8.5",
"peer-info": "~0.8.5",
"promisify-es6": "^1.0.2",
"pull-file": "^1.0.0",
"pull-paramap": "^1.2.1",
Expand Down Expand Up @@ -185,4 +185,4 @@
"tcme <hi@this-connect.me>",
"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>"
]
}
}
4 changes: 2 additions & 2 deletions src/core/components/libp2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ module.exports = function libp2p (self) {
console.log('Swarm listening on', ma.toString())
})

self._libp2pNode.discovery.on('peer', (peerInfo) => {
self._libp2pNode.on('peer', (peerInfo) => {
if (self.isOnline()) {
self._peerInfoBook.put(peerInfo)
self._libp2pNode.dialByPeerInfo(peerInfo, () => {})
self._libp2pNode.dial(peerInfo, () => {})
}
})
self._libp2pNode.swarm.on('peer-mux-established', (peerInfo) => {
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = function swarm (self) {
maddr = multiaddr(maddr)
}

self._libp2pNode.dialByMultiaddr(maddr, callback)
self._libp2pNode.dial(maddr, callback)
}),

disconnect: promisify((maddr, callback) => {
Expand All @@ -85,7 +85,7 @@ module.exports = function swarm (self) {
maddr = multiaddr(maddr)
}

self._libp2pNode.hangUpByMultiaddr(maddr, callback)
self._libp2pNode.hangUp(maddr, callback)
}),

filters: promisify((callback) => {
Expand Down

0 comments on commit 7bf75d1

Please sign in to comment.