lnsocket icon indicating copy to clipboard operation
lnsocket copied to clipboard

Pure JS client

Open jb55 opened this issue 1 year ago • 7 comments

@ShahanaFarooqui wrote a pure-js commando client here: https://github.com/ShahanaFarooqui/CLN-Commando-Client

I should just switch to that instead of using the C wasm build.

jb55 avatar Aug 22 '22 23:08 jb55

@jb55 please let me know if you need any help or information regarding this.

ShahanaFarooqui avatar Aug 22 '22 23:08 ShahanaFarooqui

We would love to integrate a pure-js commando client in the Alby extension. Using a JS client and a websocket proxy seems an ideal solution that would "just work". However, I haven't been able to get @ShahanaFarooqui 's client to work yet.

Also, the code feels a bit like dark magic, would be great to have some references about the steps taken during the handshake process.

kiwiidb avatar Sep 30 '22 10:09 kiwiidb

Hey @jb55, @kiwiidb I was able to reproduce the issue with CLN v0.12.0. However, I am not 100% sure if upgrading to v0.12.x is the only reason or not. I will test it with fresh 0.11.1 node and let you know the status within 1-2 days.

ShahanaFarooqui avatar Oct 01 '22 02:10 ShahanaFarooqui

@ShahanaFarooqui what issue are you referring to? commando is enabled by default in v0.12.x so you won't need the commando plugin anymore.

jb55 avatar Oct 01 '22 10:10 jb55

https://github.com/Ride-The-Lightning/RTL/issues/991#issuecomment-1263387016

ShahanaFarooqui avatar Oct 01 '22 14:10 ShahanaFarooqui

I have a pure JS version working in the browser with no polyfills necessary available here if it is useful for anyone. One caveat is that it uses Big Integer literals which cannot be polyfilled for older browsers but according to caniuse it has 94% coverage for users.

lnbc1QWFyb24 avatar Oct 02 '22 02:10 lnbc1QWFyb24

@kiwiidb Please check here for the solution.

ShahanaFarooqui avatar Oct 04 '22 01:10 ShahanaFarooqui