Skip to content

JGAntunes/js-pulsarcast

Repository files navigation

pipeline status coverage report

JS Pulsarcast

A JS implementation of Pulsarcast

Keep in mind that this module is quite alpha 🔨

Install

npm install pulsarcast

Usage

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())
    })
  })
})

API

Check the API documentation

Notes

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 👍

Performance and Metrics

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.

Supporters

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.

License

MIT