fix: discovery mechanism examples not working (#1365)

Co-authored-by: achingbrain <alex@achingbrain.net>- fixed tests that were passing even though the example isn't working
- added timeouts to avoid infinite wait

Fixes #1229
This commit is contained in:
Marin Petrunić
2022-09-05 16:17:35 +02:00
committed by GitHub
parent fc2224a1e8
commit d281a60dac
4 changed files with 14 additions and 9 deletions

View File

@ -67,7 +67,7 @@ const createNode = async (bootstrappers) => {
const peer = evt.detail
console.log(`Peer ${node1.peerId.toString()} discovered: ${peer.id.toString()}`)
})
node2.addEventListener('peer:discovery',(evt) => {
node2.addEventListener('peer:discovery', (evt) => {
const peer = evt.detail
console.log(`Peer ${node2.peerId.toString()} discovered: ${peer.id.toString()}`)
})
@ -77,4 +77,4 @@ const createNode = async (bootstrappers) => {
node1.start(),
node2.start()
])
})();
})()