@daocasino/mock-ipfs

    0.2.8 • Public • Published

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

    Install

    npm i @daocasino/mock-ipfs

    DownloadsWeekly Downloads

    2

    Version

    0.2.8

    License

    MIT

    Unpacked Size

    23.1 kB

    Total Files

    17

    Last publish

    Collaborators

    • whilesocold
    • dao-credentials
    • mixbytesgovyazin
    • algys
    • garik-