New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@nethermindeth/discv5

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nethermindeth/discv5

Discovery V5

latest
Source
npmnpm
Version
9.0.0-backport-306-v4
Version published
Maintainers
2
Created
Source

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,
      searchInterval: 30000, // wait 30s between searches
    },
  },
});

Additional features

By default, importing this library will, as a side-effect, change the enr crypto implementation to use bcrypto. If you'd like to remain using @chainsafe/enr's default crypto you can add this after importing @chainsafe/discv5:

import {setV4Crypto, defaultCrypto} from "@chainsafe/enr";

setV4Crypto(defaultCrypto)

License

Apache-2.0

Keywords

discovery

FAQs

Package last updated on 18 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts