Skip to content

Commit 8d96a18

Browse files
authoredNov 22, 2021
feat: update dht (#384)
BREAKING CHANGE: uses 0.26.x of libp2p-kad-dht
1 parent 8daf48e commit 8d96a18

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed
 

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"iso-random-stream": "^2.0.0",
7272
"it-all": "^1.0.5",
7373
"it-drain": "^1.0.4",
74-
"libp2p": "^0.32.4",
75-
"libp2p-kad-dht": "^0.24.1",
74+
"libp2p": "libp2p/js-libp2p#feat/update-dht",
75+
"libp2p-kad-dht": "^0.26.1",
7676
"libp2p-mplex": "^0.10.2",
7777
"libp2p-tcp": "^0.17.1",
7878
"lodash.difference": "^4.5.0",

‎test/bitswap.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ import { BitswapMessage as Message } from '../src/message/index.js'
2222
*/
2323
async function createThing (dht) {
2424
const libp2pNode = await createLibp2pNode({
25-
DHT: dht
25+
DHT: dht,
26+
config: {
27+
dht: {
28+
clientMode: false
29+
}
30+
}
2631
})
2732
const bitswap = new Bitswap(libp2pNode, new MemoryBlockstore())
2833
bitswap.start()
@@ -182,9 +187,9 @@ describe('bitswap with DHT', function () {
182187

183188
// await dht routing table are updated
184189
await Promise.all([
185-
pWaitFor(() => nodes[0].libp2pNode._dht.routingTable.size >= 1),
186-
pWaitFor(() => nodes[1].libp2pNode._dht.routingTable.size >= 2),
187-
pWaitFor(() => nodes[2].libp2pNode._dht.routingTable.size >= 1)
190+
pWaitFor(() => nodes[0].libp2pNode._dht._lan._routingTable.size >= 1),
191+
pWaitFor(() => nodes[1].libp2pNode._dht._lan._routingTable.size >= 2),
192+
pWaitFor(() => nodes[2].libp2pNode._dht._lan._routingTable.size >= 1)
188193
])
189194
})
190195

0 commit comments

Comments
 (0)
Please sign in to comment.