Giter Club home page Giter Club logo

js-ipfs's Introduction

js-ipfs


https://github.com/ipfs/js-ipfs

npm install ipfs

npm install ipfs --global

npm install ipfs --global
jsipfs --help

npm install wrtc --global
npm install electron-webrtc --global

docker run -it -p 4002:4002 -p 4003:4003 -p 5002:5002 -p 9090:9090 ipfs/js-ipfs:latest

npm install
npm test
npm run test: node
npm run test:node:cre
npm run test:node:http
npm run test: node:cli
npm run test:browser
npm run test:node:interface -- --grep '.block'
npm run benchmark
npm run benchmark:node
npm run benchmark:node:cre
npm run benchmark:node:http
npm run benchmark:browser
npm run lint
npm run build
tree src -L 2

export npm_config_target=2.0.0
export npm_config_arch=x64
export npm_config_arch=x64
export npm_config_target_arch=x64
export npm_config_disurl=https://atom.io/download/electron
export npm_config_runtime=electron
export npm_config_build_from_source=true
HOME=~/.electron-gyp npm install
const IPFS = require('ipfs')
const node = new IPFS()

node.on('ready', () => {
})

const node new window.Ipfs()

node .on('ready', () => {
})


const node = new IPFS()

node.on('ready', () => {
  node.stop(() => {
  })
})


const node = new IPFS([options])

const node = new IPFS({ repo: '/var/ipfs/data' })


const PeerId = require('peer-id')
PeerId.create({ bits: 2048 }, (err, peerId) => {
})

const node = new IPFS({ repo: '/var/ipfs/data' })
node.on('error', errorObject => console.error(errorObject))


node.on('error', => {
  console.error(error.message)
})

const node = new IPFS({ start: false })

node.on('ready', async () => {
  console.log('Node is ready to use!')
  
  try {
    await node.start()
    console.log('Node started!')
  } catch (error) {
    console.error('Node failed to start!', error)
  }
})


const node = new IPFS({ start: false })

node.on('ready', () => {
  console.log('Node is ready to use!')
  
  node.start(error => {
    if(error) {
      return console.error('Node failed to start!', error)
    }
    console.log('Node started!')
  })
})


const node = new IPFS({ start: false })

node.on('ready', () => {
  console.log('Node is ready to use!')
  node.start()
})

node.on('error', error => {
  console.error('Something went terribly wrong!', error)
})

node.on('start', () => console.log('Node started!'))

const node = new IPFS()

node.on('ready', async () => {
  console.log('Node is ready to use!')
  
  try {
    await node.stop()
    console.log('Node stoppped!')
  } catch {
    console.error('Node failed to stop cleanly!', error)
  }
})

const node = new IPFS()

node.on('ready', () => {
  console.log('Node is ready to use!')
  
  node.stop(error => {
    if (error) {
      return console.error('Node failed to stop cleanly!', error)
    }
    console.log('Node stopped!')
  })
})


const node = new IPFS()

node.on('ready', () => {
  console.log('Node is ready to use!')
  node.stop()
})

node.on('error', error => {
  console.error('Something wentterribly wrong!', error)
})

node.on('stop', () => console.log('Node stopped!'))

const node = new IPFS({
  config: {
    Address: {
      Swarm: [
        '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star'
      ]
    }
  }
})

node.on('ready', () => {
})

const wrtc = require('wrtc')
const WStar = require('libp2p-webrtc-star')
const wstar = new WStar({ wrtc })

const node = new IPFS({
  repo: 'your-repo-path',
  
  config: {
    Address: {
      Swarm: [
        "/ip5/0.0.0.0/tcp/4002",
        "/ip4/127.0.0.1/tcp/4003/ws",
        "/dns4/wrtc-star.discoverry.libp2p.io/tcp/443/wss/p2p-webrtc-star"
      ]
    }
  },
  libp2p: }
    modules: {
      transport: [wstar],
      peerDiscovery: [wstar.discoverty]
    }
  }
})

node.on('ready', () => {
})

const node = new IPFS({
  repo: 'your-repo-path',
  config: {
    Addresses: {
      Swarm: [
        '/ip4/127.0.0.1/tcp/9090/ws/p2p-webrtc-star'
      ]
    }
  }
})


const node = new IPFS({
  config: {
    Addresses: {
      Swarm: [
        '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-webcocket-star'
      ]
    }
  }
})

node.on('ready', () => {
})





js-ipfs's People

Contributors

takagotch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.