This commit is contained in:
Justin (shocknet) 2024-07-21 20:05:44 -04:00
parent 8084e51596
commit 59daef7d75

124
README.md
View file

@ -1,3 +1,5 @@
# 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)
@ -5,7 +7,6 @@
[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC)
![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square&logo=bitcoin)
### Don't just run a Lightning Node, run a Lightning Pub.
"Pub" is a [Nostr](https://nostr.info)-native account system designed to make running Lightning infrastructure for your friends/family/customers easier than previously thought possible.
@ -22,7 +23,17 @@ Additionally, support for optional services are integrated into Pub for operator
By solving the networking and programability hurdles, Pub provides Lightning with a 3rd Layer that enables node-runners, Busineses, and Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub runners can keep the Lightning Network decentralized, with custodial scaling that is free of fiat rails, large banks, and other forms of high-time-preference shitcoinery.
#### Features:
## Table of Contents
- [Features](#features)
- [Planned Features](#planned-features)
- [Installation](#installation)
- [One-Line Deployment](#one-line-deployment)
- [Docker Installation](#docker-installation)
- [Manual CLI Installation](#manual-cli-installation)
- [Usage Notes](#usage-notes)
- [Misc](#support-development)
## Features
- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR
- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md)
@ -32,6 +43,7 @@ By solving the networking and programability hurdles, Pub provides Lightning wit
- A pub node may trust another pub node until it can afford a channel
- Accounting SubLayers for Application Pools and Users
- A fee regime allows applications owners to monetize users, or node operators to host distinctly monetized applications.
![Accounts](https://github.com/shocknet/Lightning.Pub/raw/master/accounting_layers.png)
- Connecting via ShockWallet is as easy as pasting an nprofile
@ -39,8 +51,8 @@ By solving the networking and programability hurdles, Pub provides Lightning wit
<img src="https://cdn.shockwallet.app/add_src_sm.png" height="20%" alt="Connect Wallet"> <img src="https://cdn.shockwallet.app/src_invite_sm.png" height="20%" alt="Invite Guests">
## Planned Features
#### Planned
- [ ] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
- [ ] Nostr native "offers" (successor to LNURL-Pay, Lightning Address, Bxlt12)
- [ ] P2P "LSP" coordination for channel batching over Nostr
@ -52,98 +64,84 @@ Dashboard Wireframe:
<img src="https://shockwallet.b-cdn.net/pub_home_ss.png" alt="Pub Dashboard" width="240">
> [!IMPORTANT]
> ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [**support**](https://github.com/sponsors/shocknet) 😊<br>
## Installation
<img src="https://www.gnu.org/graphics/agplv3-with-text-162x68.png" alt="License">
<br>
### One-Line Deployment
> [!WARNING]
> While this software has been used in a high-profile production environment for over a year, it should still be considered bleeding edge. Special care has been taken to mitigate the risk of drainage attacks, which is a common risk to all Lightning API's. An integrated Watchdog service will terminate spends if it detects a discrepency between LND and the database, for this reason **IT IS NOT RECOMMENDED TO USE PUB ALONGSIDE OTHER ACCOUNT SYSTEMS**. While we give the utmost care and attention to security, **the internet is an adversarial environment and SECURITY/RELIABILITY ARE NOT GUARANTEED- USE AT YOUR OWN RISK**.
Experimental-ish, this installs all dependencies and creates systemd entries. It has been tested in Ubuntu/Debian x64 environments, but is general enough that it should work on most systems. Mac support is there also, but untested. Please report any issues.
## One-Line Deployment
Run the following command:
Experimental-ish, it has been tested in Ubuntu/Debian x64 environments but is general enough that it should work on most systems. Mac support is there also, but untested. Please report any issues.
```ssh
sudo wget -qO- https://deploy.lightning.pub | sudo bash
```
`sudo wget -qO- https://deploy.lightning.pub | sudo bash`
> Note: Automatic updates are not implemented, but running the script a second time in the future will gracefully upgrade the existing installation.
Automatic updates are not implemented, but running the script a second time in the future will gracefully upgrade the existing installation.
### Docker Installation
## Umbrel Installation
1. Pull the Docker image:
Coming Soon
```ssh
docker pull ghcr.io/shocknet/lightning-pub:latest
```
## Desktop Installation
2. Run the Docker container:
Coming Soon
## Docker (testing)
`docker pull ghcr.io/shocknet/lightning-pub:latest`
### Running the Docker Container
To run the Docker container with persistent storage and port mapping, use the following command:
```sh
```ssh
docker run -d \
--name lightning-pub \
--network host \
-p 1776:1776 \
-p 1777:1777 \
-v /path/to/local/data:/app/data \
-v $HOME/.lnd:/root/.lnd \
ghcr.io/shocknet/lightning-pub:latest
```
Network host is used so the service can reach a local LND via localhost. LND is assumed to be under the users home folder, update this location as needed.
- `--network host`: Allows the container to use the host's network stack, enabling access to local services.
- `-p 1776:1776`: Maps the container's port 1776 to the host's port 1776.
- `-p 1777:1777`: Maps the container's port 1777 to the host's port 1777 (optional for management).
- `-v /path/to/local/data:/app/data`: Mounts a local directory to the container for persistent storage.
### Manual CLI Installation
### Accessing the Service
1. Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already:
Once the container is running, you can access the main service at `http://localhost:1776` and the optional management interface at `http://localhost:1777`.
### Connecting to External Services
Ensure that the container has access to necessary external services (e.g., LND node) by configuring the network settings appropriately. If using `--network host`, the container can access local services directly using `localhost` or `127.0.0.1`.
## Manual CLI Installation
#### Notes:
* Use of a reverse proxy is only required if you wish to serve LNURLs
* The service defaults to port `1776`
* Requires [Node.js](https://nodejs.org) >=18.x
* Commands for your specific OS may differ slightly, Ubuntu/Debian used for example
#### Steps:
1) Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already
*Example mainnet startup*:
```
```ssh
./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.addpeer=neutrino.shock.network --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json
```
2. Download and Install Lightning.Pub:
2) Download and Install Lightning.Pub
```ssh
git clone https://github.com/shocknet/Lightning.Pub && cd Lightning.Pub && npm i
```
3. Configure values in the env file:
* `git clone https://github.com/shocknet/Lightning.Pub`
```ssh
cp env.example .env && nano .env
```
* `cd Lightning.Pub && npm i`
4. Start the service:
```ssh
npm start
```
3) Configure values to env file as desired
* `cp env.example .env && nano .env`
## Usage Notes
5) `npm start`
Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet admin string that gets logged at startup. The nprofile of the node can also be used to send invitation links to guests.
- A default "wallet" application pool will be automatically created, if you wish to create other app pools:
Note that connecting with wallet will create an account on the node, it will not show or have access to the full LND balance.
* `curl -XPOST -H 'Authorization: Bearer defined_in_ADMIN_TOKEN_env' -H "Content-type: application/json" -d '{"name":"ExampleApplicationPoolName"}' 'http://localhost:8080/api/admin/app/add'`
Additional docs are WIP at [docs.shock.network](https://docs.shock.network)
5) Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet nprofile that gets logged at startup.
> [!NOTE]
> Connecting with wallet will create an account on the node, it will not show or have access to the full LND balance
## Support Development
> [!IMPORTANT]
> ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [**support**](https://github.com/sponsors/shocknet) 😊
<img src="https://www.gnu.org/graphics/agplv3-with-text-162x68.png" alt="License">
## Warning
> [!WARNING]
> While this software has been used in a high-profile production environment for over a year, it should still be considered bleeding edge. Special care has been taken to mitigate the risk of drainage attacks, which is a common risk to all Lightning API's. An integrated Watchdog service will terminate spends if it detects a discrepency between LND and the database, for this reason **IT IS NOT RECOMMENDED TO USE PUB ALONGSIDE OTHER ACCOUNT SYSTEMS**. While we give the utmost care and attention to security, **the internet is an adversarial environment and SECURITY/RELIABILITY ARE NOT GUARANTEED- USE AT YOUR OWN RISK**.