🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

discv5-fork

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discv5-fork

Discovery V5 mega fork

10.0.5-fake
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
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} from "@chainsafe/discv5";
import {ENR, SignableENR} from "@chainsafe/enr";
import {createLibp2p} from "libp2p";
import PeerId from "peer-id";

const myPeerId: PeerId = ...;

const bootEnrs: ENR[] = [...];

const libp2p = createLibp2p({
  peerId: myPeerId,
  peerDiscovery: [() => new Discv5Discovery({
    enabled: true,
    enr: SignableENR.createFromPeerId(myPeerId),
    peerId: myPeerId,
    bindAddrs: {ip4: "/ip4/0.0.0.0/udp/9000"},
    bootEnrs,
    searchInterval: 30000, // wait 30s between searches
  })]
});

License

Apache-2.0

FAQs

Package last updated on 09 Jan 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