How to use the ipfsd-ctl/src/utils.findBin function in ipfsd-ctl

To help you get started, we’ve selected a few ipfsd-ctl 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-webui / test / e2e / setup / global-init.js View on Github external
})
  const endpoint = process.env.E2E_API_URL
  let ipfsd
  let ipfs
  if (endpoint) {
    // create http client for endpoint passed via E2E_API_URL=
    ipfs = ipfsClient({ apiAddr: endpoint })
  } else {
    // use ipfds-ctl to spawn daemon to expose http api used for e2e tests
    const type = process.env.E2E_IPFSD_TYPE || 'go'
    const factory = Ctl.createFactory({
      type,
      test: true, // sets up all CORS headers required for accessing HTTP API port of ipfsd node
      overrides: { // call findBin here to ensure we use version from devDependencies, and not from ipfsd-ctl
        js: { ipfsBin: findBin('js') },
        go: { ipfsBin: findBin('go') }
      }
    })
    ipfsd = await factory.spawn()
    ipfs = ipfsd.api
  }
  const { id, agentVersion } = await ipfs.id()
  console.log(`\nE2E init: using ${agentVersion} with Peer ID ${id}${endpoint ? ' at ' + endpoint : ''}\n`)
  // store globals for later use
  global.__IPFSD__ = ipfsd
  global.__IPFS__ = ipfs
  global.__WEBUI_URL__ = `http://localhost:${webuiPort}/`
}
github ipfs-shipyard / ipfs-webui / test / e2e / setup / global-init.js View on Github external
debug: process.env.DEBUG === 'true'
  })
  const endpoint = process.env.E2E_API_URL
  let ipfsd
  let ipfs
  if (endpoint) {
    // create http client for endpoint passed via E2E_API_URL=
    ipfs = ipfsClient({ apiAddr: endpoint })
  } else {
    // use ipfds-ctl to spawn daemon to expose http api used for e2e tests
    const type = process.env.E2E_IPFSD_TYPE || 'go'
    const factory = Ctl.createFactory({
      type,
      test: true, // sets up all CORS headers required for accessing HTTP API port of ipfsd node
      overrides: { // call findBin here to ensure we use version from devDependencies, and not from ipfsd-ctl
        js: { ipfsBin: findBin('js') },
        go: { ipfsBin: findBin('go') }
      }
    })
    ipfsd = await factory.spawn()
    ipfs = ipfsd.api
  }
  const { id, agentVersion } = await ipfs.id()
  console.log(`\nE2E init: using ${agentVersion} with Peer ID ${id}${endpoint ? ' at ' + endpoint : ''}\n`)
  // store globals for later use
  global.__IPFSD__ = ipfsd
  global.__IPFS__ = ipfs
  global.__WEBUI_URL__ = `http://localhost:${webuiPort}/`
}
github ipfs / js-ipfs-http-client / test / interface.spec.js View on Github external
describe('interface-ipfs-core tests', () => {
  /** @type ControllerOptions */
  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: [
github ipfs / js-ipfs-http-client / test / utils / factory.js View on Github external
'use strict'
const { createFactory } = require('ipfsd-ctl')
const { findBin } = require('ipfsd-ctl/src/utils')

const factory = createFactory({
  test: 'true',
  type: 'go',
  ipfsBin: findBin('go'),
  ipfsHttpModule: {
    path: require.resolve('../../src'),
    ref: require('../../src')
  }
})

module.exports = factory