How to use the ipfsd-ctl.createServer 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 / js-ipfsd-ctl / examples / electron-asar / app.js View on Github external
ipcMain.on('start', async ({ sender }) => {
  console.log('starting disposable IPFS')
  sender.send('message', 'starting disposable IPFS')
  try {
    const s = createServer()
    await s.start()
    const node = await createNode({ type: 'go' })
    console.log('get id')
    sender.send('message', 'get id')

    const id = await node.api.id()
    console.log('got id', id)
    sender.send('id', JSON.stringify(id))
    await node.stop()
    await s.stop()
  } catch (error) {
    sender.send('id', JSON.stringify(error.message))
    console.log(error)
  }
})
github ipfs / js-ipfs-http-client / .aegir.js View on Github external
'use strict'

const createServer = require('ipfsd-ctl').createServer
const EchoServer = require('interface-ipfs-core/src/utils/echo-http-server')
const server = createServer()
const echoServer = EchoServer.createServer()

module.exports = {
  bundlesize: { maxSize: '246kB' },
  webpack: {
    resolve: {
      mainFields: ['browser', 'main']
    }
  },
  karma: {
    files: [{
      pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
      watched: false,
      served: true,
      included: false
    }],
github ipfs / js-ipfs / .aegir.js View on Github external
'use strict'

const IPFSFactory = require('ipfsd-ctl')
const MockPreloadNode = require('./test/utils/mock-preload-node')
const EchoServer = require('interface-ipfs-core/src/utils/echo-http-server')

const ipfsdServer = IPFSFactory.createServer()
const preloadNode = MockPreloadNode.createNode()
const echoServer = EchoServer.createServer()

module.exports = {
  bundlesize: { maxSize: '652kB' },
  webpack: {
    resolve: {
      mainFields: ['browser', 'main'],
      aliasFields: ['browser', 'browser-all-ipld-formats'],
    }
  },
  karma: {
    files: [{
      pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
      watched: false,
      served: true,