Skip to content

A simple fullstack Lightning App template for learning / development with LND

License

Notifications You must be signed in to change notification settings

AustinKelsay/pleb-node-template

Repository files navigation

pleb-node-template

A simple fullstack Lightning App template for learning / development with LND

Features:

  • 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.

Local Setup (in regtest using Polar):

  1. Make sure that you have Docker Desktop and Polar installed

  2. Open Docker Desktop and wait for it to start

image

  1. Open Polar and create a new Lightning network

image

  1. 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.

image

  1. Start your network

image

  1. Click on the Alice node, visit the connect tab on the right, and copy the 'GRPC Host' value

image

  1. Add this as the value to LND_HOST in the .env.sample file

image

  1. 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

image

  1. Rename the .env.sample to .env

image

  1. Open up the terminal and run npm i to install all of the packages and then run `npm run start' to start the server.

image

  1. Open up a new terminal and run cd frontend to navigate to the frontend directory, run npm i to install all of the packages, now finally run npm run dev to start the frontend.

image

  1. 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.

image

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

About

A simple fullstack Lightning App template for learning / development with LND

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published