commit
0224528367
2 changed files with 99 additions and 59 deletions
54
README.md
54
README.md
|
|
@ -8,11 +8,15 @@
|
||||||
|
|
||||||
### Don't just run a Lightning Node, run a Lightning Pub.
|
### Don't just run a Lightning Node, run a Lightning Pub.
|
||||||
|
|
||||||
"Pub" is a `nostr` native account system that makes connecting your node to apps and websites super easy.
|
"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.
|
||||||
|
|
||||||
Using Nostr relays as transport for encrypted RPCs, Pub eliminates the complexity of WebServer and SSL configurations.
|
It may come as a surprise that the biggest hurdle to more Uncle Jim's nodes hasn't been with Bitcoin/Lightning node management itself, that's easily automated as illustrated by bad patterns like mobile nodes.
|
||||||
|
|
||||||
By solving the networking and programability hurdles, Pub enables node-runners and Uncle Jim's to bring their Friends, Family and Customers into Bitcoin's permissionless circular economy. All while keeping the Lightning Network decentralized, and custodial scaling free of fiat shitcoin rails and large banks.
|
It's the legacy baggage of traditional web infrastructure, things like IP4, reverse proxies, DNS, Firewalls and SSL certificates, all of which require a personal configuration that is a hurdle for most. The slow and unreliable nature of things like Tor have proven to be a dead-end. Bolt12 as a re-implementation of Tor is destined for the same fate.
|
||||||
|
|
||||||
|
Pub solves these network challenges with a Full RPC that is Nostr-native. Being Nostr-native eliminates the complexity of legacy server configuration by using completely commoditized and trustless Nostr relays. Additionally, some optional services are integrated for backward compatibility with LNURL and Lightning Address.
|
||||||
|
|
||||||
|
By solving the networking and programability hurdles, Pub's provide a 3rd Lightning Layer that enables node-runners and Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub can keep the Lightning Network decentralized, with custodial scaling free of fiat rails, large banks, and other forms of high-time-preference shitcoinery.
|
||||||
|
|
||||||
#### Features:
|
#### Features:
|
||||||
|
|
||||||
|
|
@ -24,35 +28,46 @@ By solving the networking and programability hurdles, Pub enables node-runners a
|
||||||

|

