How to use the libp2p-bootstrap function in libp2p-bootstrap

To help you get started, we’ve selected a few libp2p-bootstrap 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 polkadot-js / client / packages / client-p2p / src / create / modules.ts View on Github external
export default function createModules (envType: EnvType, peerInfo: PeerInfo, { bootNodes, discoverBoot, discoverStar, nodes, wrtc }: Config): LibP2p.OptionsModules {
  const isCli = envType !== 'browser';
  const starTransports = discoverStar
    ? [new WebRTClient({ wrtc })]
    : [];
  const transport = isCli
    ? [WS, TCP]
    : [WS];
  const peerDiscovery = isCli
    ? [new Bootstrap({ list: (discoverBoot ? bootNodes : []).concat(nodes) })]
    : [];

  return {
    connEncryption: [
      secio
    ],
    streamMuxer: [
      mplex,
      spdy
    ],
    dht,
    peerDiscovery: peerDiscovery.concat(
      starTransports.map(({ discovery }): any => discovery)
    ) as any[],
    transport: transport.concat(starTransports as any[])
  };

libp2p-bootstrap

Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular libp2p-bootstrap functions