This commit is contained in:
Justin (shocknet) 2023-09-20 14:19:30 -04:00
parent 6d6f759030
commit bc17640cfc
3 changed files with 41 additions and 16 deletions

View file

@ -1,29 +1,45 @@
# Lightning.Pub
![Lightning.Pub](https://github.com/shocknet/Lightning.Pub/raw/master/pub_logo.png)
![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/Lightning.Pub?style=flat-square)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC)
[![Twitter Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square)](https://twitter.com/ShockBTC)
![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square&logo=bitcoin)
<p></p>
`Pub` enables your Lightning node with public Web API's over `nostr`, allowing user nodes to act as a server without complex networking and SSL.
### Don't just run a Lightning Node, run a Lightning Pub.
These APIs enable a framework for permissionless lightning web apps in a way that promotes a more distributed lightning network by removing hurdles to connect to self-custodial nodes.
`Pub` enables your Lightning node with public API's and accounts over `nostr`, allowing LN nodes to act like a webserver without the complexity of networking and SSL configurations.
The Permissionless WebApps that use these API's promote a more decentralized Lightning Network, by removing hurdles for self-custodial home nodes to power connections from Friends, Family and Customers.
#### Features:
- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR
- [Methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md)
- Accounting SubLayers for Application Pools and Users ![Accounts](https://github.com/shocknet/Lightning.Pub/raw/master/accounting_layers.png)
- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md)
- Accounting SubLayers for Application Pools and Users
- A fee regime allows applications owners to tax users, or node operators to tax applications.
![Accounts](https://github.com/shocknet/Lightning.Pub/raw/master/accounting_layers.png)
#### This repository is under rapid iteration and should only be used in development.
See the NostrHack presentation: https://lightning.video/f0f64fa1fc3744fb6a3880e2bd8f6a254ceb3caee112d9708271f2d6a09a2f00
#### Planned
- [ ] Management [Dashboard](https://github.com/shocknet/Lightning.Pub/raw/master/pub_dash_concept.jpg)
- [ ] Channel Automation
- [ ] Subscriptions / Notifications
- [ ] Submarine Swaps
- [ ] High-Availabilty
### Manual Installation
#### See the NostrHack presentation: https://lightning.video/f0f64fa1fc3744fb6a3880e2bd8f6a254ceb3caee112d9708271f2d6a09a2f00
> **WARNING:** This repository is under rapid iteration and security is not guaranteed. Use tagged releases for non-development.
## Manual Installation
#### Notes:
* The service defaults to port `8080`
* Requires [Node.js](https://nodejs.org) 16
* Use of a reverse proxy is only required if you wish to serve LNURLs
* Requires [Node.js](https://nodejs.org) >=18.x
#### Steps:
1) Run [LND](https://github.com/lightningnetwork/lnd/releases) - *Example mainnet startup*:
@ -37,13 +53,22 @@ See the NostrHack presentation: https://lightning.video/f0f64fa1fc3744fb6a3880e2
```
git clone https://github.com/shocknet/Lightning.Pub
cd Lightning.Pub
npm install
cd Lightning.Pub && npm i
```
3) `cp env.example .env`
4) Add values to env file, you can generate a keypair with `node genkey.js`
4) Add values to env file
- You can generate a keypair with `node genkey.js`
5) `npm start`
6) Connect with [wallet2](https://github.com/shocknet/wallet2) ... until this is further along you'll get the wallets pub from the console then update your env
6) Create an Application Pool
```
curl -XPOST -H 'Authorization: Bearer defined_in_constants.ts' -H "Content-type: application/json" -d '{"name":"ExampleApplicationPoolName"}' 'http://localhost:8080/api/admin/app/add'
```
7) Connect with [wallet2](https://github.com/shocknet/wallet2) using the npub response in step 6.