All Projects → ipfs-shipyard → Ipfs Pubsub Room

ipfs-shipyard / Ipfs Pubsub Room

Licence: mit
IPFS Pubsub room

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ipfs Pubsub Room

awesome-orbitdb
Useful resources for using OrbitDB and building projects on it
Stars: ✭ 87 (-62.01%)
Mutual labels:  ipfs, decentralized, p2p
Unstoppable Wallet Android
A secure and decentralized Bitcoin and other cryptocurrency wallet for Android phones. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 165 (-27.95%)
Mutual labels:  p2p, ipfs, decentralized
Awesome Decentralized
🕶 Awesome list of distributed, decentralized, p2p apps and tools 👍
Stars: ✭ 358 (+56.33%)
Mutual labels:  p2p, ipfs, decentralized
field-manual
The Offical User's Guide to OrbitDB
Stars: ✭ 178 (-22.27%)
Mutual labels:  ipfs, decentralized, p2p
Peergos
A p2p, secure file storage, social network and application protocol
Stars: ✭ 895 (+290.83%)
Mutual labels:  p2p, ipfs, decentralized
ipvpn
[WIP] Easy-to-use decentralized secure overlay private network (for any device)
Stars: ✭ 24 (-89.52%)
Mutual labels:  ipfs, decentralized, p2p
Unstoppable Wallet Ios
A secure and decentralized Bitcoin and other cryptocurrency wallet for iPhone. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 180 (-21.4%)
Mutual labels:  p2p, ipfs, decentralized
Fluence
Peer-to-peer computing protocol and licensing system
Stars: ✭ 453 (+97.82%)
Mutual labels:  p2p, peer, decentralized
Rust Ipfs
The InterPlanetary File System (IPFS), implemented in Rust.
Stars: ✭ 739 (+222.71%)
Mutual labels:  p2p, ipfs, decentralized
Orbit Db
Peer-to-Peer Databases for the Decentralized Web
Stars: ✭ 6,381 (+2686.46%)
Mutual labels:  p2p, ipfs, decentralized
pop
Run a point-of-presence within Myel, the community powered content delivery network.
Stars: ✭ 28 (-87.77%)
Mutual labels:  ipfs, decentralized, p2p
Orion
[Moved to Gitlab] Easy to Use, Inter Planetary File System (IPFS) desktop client
Stars: ✭ 115 (-49.78%)
Mutual labels:  p2p, ipfs, decentralized
ipfs-chat
Real-time P2P messenger using go-ipfs pubsub. TUI. End-to-end encrypted texting & file-sharing. NAT traversal.
Stars: ✭ 84 (-63.32%)
Mutual labels:  ipfs, decentralized, peer
Wikipedia Ipfs
An exploration to host Wikipedia in IPFS
Stars: ✭ 158 (-31%)
Mutual labels:  p2p, ipfs, decentralized
Js Ipfs
IPFS implementation in JavaScript
Stars: ✭ 6,129 (+2576.42%)
Mutual labels:  p2p, ipfs, decentralized
Js Dag Service
Library for storing and replicating hash-linked data over the IPFS network.
Stars: ✭ 81 (-64.63%)
Mutual labels:  p2p, ipfs, decentralized
Peer Base
Build real-time collaborative DApps on top of IPFS
Stars: ✭ 208 (-9.17%)
Mutual labels:  ipfs, peer, decentralized
Gym Fx
Forex trading simulator environment for OpenAI Gym, observations contain the order status, performance and timeseries loaded from a CSV file containing rates and indicators. Work In Progress
Stars: ✭ 151 (-34.06%)
Mutual labels:  p2p, decentralized
Space Daemon
The Space Daemon packages together IPFS, Textile Threads/Buckets, and Textile Powergate (Filecoin*) into one easy to install Daemon to make it easy to build peer to peer and privacy focused apps.
Stars: ✭ 151 (-34.06%)
Mutual labels:  p2p, ipfs
Meshenger Android
P2P Audio/Video calls over local networks. No server or Internet access needed.
Stars: ✭ 152 (-33.62%)
Mutual labels:  p2p, decentralized

ipfs-pubsub-room

made by Protocol Labs Freenode Build Status

Creates a room based on a LibP2P pub-sub channel. Emits membership events, listens for messages, broadcast and direct messeges to peers.

(Demo video)

Install

$ npm install ipfs-pubsub-room

Use

Creating a pubsub room from a LibP2P node

const Room = require('ipfs-pubsub-room')
const Libp2p = require('libp2p')

const libp2p = new Libp2p({ ... })
await libp2p.start()

// libp2p node is ready, so we can start using ipfs-pubsub-room
const room = Room(libp2p, 'room-name')

Creating a pubsub room from an IPFS node

const Room = require('ipfs-pubsub-room')
const IPFS = require('ipfs')

const ipfs = await IPFS.create({ ... })
const room = Room(ipfs, 'room-name')

Once we have a room we can listen for messages

room.on('peer joined', (peer) => {
  console.log('Peer joined the room', peer)
})

room.on('peer left', (peer) => {
  console.log('Peer left...', peer)
})

// now started to listen to room
room.on('subscribed', () => {
  console.log('Now connected!')
})

API

Room (libp2p:LibP2P, roomName:string, options:object)

  • libp2p: LibP2P node. Must have pubsub activated
  • roomName: string, global identifier for the room
  • options: object:
    • pollInterval: interval for polling the pubsub peers, in ms. Defaults to 1000.
const room = Room(libp2p, 'some-room-name')

room.broadcast(message)

Broacasts message (string or buffer).

room.sendTo(cid, message)

Sends message (string or buffer) to peer.

async room.leave()

Leaves room, stopping everything.

room.getPeers()

Returns an array of peer identifiers (strings).

room.hasPeer(cid)

Returns a boolean indicating if the given peer is present in the room.

room.on('message', (message) => {})

Listens for messages. A message is an object containing the following properties:

  • from (string): peer id
  • data (Buffer): message content

room.on('peer joined', (cid) => {})

Once a peer has joined the room.

room.on('peer left', (cid) => {})

Once a peer has left the room.

room.on('subscribed',() => {})

Once your program has subscribed the topic and announced through IPFS pubsub.

License

ISC

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].