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

Commit 7bf75d1

Browse files
committed
feat: new libp2p-api
1 parent 670662e commit 7bf75d1

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"hapi-set-header": "^1.0.2",
103103
"hoek": "^4.1.0",
104104
"ipfs-api": "^13.0.0",
105-
"ipfs-bitswap": "~0.10.0",
105+
"ipfs-bitswap": "~0.11.0",
106106
"ipfs-block": "~0.6.0",
107107
"ipfs-block-service": "~0.9.0",
108108
"ipfs-multipart": "~0.1.0",
@@ -112,9 +112,9 @@
112112
"ipld-resolver": "~0.11.0",
113113
"isstream": "^0.1.2",
114114
"joi": "^10.3.1",
115-
"libp2p-floodsub": "~0.7.5",
116-
"libp2p-ipfs-browser": "~0.20.1",
117-
"libp2p-ipfs-nodejs": "~0.20.1",
115+
"libp2p-floodsub": "~0.8.0",
116+
"libp2p-ipfs-browser": "~0.21.0",
117+
"libp2p-ipfs-nodejs": "~0.21.0",
118118
"lodash.flatmap": "^4.5.0",
119119
"lodash.get": "^4.4.2",
120120
"lodash.has": "^4.5.2",
@@ -127,9 +127,9 @@
127127
"multihashes": "~0.4.5",
128128
"once": "^1.4.0",
129129
"path-exists": "^3.0.0",
130-
"peer-book": "~0.3.1",
131-
"peer-id": "~0.8.4",
132-
"peer-info": "~0.8.4",
130+
"peer-book": "~0.3.2",
131+
"peer-id": "~0.8.5",
132+
"peer-info": "~0.8.5",
133133
"promisify-es6": "^1.0.2",
134134
"pull-file": "^1.0.0",
135135
"pull-paramap": "^1.2.1",
@@ -185,4 +185,4 @@
185185
186186
"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <[email protected]>"
187187
]
188-
}
188+
}

src/core/components/libp2p.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ module.exports = function libp2p (self) {
3131
console.log('Swarm listening on', ma.toString())
3232
})
3333

34-
self._libp2pNode.discovery.on('peer', (peerInfo) => {
34+
self._libp2pNode.on('peer', (peerInfo) => {
3535
if (self.isOnline()) {
3636
self._peerInfoBook.put(peerInfo)
37-
self._libp2pNode.dialByPeerInfo(peerInfo, () => {})
37+
self._libp2pNode.dial(peerInfo, () => {})
3838
}
3939
})
4040
self._libp2pNode.swarm.on('peer-mux-established', (peerInfo) => {

src/core/components/swarm.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = function swarm (self) {
7373
maddr = multiaddr(maddr)
7474
}
7575

76-
self._libp2pNode.dialByMultiaddr(maddr, callback)
76+
self._libp2pNode.dial(maddr, callback)
7777
}),
7878

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

88-
self._libp2pNode.hangUpByMultiaddr(maddr, callback)
88+
self._libp2pNode.hangUp(maddr, callback)
8989
}),
9090

9191
filters: promisify((callback) => {

0 commit comments

Comments
 (0)