@daocasino/mock-ipfs
IPFS lib without IPFS :) just libp2p pubsub
Last updated 2 years ago by kellas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @daocasino/mock-ipfs 
SYNC missed versions from official npm registry.

mock-ipfs

This is fork js-ipfs without IPFS, only libp2p.
Сreated to easy use ipfs-pubsub-room interface

Use

const Room = require('ipfs-pubsub-room')
const IPFS = require('mock-ipfs')
const ipfs = new IPFS('/ip4/0.0.0.0/tcp/0', {
  config: {
      EXPERIMENTAL: {
        pubsub: true
      }
  }
})
// libp2p node is ready, so we can start using ipfs-pubsub-room
ipfs.on('ready', () => {
  const room = Room(ipfs, 'room-name')

  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!')
  })
})

Current Tags

  • 0.2.8                                ...           latest (2 years ago)

7 Versions

  • 0.2.8                                ...           2 years ago
  • 0.2.7                                ...           2 years ago
  • 0.2.6                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (19)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |