Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

orbit-db-pubsub

hajamark1.9kMITdeprecated0.7.0

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Message propagation module for orbit-db

orbitdb, orbit-db, pubsub

readme

orbit-db-pubsub

Gitter Matrix Discord npm version

Message propagation module for orbit-db

Default message propagation service for orbit-db. Uses IPFS pubsub.

Install

This project uses npm and nodejs.

npm install orbit-db-pubsub

Usage

API

subscribe(topic, onMessageHandler, onNewPeerHandler)

Listen for new messages in topic

onMessageHandler gets called when a message is received with signature (topic, data)

onNewPeerHandler gets called when a new peer joins with signature (topic, peer)

Returns a promise.

unsubscribe(topic)

Stop listening for new messages in topic

Returns a promise.

disconnect ()

Stop listening for new messages in all topics

Returns a promise.

publish(topic, data)

Publish data to a topic

Contributing

If you think this could be better, please open an issue!

Please note that all interactions in @orbitdb fall under our Code of Conduct.

License

MIT ©️ 2016-2018 Protocol Labs Inc., Haja Networks Oy