This is a step-by-step tutorial project for learning to build Lightning applications. It's broken out into 5 parts, which you can find as separate posts on Medium and branches here on GitHub.
part-1
branch)part-2
branch)part-3
branch)If you'd rather read the code than a post, feel free to dive in directly with the following instructions:
If you want an LND node but have trouble setting it up with LND directly, I suggest either following Pierre Rochard's Easiest Lightning Node guide, or downloading the Lightning App from Lightning Labs.
If you'd rather not deal with getting your hands on some Bitcoin or waiting for block times to open channels, you can setup your own simulated Lightning network cluster.
If you just want to fiddle around with this you can use Polar to setup your own local regtest network.
Copy the environment configuration file with
cp .env.example .env
Edit the following fields in your new .env file with information about your node. You can get some help finding this info using this tool: https://lightningjoule.com/tools/node-info
LND_GRPC_URL
- The location to connect to your node. If you're running with default settings locally, this should be 127.0.0.1:10009
.LND_MACAROON
- Your invoice.macaroon
file, base64 encoded. Run base64 invoice.macaroon
in your macaroon directory to get this.LND_TLS_CERT
- Your TLS certificate, also base 64 encoded. Run base64 tls.cert
in your data directory to get this.If you don't know how to get these, this tool will tell you where to find these.
Install dependencies and run the app with
npm install && npm run dev
# OR #
yarn && yarn dev
Coming soon.