|
||||||
|
|
||||||
#### Planned
|
#### Planned
|
||||||
- [ ] Management Dashboard is being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
|
- [ ] Management Dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
|
||||||
- [ ] Nostr native "offers"
|
- [ ] Nostr native "offers"
|
||||||
- [ ] Channel Automation
|
- [ ] Automated Channel Management
|
||||||
- [ ] Bootstarp Peering (Passive "LSP")
|
- [ ] Bootstrap Peering (Passive "LSP")
|
||||||
- [ ] Subscriptions / Notifications
|
- [ ] Subscriptions / Notifications
|
||||||
- [ ] Submarine Swaps
|
- [ ] Submarine Swaps
|
||||||
- [ ] High-Availabilty / Clustering
|
- [ ] High-Availabilty / Clustering
|
||||||
|
|
||||||
Dashboard:
|
Dashboard Wireframe:
|
||||||
|
|
||||||
<img src="https://shockwallet.b-cdn.net/pub_home_ss.png" alt="Pub Dashboard" width="240">
|
<img src="https://shockwallet.b-cdn.net/pub_home_ss.png" alt="Pub Dashboard" width="240">
|
||||||
|
|
||||||
#### ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [support](https://github.com/sponsors/shocknet) :)
|
#### ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [support](https://github.com/sponsors/shocknet) :)
|
||||||
|
|
||||||
|
|
||||||
> **WARNING:** While this software has been used in production for many months, it is still bleeding edge and security or reliabilty is not guaranteed.
|
> **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.
|
||||||
|
|
||||||
## Manual Installation
|
## Umbrel Installation
|
||||||
|
|
||||||
|
Coming Soon
|
||||||
|
|
||||||
|
## Desktop Installation
|
||||||
|
|
||||||
|
Coming Soon
|
||||||
|
|
||||||
|
## Manual CLI Installation
|
||||||
|
|
||||||
#### Notes:
|
#### Notes:
|
||||||
* The service defaults to port `8080`
|
|
||||||
* Use of a reverse proxy is only required if you wish to serve LNURLs
|
* Use of a reverse proxy is only required if you wish to serve LNURLs
|
||||||
|
* The service defaults to port `8080`
|
||||||
* Requires [Node.js](https://nodejs.org) >=18.x
|
* Requires [Node.js](https://nodejs.org) >=18.x
|
||||||
|
* Commands for your specific OS may differe slightly, Ubuntu/Debian used for example
|
||||||
|
|
||||||
#### Steps:
|
#### Steps:
|
||||||
1) Run [LND](https://github.com/lightningnetwork/lnd/releases) - *Example mainnet startup*:
|
1) Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already
|
||||||
|
|
||||||
|
*Example mainnet startup*:
|
||||||
|
|
||||||
```
|
```
|
||||||
./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.connect=neutrino.shock.network --routing.assumechanvalid --accept-keysend --allow-circular-route --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json
|
./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.addpeer=neutrino.shock.network --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -63,20 +78,15 @@ git clone https://github.com/shocknet/Lightning.Pub
|
||||||
cd Lightning.Pub && npm i
|
cd Lightning.Pub && npm i
|
||||||
```
|
```
|
||||||
|
|
||||||
3) `cp env.example .env`
|
3) Configure values to env file as desired `cp env.example .env && nano .env`
|
||||||
|
|
||||||
4) Add values to env file
|
|
||||||
|
|
||||||
5) `npm start`
|
5) `npm start`
|
||||||
|
|
||||||
6) Create an Application Pool
|
- A default "wallet" application pool will be automatically created, if you wish to create other app pools:
|
||||||
|
|
||||||
A default "wallet" pool will be automatically created and keys generated automatically, if you wish to create something other:
|
`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'`
|
||||||
|
|
||||||
```
|
6) Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet nprofile that gets logged at startup.
|
||||||
curl -XPOST -H 'Authorization: Bearer defined_in_constants.ts' -H "Content-type: application/json" -d '{"name":"ExampleApplicationPoolName"}' 'http://localhost:8080/api/admin/app/add'
|
> Note that connecting with wallet will create an account on the node, it will not show or have access to the full LND balance
|
||||||
```
|
|
||||||
|
|
||||||
7) Connect with [wallet2](https://github.com/shocknet/wallet2) using the npub response in step 6 or the the wallet application nprofile logged at startup.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
100
env.example
100
env.example
|
|
@ -1,52 +1,82 @@
|
||||||
#LND
|
# Example configuration for Lightning.Pub
|
||||||
LND_ADDRESS=127.0.0.1:10009
|
# Copy this file as .env in the Pub folder and uncomment the desired settings to override defaults
|
||||||
LND_CERT_PATH=/root/.lnd/tls.cert
|
# Alternatively, these settings can be passed as environment variables at startup
|
||||||
LND_MACAROON_PATH=/root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
|
||||||
|
#LND_CONNECTION
|
||||||
|
# Defaults typical for straight Linux
|
||||||
|
# Containers, Mac and Windows may need more detailed paths
|
||||||
|
#LND_ADDRESS=127.0.0.1:10009
|
||||||
|
#LND_CERT_PATH=~/.lnd/tls.cert
|
||||||
|
#LND_MACAROON_PATH=~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
||||||
|
|
||||||
#DB
|
#DB
|
||||||
DATABASE_FILE=db.sqlite
|
#DATABASE_FILE=db.sqlite
|
||||||
METRICS_DATABASE_FILE=metrics.sqlite
|
#METRICS_DATABASE_FILE=metrics.sqlite
|
||||||
|
|
||||||
#LOCAL
|
#LOCALHOST
|
||||||
ADMIN_TOKEN=
|
#ADMIN_TOKEN=
|
||||||
PORT=8080
|
#PORT=8080
|
||||||
JWT_SECRET=bigsecrethere
|
#JWT_SECRET=
|
||||||
|
|
||||||
#LIGHTNING
|
#LIGHTNING
|
||||||
OUTBOUND_MAX_FEE_BPS=60
|
# Maximum amount in network fees passed to LND when it pays an external invoice
|
||||||
OUTBOUND_MAX_FEE_EXTRA_SATS=100
|
# BPS are basis points, 100 BPS = 1%
|
||||||
|
#OUTBOUND_MAX_FEE_BPS=60
|
||||||
|
#OUTBOUND_MAX_FEE_EXTRA_SATS=100
|
||||||
|
|
||||||
#ROOT_FEES
|
#ROOT_FEES
|
||||||
INCOMING_CHAIN_FEE_ROOT_BPS=0
|
# Applied to either debits or credits and sent to an admin account
|
||||||
INCOMING_INVOICE_FEE_ROOT_BPS=0
|
# BPS are basis points, 100 BPS = 1%
|
||||||
OUTGOING_CHAIN_FEE_ROOT_BPS=60 #applied to application debits
|
#INCOMING_CHAIN_FEE_ROOT_BPS=0
|
||||||
OUTGOING_INVOICE_FEE_ROOT_BPS=60 #applied to application debits
|
#INCOMING_INVOICE_FEE_ROOT_BPS=0
|
||||||
TX_FEE_INTERNAL_ROOT_BPS=60 #applied to inter-application txns
|
# Chain spends are currently unstable and thus disabled, do not use until further notice
|
||||||
|
#OUTGOING_CHAIN_FEE_ROOT_BPS=60
|
||||||
|
# Outgoing Invoice Fee must be >= Lightning Outbound Max Fee so admins don't incur losses on spends
|
||||||
|
#OUTGOING_INVOICE_FEE_ROOT_BPS=60
|
||||||
|
# Internal user fees bugged, do not use until further notice
|
||||||
|
#TX_FEE_INTERNAL_ROOT_BPS=0 #applied to inter-application txns
|
||||||
|
|
||||||
#APP_FEES
|
#APP_FEES
|
||||||
INCOMING_INVOICE_FEE_USER_BPS=0 #app default
|
# An extra fee applied at the app level and sent to the application owner
|
||||||
OUTGOING_INVOICE_FEE_USER_BPS=60 #app default
|
#INCOMING_INVOICE_FEE_USER_BPS=0
|
||||||
TX_FEE_INTERNAL_USER_BPS=60 #intra-application tx default
|
#OUTGOING_INVOICE_FEE_USER_BPS=0
|
||||||
|
#TX_FEE_INTERNAL_USER_BPS=0
|
||||||
|
|
||||||
#NOSTR
|
#NOSTR
|
||||||
NOSTR_RELAYS=wss://strfry.shock.network
|
# Default relay may become rate-limited without a paid subscription
|
||||||
|
#NOSTR_RELAYS=wss://strfry.shock.network
|
||||||
|
|
||||||
#LNURL
|
#LNURL
|
||||||
#Note that a reachable https endpoint for the service to handle lnurl requests is required for lightning address bridges
|
# Optional
|
||||||
SERVICE_URL=https://test.lightning.pub
|
# If undefined, LNURLs (including Lightning Address) will be disabled
|
||||||
|
# To enable, add a reachable https endpoint for requests (or purchase a subscription)
|
||||||
|
# You also need an SSL reverse proxy from the domain to this local host
|
||||||
|
# Read more at https://docs.shock.network
|
||||||
|
#SERVICE_URL=https://yourdomainhere.xyz
|
||||||
|
|
||||||
#DEV
|
#SUBSCRIPTION_SERVICES
|
||||||
MOCK_LND=false
|
# Opt-in to cloud relays for LNURL and Nostr
|
||||||
ALLOW_BALANCE_MIGRATION=false
|
# A small monthly fee supports the developers
|
||||||
MIGRATE_DB=false
|
# Read more at https://docs.shock.network
|
||||||
|
#SUBSCRIBER=1
|
||||||
|
|
||||||
|
#DEV_OPTS
|
||||||
|
#MOCK_LND=false
|
||||||
|
#ALLOW_BALANCE_MIGRATION=false
|
||||||
|
#MIGRATE_DB=false
|
||||||
|
|
||||||
#METRICS
|
#METRICS
|
||||||
RECORD_PERFORMANCE=true
|
#RECORD_PERFORMANCE=true
|
||||||
SKIP_SANITY_CHECK=false
|
#SKIP_SANITY_CHECK=false
|
||||||
DISABLE_EXTERNAL_PAYMENTS=false
|
# A read-only token that can be used with dashboard to view reports
|
||||||
|
#METRICS_TOKEN=
|
||||||
|
# Disable outbound payments aka honeypot mode
|
||||||
|
#DISABLE_EXTERNAL_PAYMENTS=false
|
||||||
|
|
||||||
# Max difference between users balance and LND balance since beginning of app execution
|
#WATCHDOG SECURITY
|
||||||
WATCHDOG_MAX_DIFF_SATS=10000
|
# A last line of defense against 0-day drainage attacks
|
||||||
|
# This will monitor LND separately and terminate sends if a balance discrepency is detected
|
||||||
# Max difference between users balance and LND balance after each payment
|
# This setting defaults to 0 meaning no discrepency will be tolerated
|
||||||
WATCHDOG_MAX_UPDATE_DIFF_SATS=1000
|
# Increase this values to add a spending buffer for non-Pub services sharing LND
|
||||||
|
# Max difference between users balance and LND balance at Pub startup
|
||||||
|
#WATCHDOG_MAX_DIFF_SATS=0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue