Gossipsub is an implementation of pubsub based on meshsub and floodsub. You can read the specification here.
npm install libp2p-gossipsub
const Gossipsub = require('libp2p-gossipsub')
const gsub = new Gossipsub(node)
gsub.start((err) => {
if (err) {
console.log('Upsy', err)
}
gsub.on('fruit', (data) => {
console.log(data)
})
gsub.subscribe('fruit')
gsub.publish('fruit', new Buffer('banana'))
})
This module is actively under development. Please check out the issues and submit PRs!
MIT © Protocol Labs