libp2p-bootstrap
Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list
Last updated 4 years ago by vascosantos .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install libp2p-bootstrap 
SYNC missed versions from official npm registry.

js-libp2p-bootstrap

Discourse posts js-standard-style

JavaScript libp2p Implementation of the railing process of a Node through a bootstrap peer list

Lead Maintainer

Vasco Santos.

Usage

const Libp2p = require('libp2p')
const Bootstrap = require('libp2p-bootstrap')
const TCP = require('libp2p-tcp')
const { NOISE } = require('libp2p-noise')
const MPLEX = require('libp2p-mplex')

let options = {
    modules: {
        transport: [ TCP ],
        peerDiscovery: [ Bootstrap ],
        streamMuxer: [ MPLEX ],
        encryption: [ NOISE ]
    },
    config: {
        peerDiscovery: {
            [Bootstrap.tag]: {
                list: [ // a list of bootstrap peer multiaddrs to connect to on node startup
                  "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
                  "/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
                  "/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa" 
                  ],
                  interval: 5000 // default is 10 ms,
                  enabled: true
            }
        }
    }
}

async function start () {
  let libp2p = await Libp2p.create(options)

  libp2p.on('peer:discovery', function (peerId) {
    console.log('found peer: ', peerId.toB58String())
  })

  await libp2p.start()

}

start()

Current Tags

  • 0.14.0                                ...           latest (3 years ago)

18 Versions

  • 0.14.0                                ...           3 years ago
  • 0.13.0                                ...           3 years ago
  • 0.12.3                                ...           4 years ago
  • 0.12.2                                ...           4 years ago
  • 0.12.1                                ...           4 years ago
  • 0.12.0                                ...           4 years ago
  • 0.11.0                                ...           5 years ago
  • 0.10.4                                ...           5 years ago
  • 0.10.3                                ...           5 years ago
  • 0.10.2                                ...           5 years ago
  • 0.10.1                                ...           5 years ago
  • 0.10.0                                ...           5 years ago
  • 0.9.7                                ...           6 years ago
  • 0.9.6                                ...           6 years ago
  • 0.9.5                                ...           6 years ago
  • 0.9.4                                ...           6 years ago
  • 0.9.3                                ...           6 years ago
  • 0.9.2                                ...           6 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE