Closed Azaeres closed 10 months ago
Interestingly
Worked once for me. Then next time I tried it I got the problem. I wonder if there is some caching going on..
Anyway.
Looks like you have a old version of Peerbit lurking around. Can you see if you can bump all Peerbit related dependencies.
Most importantly
this one should not exist in the lock file but only the 13^ one
Super cool that your are creating multiplayer (?) a space shooter game with Peerbit. Could feature it/link it from this repo if you want later
Okay, thank you for the tip on what to dig into!
@peerbit/react@0.0.4
off of NPM is asking for @libp2p/webrtc@^2.0.11
, which is in turn asking for @chainsafe/libp2p-noise@^12.0.0
. If I uninstall @peerbit/react
, version 12 of libp2p-noise
goes away.
However, I see that react-utils
in the peerbit-examples
is asking for @libp2p/webrtc@^3.1.9
. See https://github.com/dao-xyz/peerbit-examples/blob/fe1729f1268c5b29fb61b59611e460d553ed3180/packages/react-utils/package.json#L28
If you're publishing this react-utils
folder to NPM, maybe it's time to publish an update?
Super cool that your are creating multiplayer (?) a space shooter game with Peerbit. Could feature it/link it from this repo if you want later
Yeah, that's the idea! Would love for this to come together. Thanks again for your help.
Well it is more the
@dao-xyz/libp2p-noise@^12.0.0
noise implementation, that had a bug which yields your error message.
If you somehow manage to get rid of peerbit v1 dependency https://github.com/Azaeres/etherion-lab/blob/c7d9864e42c86c26c7a8bbb3c1d824d600dd8662/yarn.lock#L7998C12-L7998C12
and only use peerbit v2 I think your problems will be gone.
I have not actually used @peerbit/react in a separate repo yet. Been building it along side all the examples to reach a good API in the end, and I can see that there are a few dependencies there that perhaps needs to be removed or updated (however it should not affect your problem)
These are the listed dependencies of the @peerbit/react
I grabbed off of NPM.
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@libp2p/webrtc": "^2.0.11",
"@mui/icons-material": "^5.10.16",
"@mui/material": "^5.10.13",
"@peerbit/proxy-window": "^1.0.1",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.8",
"path-browserify": "^1.0.1",
"peerbit": "^1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.0",
"react-use": "^17.4.0"
},
I think that's where the peerbit@^1
is coming from, which explains why the @dao-xyz/libp2p-noise@^12.0.0
disappears when I uninstall @peerbit/react
.
Ah! I see, this CI in github does not automatically release stuff in this repo.
Just relased
@peerbit/react@0.0.5
now. Try it out !
Nice! No longer getting the XX handshake error!
I've got a bunch of these "'Recieved hello message that did not verify. Header: false, Ping info true, Signatures false'" warnings, though. Does this mean I haven't configured something correctly?
Edit: And now that production's deployed I see a "Websocket connection failed" error.
Another edit: Never mind, I was looking at Experiment 3 when I thought I was looking at Experiment 4.
Great! No you don't have to worry about that error.
There is non-optimal logging now.
The warning and error messages should be gone when this issue is fixed.
The 87ecf9778ccaa08bd9f1e8c6104d82c469b35511.peerchecker.com
address is not part of the bootstrapping nodes. And that server is down. But this should not affect your stuff running. The error messages you see are basically just the autodialer failing to establish connections
I have a Next.js app in which I'm trying to use PeerProvider from
@peerbit/react
, like so: https://github.com/Azaeres/etherion-lab/blob/main/src/components/scenes/Experiment4/index.tsxHowever, I'm getting the error "Failed to resolve relay addresses. Error: Error occurred during XX handshake: ciphertext cannot be decrypted using that key".
Live demo of error can be found here: https://lab.etherion.app/experiment4
When I try to provide my own keypair, Peerbit sees it as invalid. It looks like there are a few different defined
Ed25519Keypair
classes in the Next.js bundle, and Peerbit'sinstanceof
check fails when there's a class reference mismatch. I've also tried creating a keypair using@peerbit/react
'sgetKeypair()
function, but Peerbit also sees it as invalid. Not sure if this is related to the "XX handshake" error.In another, separate area, I've successfully created my own peer by borrowing bits of
@peerbit/react
. You can see this in a live demo at: https://lab.etherion.app/experiment3The peer creation code I got to work can be found here: https://github.com/Azaeres/etherion-lab/blob/main/src/components/scenes/Experiment3/hooks/usePeerbitDatabase.ts