create-ln-app

Create LN App

Built with ❤️ ☕️ & ₿ in ATL by the Terminus Labs team. This is an open-source effort. Feel free to steal like an artist to make your life eaier. If you find issues, pls submit them to the repo. If you’re feelin’ froggy 🐸 and want a feature now, feel free to fork, build and submit a PR.

What? 🧐

Lapp: aka Lightning App; in contrast to a dApp. The term dApp was popularized by the web 3.0 / defi / crypto community. Much like the term web 3.0, the term dApp has become overused, subsequently losing its meaning. We fundamentally believe that the Lapp will supercede the dApp as the go-to framework to build on top of the Bitcoin Lightning Network, and this repo is are effort to help populerize that idea.

Lapps are software applications that run on top of the Bitcoin Lightning Network: (L)igtning(app). The idea of this repo is to enable developers to build Lapps faster and easier so as a community, we can “move fast and break things” on L2 increasing the rate of innovation in Bitcoin.

We also want to swap out the idea of a dApp for a Lapp because, as a Bitcoin-focused organization, we think the Lightning Network will scale Bitcoin to become the money of the future.

Why? 🤷🏼‍♂️

The create-ln-app repo is meant to simplify the local dev env setup, so Lapp developers can stop fussing with the dev tooling and start building the future!

How? 🛠

Setup is easy as 0-1-2!

  1. Click here to fork this repo. Then, run the following command replacing YOURUSERNAME with your github username.
git clone git@github.com:<YOURUSERNAME>/create-ln-app.git my_Lapp && cd my_Lapp

Or, you can simply clone this repo if you prefer.

git clone https://github.com/terminus-btc/create-ln-app.git && cd create-ln-app
  1. npm run install:all
  2. npm start

We recommend using this template as a starting point for your local lightning development env. Over time, we plan to evolve this template to include more customizations and features for advanced developers.

Prerequisites

Below is a list of required and optional software packages for running this software.

Required

The software below is required to be able to properly run this code. Click the links for install instructions.

Or if you’re on a mac, you can install node, docker and docker-compose with homebrew, and then install npx using npm.

brew install node docker docker-compose
npm install -g npx

If you install docker desktop, make sure you open it and get the docker engine running.

Optional

Homebrew is optional for mac, but it is very handy to have when you need to install packages.

n and nvm are also options, but again, they are handy node version management packages. I prefer n over nvm because it seems to run faster.

Useful Information

Once the npm start command is executed, you’ll see a new .env file placed at frontend/js/.env and frontend/ts/.env as well as frontend/js/src/.env.js and frontend/ts/src/.env.js. Both will have all the env variables that you need to run the example app providing you options for how you want to access env vars (i.e. process.env vs import { ... } from ../.env). In the event that fails, find the relevant info below.

LND

bitcoind