diff --git a/README.md b/README.md index 4840eadf..efbc14f7 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,45 @@ -# Lightning.Pub +  [](http://makeapullrequest.com) [](https://t.me/ShockBTC) -[](https://twitter.com/ShockBTC) + -
-`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  +- 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. + + -#### 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. diff --git a/env.example b/env.example index 6e2a814a..63aa7fbc 100644 --- a/env.example +++ b/env.example @@ -1,24 +1,41 @@ -LND_ADDRESS=127.0.0.1:10001 -LND_CERT_PATH=C:\Users\user\.polar\networks\2\volumes\lnd\alice\tls.cert -LND_MACAROON_PATH=C:\Users\user\.polar\networks\2\volumes\lnd\alice\data\chain\bitcoin\regtest\admin.macaroon +#LND +LND_ADDRESS=127.0.0.1:10009 +LND_CERT_PATH=/root/.lnd/tls.cert +LND_MACAROON_PATH=/root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon + +#DB DATABASE_FILE=db.sqlite + +#LOCAL +ADMIN_TOKEN= +PORT=8080 JWT_SECRET=bigsecrethere + +#LIGHTNING OUTBOUND_MAX_FEE_BPS=60 OUTBOUND_MAX_FEE_EXTRA_SATS=100 + +#ROOT_FEES INCOMING_CHAIN_FEE_ROOT_BPS=0 -OUTGOING_CHAIN_FEE_ROOT_BPS=60 #this is applied only to withdrawls from application wallets INCOMING_INVOICE_FEE_ROOT_BPS=0 -OUTGOING_INVOICE_FEE_ROOT_BPS=60 #this is applied only to withdrawals from application wallets -INCOMING_INVOICE_FEE_USER_BPS=0 #defined by app this is just default -OUTGOING_INVOICE_FEE_USER_BPS=60 #defined by app this is just default -TX_FEE_INTERNAL_ROOT_BPS=60 #this is applied only to withdrawls from application wallets -TX_FEE_INTERNAL_USER_BPS=60 #defined by app this is just default +OUTGOING_CHAIN_FEE_ROOT_BPS=60 #applied to application debits +OUTGOING_INVOICE_FEE_ROOT_BPS=60 #applied to application debits +TX_FEE_INTERNAL_ROOT_BPS=60 #applied to inter-application txns + +#APP_FEES +INCOMING_INVOICE_FEE_USER_BPS=0 #app default +OUTGOING_INVOICE_FEE_USER_BPS=60 #app default +TX_FEE_INTERNAL_USER_BPS=60 #intra-application tx default + +#NOSTR NOSTR_PUBLIC_KEY= NOSTR_PRIVATE_KEY= -NOSTR_RELAYS=wss://nostr-relay.wlvs.space +NOSTR_RELAYS=wss://relay.unikku.com NOSTR_ALLOWED_PUBS= -SERVICE_URL=http://localhost:8080 -ADMIN_TOKEN= + +#LNURL +SERVICE_URL=https://test.lightning.pub + +#DEV +MOCK_LND=false ALLOW_BALANCE_MIGRATION=false -PORT=8080 -MOCK_LND=false \ No newline at end of file diff --git a/pub_dash_concept.jpg b/pub_dash_concept.jpg new file mode 100644 index 00000000..958ff70f Binary files /dev/null and b/pub_dash_concept.jpg differ diff --git a/pub_logo.png b/pub_logo.png new file mode 100644 index 00000000..65bf0040 Binary files /dev/null and b/pub_logo.png differ