How to use the interface-ipfs-core.block 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 / js-ipfs-http-client-lite / test / interface.spec.js View on Github external
tests.bitswap(defaultCommon, {
    skip: [
      // bitswap.stat
      {
        name: 'should not get bitswap stats when offline',
        reason: 'FIXME go-ipfs returns an error https://github.com/ipfs/go-ipfs/issues/4078'
      },
      // bitswap.wantlist
      {
        name: 'should not get the wantlist when offline',
        reason: 'FIXME go-ipfs returns an error https://github.com/ipfs/go-ipfs/issues/4078'
      }
    ]
  })

  tests.block(defaultCommon, {
    skip: [{
      name: 'should get a block added as CIDv1 with a CIDv0',
      reason: 'LITE: TODO: version param needs to be removed - not implemented in go-ipfs and not valid'
    }]
  })

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

  tests.config(defaultCommon, {
    // skip: [
    //   // config.replace
    //   {
    //     name: 'replace',
    //     reason: 'FIXME Waiting for fix on go-ipfs https://github.com/ipfs/js-ipfs-http-client/pull/307#discussion_r69281789 and https://github.com/ipfs/go-ipfs/issues/2927'
    //   }
    // ]
github ipfs / js-ipfs-http-client / test / interface.spec.js View on Github external
const commonOptions = {
    test: true,
    ipfsHttpModule: {
      path: require.resolve('../src'),
      ref: require('../src')
    },
    ipfsOptions: {
      pass: 'ipfs-is-awesome-software'
    },
    ipfsBin: findBin('go')
  }
  const commonFactory = createFactory(commonOptions)

  tests.bitswap(commonFactory)

  tests.block(commonFactory, {
    skip: [{
      name: 'should get a block added as CIDv1 with a CIDv0',
      reason: 'go-ipfs does not support the `version` param'
    }]
  })

  tests.bootstrap(commonFactory)

  tests.config(commonFactory, {
    skip: [
      // config.replace
      {
        name: 'replace',
        reason: 'FIXME Waiting for fix on go-ipfs https://github.com/ipfs/js-ipfs-http-client/pull/307#discussion_r69281789 and https://github.com/ipfs/go-ipfs/issues/2927'
      },
      {
github ipfs / js-ipfs / test / core / both / test-block.js View on Github external
const IPFSFactory = require('../../utils/factory-core')

let factory

const common = {
  setup: function (cb) {
    factory = new IPFSFactory()
    cb(null, factory)
  },
  teardown: function (cb) {
    factory.dismantle(cb)
  }
}

console.log('->')
test.block(common)
github ipfs-shipyard / ipfs-postmsg-proxy / test / integration / node.js View on Github external
let factory
const factoryOpts = process.env.IPFS_NODE_TYPE === 'go'
  ? { type: 'go' }
  : { type: 'proc', exec: require('ipfs') }

const common = {
  setup (cb) {
    factory = new IpfsFactory(factoryOpts)
    cb(null, factory)
  },
  teardown (cb) {
    factory.dismantle(cb)
  }
}

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 / test / http-api / interface / block.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.block(common)
github ipfs-shipyard / ipfs-postmsg-proxy / test / integration / browser.js View on Github external
const defaultCommonFactory = () => {
  let factory
  return {
    setup (cb) {
      factory = new IpfsFactory()
      cb(null, factory)
    },
    teardown (cb) {
      factory.dismantle(cb)
    }
  }
}

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

tests.block(defaultCommonFactory)

tests.bootstrap(defaultCommonFactory)

tests.config(defaultCommonFactory)

tests.dag(defaultCommonFactory)

tests.dht(defaultCommonFactory, {
  skip: { reason: 'TODO: DHT is not implemented in js-ipfs yet!' }
})

tests.files(defaultCommonFactory, {
  skip: [
    {
      name: 'should add pull stream (promised)',
      reason: 'https://github.com/ipfs/js-ipfs/issues/1574'
github ipfs / js-ipfs / test / core / interface / block.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.block(common)
github ipfs / js-ipfs / test / http-api / interface.js View on Github external
ref: require('ipfs-http-client')
    },
    ipfsOptions: {
      pass: 'ipfs-is-awesome-software'
    }
  }
  const overrides = {
    js: {
      ipfsBin: './src/cli/bin.js'
    }
  }
  const commonFactory = createFactory(commonOptions, overrides)

  tests.bitswap(commonFactory)

  tests.block(commonFactory)

  tests.bootstrap(commonFactory)

  tests.config(commonFactory)

  tests.dag(commonFactory, {
    skip: [{
      name: 'should get only a CID, due to resolving locally only',
      reason: 'Local resolve option is not implemented yet'
    }, {
      name: 'tree',
      reason: 'dag.tree is not implemented yet'
    }]
  })

  tests.dht(commonFactory, {
github ipfs / js-ipfs-http-client / test / interface / block.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.block(common)
github ipfs / js-ipfs / test / core / interface.spec.js View on Github external
ref: require('ipfs-http-client')
    },
    ipfsOptions: {
      pass: 'ipfs-is-awesome-software'
    }
  }
  const overrides = {
    js: {
      ipfsBin: './src/cli/bin.js'
    }
  }
  const commonFactory = createFactory(commonOptions, overrides)

  tests.bitswap(commonFactory)

  tests.block(commonFactory)

  tests.bootstrap(commonFactory)

  tests.config(commonFactory)

  tests.dag(commonFactory)

  tests.dht(commonFactory, {
    skip: {
      reason: 'TODO: unskip when DHT is enabled: https://github.com/ipfs/js-ipfs/pull/1994'
    }
  })

  tests.filesRegular(commonFactory, {
    skip: isNode ? null : [{
      name: 'addFromStream',