A simple fullstack Lightning App template for learning / development with LND
- Vite frontend with simple darkmode styling / form management / data display.
- LND-GRPC library reducing code and making LND methods easier to work with.
- Express server with basic middleware setup / routes for lightning methods.
- Prebuilt LND methods for creating/paying invoices, openeing/closing channels, and adding/removing peers.
-
Make sure that you have Docker Desktop and Polar installed
-
Open Docker Desktop and wait for it to start
- Open Polar and create a new Lightning network
- Create your network however you like, though for starting out it's best to have at least 2 LND nodes to talk to each other.
- Start your network
- Click on the Alice node, visit the connect tab on the right, and copy the 'GRPC Host' value
- Add this as the value to LND_HOST in the .env.sample file
- Go back to the Connect tab and copy the 'TLS Cert' and 'Admin Macaroon' File Paths and add them as the LND_CERT and LND_MACAROON in .env.sample
- Rename the .env.sample to .env
- Open up the terminal and run
npm i
to install all of the packages and then run `npm run start' to start the server.
- Open up a new terminal and run
cd frontend
to navigate to the frontend directory, runnpm i
to install all of the packages, now finally runnpm run dev
to start the frontend.
- Visit the Vite local host and you should see pleb-node running. Click 'Connect to your node' and you will see your pubkey and alias immediately populate. Click this button anytime you want to refresh.
Now in combination with Polar you can open/close channels, create/pay invoices, and add/remove peers. There is so much more you can do with LND then what is in pleb-node but this should be a great way for you to get started. Check out lnd.js to see all of the lnd methods being called in pleb-node