How to use ipfs-daemon - 1 common examples

To help you get started, we’ve selected a few ipfs-daemon 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 orbitdb / orbit-web / src / stores / IpfsDaemonStore.js View on Github external
settings.OrbitDataDir + '/ipfs',
        settings.OrbitDataDir
      )
      settings.IpfsDataDir = path.join(settings.IpfsDataDir, '/' + user, '/ipfs')
    }

    settings.OrbitDataDir = path.join(settings.OrbitDataDir, '/' + user)

    this.settings = Object.assign({}, settings)

    if (this.isElectron) {
      logger.debug('start electron ipfs-daemon')
      ipcRenderer.send('ipfs-daemon-start', settings)
    } else {
      logger.debug('start js-ipfs')
      this.ipfs = new IPFS(this.settings)
      this.ipfs.on('ready', () => {
        // interop tests
        // this.ipfs.swarm.connect('/ip4/127.0.0.1/tcp/32333/ws/ipfs/QmZbaYW1gYMRPag1K4ssaCuyJhuBu5tGKvETz7DnGFnykp')
        //   .then((res) => {
        //     console.log("swarm.connect to /ip4/127.0.0.1/tcp/32333/ws/ipfs/QmZbaYW1gYMRPag1K4ssaCuyJhuBu5tGKvETz7DnGFnykp", res)
        //   })
        //   .catch((err) => {
        //     console.error("swarm.connect", err)
        //   })
        IpfsDaemonActions.daemonStarted(this.ipfs)
      })
      this.ipfs.on('error', e => logger.error(e))
    }
  },
  onStop: function () {

ipfs-daemon

JavaScript implementation of the IPFS specification

Apache-2.0 OR MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Popular ipfs-daemon functions