Skip to content

Commit

Permalink
chore: use new peer-discovery interface
Browse files Browse the repository at this point in the history
BREAKING CHANGE: emitted peer event now emits a peer data object with id and multiaddrs instead of a peer-info
  • Loading branch information
vasco-santos committed Apr 23, 2020
1 parent 4d02a36 commit b04c1c6
Show file tree
Hide file tree
Showing 4 changed files with 4,116 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Included is a libp2p peer-discovery compatibility module.
```typescript
import { Discv5Discovery, ENR } from "@chainsafe/discv5";
import Libp2p from "libp2p";
import PeerInfo from "peer-info";
import PeerId from "peer-id";

const myPeerInfo: PeerInfo = ...;
const myPeerId: PeerId = ...;

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

const libp2p = new Libp2p({
peerInfo: myPeerInfo,
peerId: myPeerId,
modules: {
peerDiscovery: [Discv5Discovery],
},
Expand Down
Loading

0 comments on commit b04c1c6

Please sign in to comment.