We’re you on the site when it happened? Just trying to figure why it happen. Seems like about once a week the rpc goes down. I did find an extra call I was making so hopefully that was it

Reply to this note

Please Login to reply.

Discussion

no, I just wanted to get your LightningRPC code.

Ah, I’ll make the repo public if you’re interested. LNSocket is probably better than mine though if you just want to connect to a node

I converted lnurl-commando away from lnsocket and I use spawn to call lightning-cli. but directly using the unix socket is of course better. so I wanted to borrow that from you

Yeah, sure. Here it is: https://github.com/joelklabo/blog/blob/main/lib/lightning/rpc.js

I haven’t done JS in a while so I’m not sure if this is any good or not but it’s been working

cool it works, after converting all requires in lnurl-commando to imports while still learning javascript (doing js since two weeks). even made the rpc a global so the unix socket connection stays alive

Oh nice, I need to do that too, can I see ?

Import or require is super confusing to me. I tried to use import but maybe my class is not setup correctly