pull down to refresh
301 sats \ 2 replies \ @pillar 26 Jan 2023 \ on: Easiest way to talk to a lightning node from a JavaScript frontend bitcoin
I would suggest LNbits.
LNBits acts as a very thin layer on top of many possible funding sources (LND, CLN, Ecliar, another LNBits, ... You can check the full list here). It's fully open-source, trivial to set up, has some of the brightest and nicest minds working on it.
Useful features:
- Supports multiple accounts. This means you can abstract away from the funding source, which is a single LN node that only has one balance, and support as many users as you want with it. This is how the well known telegram LightningTipBot works.
- Exposes API endpoints for all typical operations (generate invoices, pay invoices, check balances, etc). So, easy to hit from your JS code.
- LNbits comes with a ton of extensions that also implement API endpoints. These expand the possibilities way beyond the simple LND node features. This might save you more coding in your front-end.
You don't even need to deploy it yourself if you want to test it out. There is an open access, fully functional demo server maintained by the core team that you can use to play around. You can easily jump into your own instance once you need that (or be a bit irresponsible and stay on the demo server. You won't be the first one to do that :) ).
You can find a curated collection of projects that are built on top of LNBits here: https://github.com/cryptoteun/awesome-lnbits#software-projects-utilizing-lnbits. The page also contains good learning resources.
And regarding tradeoffs and limitations:
- It's early, and it's beta. Things might be shaky at first.
- The URL-based security turns-off many people. It is a polemic trade-off between security and convenience. You must decided if it suits your needs.
You can check the docs here.
Hope this helps. I'm personally in love with LNbits.
Incredible LNBits shill! I love it but a bit of work on the API docs would go a long way for the plebs who are getting their hands dirty with Lightning for the first time. Still LNBits is super powerful with all of the extensions and a must learn for anyone wanting to build Lightning apps.
A close second place for the bounty, thank you for the great response!
reply
No probs, good luck with the development and come back to show us when you've built something cool.
reply