How to use the interface-ipfs-core.pubsub function in interface-ipfs-core

To help you get started, we’ve selected a few interface-ipfs-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ipfs-shipyard / ipfs-postmsg-proxy / test / integration / browser.js View on Github external
{
      name: 'should resolve IPNS link recursively',
      reason: 'TODO IPNS not implemented yet'
    }
  ]
})

tests.name(defaultCommonFactory)

tests.object(defaultCommonFactory)

tests.pin(defaultCommonFactory)

tests.ping(defaultCommonFactory, { skip: true })

tests.pubsub(defaultCommonFactory, { skip: true })

tests.repo(defaultCommonFactory, {
  skip: [
    // repo.gc
    {
      name: 'gc',
      reason: 'TODO: repo.gc is not implemented in js-ipfs yet!'
    }
  ]
})

tests.stats(defaultCommonFactory)

tests.swarm(defaultCommonFactory, { skip: true })

tests.types(defaultCommonFactory, { skip: { reason: 'FIXME: currently failing' } })
github ipfs / js-ipfs-http-client / test / interface.spec.js View on Github external
{
        name: 'should fail when pinging an unknown peer over pull stream',
        reason: 'FIXME go-ipfs return success with text: Looking up peer '
      },
      {
        name: 'should fail when pinging peer that is not available over readable stream',
        reason: 'FIXME go-ipfs return success with text: Looking up peer '
      },
      {
        name: 'should fail when pinging a peer that is not available',
        reason: 'FIXME go-ipfs return success with text: Looking up peer '
      }
    ]
  })

  tests.pubsub(createFactory(commonOptions, {
    go: {
      args: ['--enable-pubsub-experiment']
    }
  }), {
    skip: isWindows ? [
      // pubsub.subscribe
      {
        name: 'should send/receive 100 messages',
        reason: 'FIXME https://github.com/ipfs/interface-ipfs-core/pull/188#issuecomment-354673246 and https://github.com/ipfs/go-ipfs/issues/4778'
      },
      {
        name: 'should receive multiple messages',
        reason: 'FIXME https://github.com/ipfs/interface-ipfs-core/pull/188#issuecomment-354673246 and https://github.com/ipfs/go-ipfs/issues/4778'
      }
    ] : null
  })
github ipfs-shipyard / js-ipfs-http-client-lite / test / interface.spec.js View on Github external
})

  tests.object(defaultCommon, { skip: { reason: 'LITE: not implemented yet' } })

  tests.pin(defaultCommon, { skip: { reason: 'LITE: not implemented yet' } })

  tests.ping(defaultCommon, {
    skip: [
      // TODO: LITE: add reason
      'should fail when pinging a peer that is not available',
      'pingReadableStream',
      'should fail when pinging an unknown peer over pull stream'
    ]
  })

  tests.pubsub(CommonFactory.create({
    spawnOptions: {
      args: ['--enable-pubsub-experiment'],
      initOptions: { bits: 1024, profile: 'test' }
    }
  }), {
    skip: [
      {
        name: 'should error on string messags',
        reason: 'LITE: revisit, allowed here'
      }
    ].concat(isNode ? [] : [
      {
        name: 'should subscribe and unsubscribe 10 times',
        reason: 'LITE: Max 6 open XHR requests in the browser - https://stackoverflow.com/questions/561046/how-many-concurrent-ajax-xmlhttprequest-requests-are-allowed-in-popular-browse'
      },
      {
github ipfs / js-ipfs / test / http-api / interface.js View on Github external
tests.namePubsub(createFactory(merge(commonOptions, {
    ipfsOptions: {
      EXPERIMENTAL: {
        ipnsPubsub: true
      }
    }
  }), overrides))

  tests.object(commonFactory)

  tests.pin(commonFactory)

  tests.ping(commonFactory)

  tests.pubsub(createFactory(commonOptions, merge(overrides, {
    go: {
      args: ['--enable-pubsub-experiment']
    }
  })))

  tests.repo(commonFactory)

  tests.stats(commonFactory)

  tests.swarm(commonFactory)
})
github ipfs / js-ipfs / test / core / interface / pubsub.js View on Github external
if (err) {
            return cb(err)
          }

          nodes.push(_ipfsd)
          cb(null, _ipfsd.api)
        })
      }
    })
  },
  teardown: function (callback) {
    parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
  }
}

test.pubsub(common)
github ipfs / js-ipfs / test / core / interface.spec.js View on Github external
}), overrides))

  tests.object(commonFactory, {
    skip: [
      {
        name: 'should respect timeout option',
        reason: 'js-ipfs doesn\'t support timeout yet'
      }
    ]
  })

  tests.pin(commonFactory)

  tests.ping(commonFactory)

  tests.pubsub(createFactory(commonOptions, merge(overrides, {
    go: {
      args: ['--enable-pubsub-experiment']
    }
  })), {
    skip: [
      {
        name: 'should receive messages from a different node',
        reason: 'https://github.com/ipfs/js-ipfs/issues/2662'
      },
      {
        name: 'should round trip a non-utf8 binary buffer',
        reason: 'https://github.com/ipfs/js-ipfs/issues/2662'
      },
      {
        name: 'should receive multiple messages',
        reason: 'https://github.com/ipfs/js-ipfs/issues/2662'
github ipfs-shipyard / ipfs-postmsg-proxy / test / integration / node.js View on Github external
}
}

test.block(common)
test.bootstrap(common)
test.config(common)
test.dag(common)
test.dht(common)
test.files(common)
test.filesMFS(common)
test.key(common)
test.miscellaneous(common)
test.object(common)
test.pin(common)
test.ping(common)
test.pubsub(common)
test.repo(common)
test.stats(common)
test.swarm(common)
github ipfs / js-ipfs-http-client / test / interface / pubsub.spec.js View on Github external
if (err) {
                return cb(err)
              }

              nodes.push(_ipfsd)
              cb(null, IPFSApi(_ipfsd.apiAddr))
            })
        }
      })
    },
    teardown: function (callback) {
      parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
    }
  }

  test.pubsub(common)
}
github ipfs / js-ipfs / test / http-api / interface / pubsub.js View on Github external
if (err) {
            return cb(err)
          }

          nodes.push(_ipfsd)
          cb(null, _ipfsd.api)
        })
      }
    })
  },
  teardown: function (callback) {
    parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
  }
}

test.pubsub(common)