orbit-db-pubsub

v0.6.2-b0abeb4.0
Message propagation module for orbit-db
orbitdb orbit-db pubsub

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

Metadata

  • MIT
  • Whatever
  • Haad
  • released 1/8/2023

Downloads