10.0.1 • Published 2 months ago

@chainsafe/discv5 v10.0.1

Weekly downloads
101
License
Apache-2.0
Repository
github
Last release
2 months ago

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

10.0.0

2 months ago

10.0.1

2 months ago

9.0.1

3 months ago

9.0.0

10 months ago

7.1.0

11 months ago

7.0.0

12 months ago

7.0.1

12 months ago

5.1.2

1 year ago

5.1.1

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.0.0

2 years ago

2.0.0

2 years ago

3.0.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

1.2.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.6.5

3 years ago

0.6.4

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.3

4 years ago

0.2.4

4 years ago

0.2.2

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago