shresthagrawal / learnp2p

https://learnp2p.org
https://jslibp2p-chat-tutorial.vercel.app
MIT License
26 stars 6 forks source link

Issue running 2.3 without secio #20

Closed shresthagrawal closed 4 years ago

shresthagrawal commented 4 years ago

In #11 we discovered that the support for Plaintext as an default encryption was removed. And running the bootstrap code 2.2-finished-code.js and then running the code 2.3-finished-code.js which just dials to the bootstrap throws the following error:

(node:67986) UnhandledPromiseRejectionWarning: AggregateError:
    Error: protocol selection failed
        at module.exports (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/multistream-select/src/select.js:50:17)
        at async Upgrader._encryptOutbound (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/upgrader.js:361:36)
        at async Upgrader.upgradeOutbound (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/upgrader.js:168:11)
        at async ClassIsWrapper.dial (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p-tcp/src/index.js:42:18)
        at async TransportManager.dial (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/transport-manager.js:87:14)
        at async /Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/dialer/dial-request.js:58:18
        at async /Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/p-some/index.js:53:19
    at maybeSettle (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/p-some/index.js:31:11)
    at /Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/p-some/index.js:69:23
(node:67986) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:67986) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
acolytec3 commented 4 years ago

I believe this bug is now fixed in or #11 with the plaintext fix I found.

acolytec3 commented 4 years ago

Confirmed, the code in 2.3 is working again with PR#11