@gxchain2/discv5
    TypeScript icon, indicating that this package has built-in type declarations

    0.6.4 • Public • Published

    discv5

    ES Version Node Version

    A TypeScript implementation of the DiscV5 protocol

    Libp2p compatibility

    Peer Discovery Compatible

    Included is a libp2p peer-discovery compatibility module.

    Example

    import { Discv5Discovery, ENR } from "@chainsafe/discv5";
    import Libp2p from "libp2p";
    import PeerId from "peer-id";
    
    const myPeerId: PeerId = ...;
    
    const bootstrapEnrs: ENR[] = [...];
    
    const libp2p = new Libp2p({
      peerId: myPeerId,
      modules: {
        peerDiscovery: [Discv5Discovery],
      },
      config: {
        discv5: {
          enr: ENR.createFromPeerId(myPeerInfo.id),
          bindAddr: "/ip4/0.0.0.0/udp/9000",
          bootstrapEnrs: bootstrapEnrs,
        },
      },
    });

    License

    Apache-2.0

    Install

    npm i @gxchain2/discv5

    DownloadsWeekly Downloads

    13

    Version

    0.6.4

    License

    Apache-2.0

    Unpacked Size

    227 kB

    Total Files

    104

    Last publish

    Collaborators

    • lanhaoxiang
    • samlior