I’ve just started using libp2p-js and running the example code, but it appears the api may have changed significantly recently!
I’m running version 0.27.8 of libp2p-js. This was installed using
npm install libp2p.
In the transports examples, I see:
node.multiaddrs.forEach((ma) => console.log(ma.toString()));
multiaddrs is not defined in
node, I found
multiaddrs defined in
node.peerInfo.multiaddrs.forEach((ma) => console.log(ma.toString()));
Which appears to work.
I then came to
But addressBook is undefined in node1.peerStore.
I’m struggling to find the correct implementation of this.
I see talk of refactoring in version 0.28 and the only occurrence of
addressBook in the libp2p peer-store script is commented out.
Have the examples already been updated to 0.28 code, but the npm repo still points to 0.27.8?
If the examples are up to date, will an upgrade solve my problems?
Thanks in advance!