-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
I was following the demo video on youtube: https://www.youtube.com/watch?v=Nv_Teb--1zg
But when I add a room in my code and test it. The console gives no reactions when another peer joined the room.
Here's my code:
const IPFS = require('ipfs')
const Room = require('ipfs-pubsub-room')
const ipfs = new IPFS({
repo: repo(),
EXPERIMENTAL: {
pubsub : true
}
})
ipfs.once('ready', () => ipfs.id((err,info) => {
if (err) {throw err}
console.log('IPFS is ready with the address ' + info.id)
}))
const room = Room(ipfs, 'ipfs-pubsub-room-demo')
console.log(room.id)
room.on('peer joined', (peer) => console.log('some peer '+ peer +' has joined'))
room.on('peer left', (peer) => console.log('some peer '+ peer +' has left'))
function repo () {
return 'ipfs/pubsub-demo/' + Math.random()
}
And when I test the code on Chrome, the console only gives the ID of the node, but no messages like 'some peer XXXX has joined.'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels