Giter Club home page Giter Club logo

builders-guide-sample-app's Introduction

Beginner's Guide to the LND Galaxy

This sample application serves as a guide to begin learning how to communicate with an LND node to send and receive payments over the Lightning Network.

Overview

The goal of this guide is to get you familiar with adding payments functionality to your app using the lnd Lightning Network node software.

This application will be written in Typescript with a small amount of HTML+CSS. On the frontend we will use ReactJS to render the UI and mobx for managing the application state. On the backend we will use expressjs to host our API server and serve the app's data to multiple web clients.

To easily create a local Lightning Network, which exists solely on your computer, we will be using the Polar development tool.

We'll be making use of the LND gRPC API to interface with the LND node. A few of the API endpoints that we will be using throughout this application are:

Endpoint Description
getinfo returns general information concerning the lightning node
channelbalance returns the total funds available across all open channels in satoshis
signmessage signs a message with this node's private key
verifymessage verifies a signature of a message
addinvoice creates a new invoice which can be used by another node to send a payment
lookupinvoice look up an invoice according to its payment hash

The sample app we'll be starting with is a basic Reddit clone with this small list of features:

  • view a list of posts on the home page sorted by votes
  • click on the Upvote button for a post should increment its number of votes
  • create a post containing a username, title, and description

We'll add Lightning Network integration in this tutorial by implementing the following features:

  • connect your node to the app by providing your node's host, certificate and macaroon
  • display your node's alias and channel balance
  • create posts and sign them using your LND node's pubkey
  • verify posts made by other users
  • up-vote a post by paying 100 satoshis per vote

Running the App Locally

Requirements: NodeJS v12.x & Yarn v1.x

Clone the repo

git clone https://github.com/lightninglabs/builders-guide-sample-app.git

Install dependencies

cd builders-guide-sample-app
yarn

Start the API server and client app development server

yarn dev

Open your browser and navigate to http://localhost:3000.

builders-guide-sample-app's People

Contributors

jamaljsr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

builders-guide-sample-app's Issues

lnd not starting with the provided network image in the resources folder

I am following this guide https://docs.lightning.engineering/lapps/guides/polar-lapps/run-the-completed-app and after i import builder-guide-polar.zip from the resources folder into polar and start the network the bitcoin node looks like it functions however all the lightning nodes give an error "Unable to connect to LND node 14 UNAVAILABLE: No connection established" I am on a intel mac. what other info would help troubleshoot this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.