A JS implementation of Pulsarcast
Keep in mind that this module is quite alpha 🔨
npm install pulsarcast
const Pulsarcast = require('pulsarcast')
// node is Libp2p Node
const pulsarcastNode = new Pulsarcast(node)
const pulsarcastNode.start((err) => {
if (err) console.log('No!!!', err)
pulsarcastNode.createTopic('fuuuuun', (err, cid, topicNode) => {
if (err) console.log('No!!!', err)
console.log('Our new topic \o/', topicNode)
pulsarcastNode.on(cid.toBaseEncodedString(), (eventNode) => {
console.log('event', eventNode)
})
pulsarcastNode.publish(cid.toBaseEncodedString(), new Buffer('yolo!'), (err, eventCID) => {
if (err) console.log('No!!!', err)
console.log('published', eventCID.toBaseEncodedString())
})
})
})
Check the API documentation
Currently we're still relying on a couple of forks from libp2p
/ipfs
projects. Hence a lot of the git dependencies in the package.json
, specifically kad-dht
and js-libp2p
. The long term plan of course is to either merge the changes upstream or find alternative methods for our needs.
Browser support is still no guaranteed. All of the testing and development is currently being done on NodeJS only, although the plan is to have this done for the browser also 👍
We've tested this module under different scenarios for the purpose of our M.Sc. Thesis. For more info check our M.Sc. Thesis final document and our Pulsarcast Test Harness project.
This module and relevant work detailed in the Pulsarcast spec has been developed by me with the amazing support and supervision of Luís Veiga, in INESC-ID Lisboa (Distributed Systems Group) and Instituto Superior Técnico, Universidade de Lisboa
A special thank you note to Microsoft Azure for sponsoring the tests for this project by providing crucial infrastructure support.
MIT