Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when setting direct peers in @chainsafe/libp2p-gossipsub with new libp2p peerStore structure #427

Closed
kostysh opened this issue May 12, 2023 · 1 comment

Comments

@kostysh
Copy link

kostysh commented May 12, 2023

I an using @chainsafe/libp2p-gossipsub version 7.0.0 and libp2p version 0.45.0 on Linux, node.js v18.

Steps to reproduce:

  1. Define directPeers in the libp2p options object.
  2. Start libp2p node with @chainsafe/libp2p-gossipsub protocol.
  3. Observe the following error:
TypeError: Cannot read properties of undefined (reading 'add')
    at file:///.../node_modules/@chainsafe/libp2p-gossipsub/src/index.ts:549:53

Details:
The error occurs during the try to set direct peer addresses in the addressBook (

await this.components.peerStore.addressBook.add(p.id, p.addrs)
).
It seems that the new version of the libp2p has a different peerStore structure.

@maschad
Copy link
Contributor

maschad commented May 14, 2023

Sorry for the inconvenience 😓 but libp2p 0.45.0 introduced some breaking changes which have been addressed in #425 , so the gossipsub 8.0.0 release should include this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants