diff --git a/.env.example b/.env.example index 993b6cd84..2596be303 100644 --- a/.env.example +++ b/.env.example @@ -9,7 +9,7 @@ LNBITS_DISABLED_EXTENSIONS="amilk,events" LNBITS_FORCE_HTTPS=1 LNBITS_SERVICE_FEE="0.0" -# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, LndWallet, CLightningWallet, LnbitsWallet +# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, LndWallet (gRPC), LndRestWallet, CLightningWallet, LnbitsWallet LNBITS_BACKEND_WALLET_CLASS=LntxbotWallet CLIGHTNING_RPC="/home/bob/.lightning/bitcoin/lightning-rpc" diff --git a/README.md b/README.md index f642d1be6..67a06fff7 100644 --- a/README.md +++ b/README.md @@ -7,80 +7,59 @@ LNbits  -# LNbits v0.1 BETA, free and open-source lightning-network wallet/accounts system -https://lnbits.com, or run your own LNbits server! +# LNbits v0.1 BETA, free and open-source lightning-network wallet/accounts system + +Use [lnbits.com](https://lnbits.com), or run your own LNbits server! + +LNbits is a very simple Python server that sits on top of any funding source, and can be used as: -LNbits is a very simple Python server that sits on top of any funding source, and can be used as: * Accounts system to mitigate the risk of exposing applications to your full balance, via unique API keys for each wallet -* Extendable platform for exploring lightning-network functionality via LNbits extension framework +* Extendable platform for exploring lightning-network functionality via LNbits extension framework * Part of a development stack via LNbits API * Fallback wallet for the LNURL scheme -* Instant wallet for LN demonstrations +* Instant wallet for LN demonstrations -The wallet can run on top of any lightning-network funding source, currently there is support for LND, CLightning, Lntxbot, LNpay, OpenNode, with more being added regularily. +The wallet can run on top of any lightning-network funding source, currently there is support for LND, CLightning, Lntxbot, LNpay, OpenNode, with more being added regularily. + +See [lnbits.org](https://lnbits.org) for more detailed documentation. ## LNbits as an account system -LNbits is packaged with tools to help manage funds, such as a table of transactions, line chart of spending, export to csv + more to come.. +LNbits is packaged with tools to help manage funds, such as a table of transactions, line chart of spending, export to csv + more to come..  -Each wallet also comes with its own API keys, to help partition the exposure of your funding source. +Each wallet also comes with its own API keys, to help partition the exposure of your funding source. -(LNbits M5StackSats available here https://github.com/arcbtc/M5StackSats) +(LNbits M5StackSats available here https://github.com/arcbtc/M5StackSats)  ## LNbits as an LNURL-withdraw fallback -LNURL has a fallback scheme, so if scanned by a regular QR code reader it can default to a URL. LNbits exploits this to generate an instant wallet using the LNURL-withdraw. + +LNURL has a fallback scheme, so if scanned by a regular QR code reader it can default to a URL. LNbits exploits this to generate an instant wallet using the [LNURL-withdraw](https://github.com/btcontract/lnurl-rfc/blob/master/lnurl-withdraw.md).  -https://github.com/btcontract/lnurl-rfc/blob/master/spec.md -Using **lnbits.com/?lightning="LNURL-withdraw"** will trigger a withdraw that builds an LNbits wallet. +Using **lnbits.com/?lightning="LNURL-withdraw"** will trigger a withdraw that builds an LNbits wallet. Example use would be an ATM, which utilises LNURL, if the user scans the QR with a regular QR code scanner app, they will stilll be able to access the funds.  ## LNbits as an insta-wallet + Wallets can be easily generated and given out to people at events (one click multi-wallet generation to be added soon). "Go to this website", has a lot less friction than "Download this app".  -# Running LNbits locally -Download this repo +## Running LNbits locally -LNbits uses [Flask](http://flask.pocoo.org/). -Feel free to contribute to the project. +See the [development docs](docs/devs/installation.md) for details on installation and setup. -Application dependencies ------------------------- -The application uses [Pipenv][pipenv] to manage Python packages. -While in development, you will need to install all dependencies: - - $ pipenv shell - $ pipenv install --dev - -You will need to set the variables in .env.example, and rename the file to .env - - - -Running the server ------------------- - - $ flask migrate - $ flask run - -There is an environment variable called `FLASK_ENV` that has to be set to `development` -if you want to run Flask in debug mode with autoreload - -[pipenv]: https://docs.pipenv.org/#install-pipenv-today - -# Tip me -If you like this project and might even use or extend it, why not send some tip love! -https://lnbits.com/paywall/GAqKguK5S8f6w5VNjS9DfK +## Tip me +If you like this project and might even use or extend it, why not [send some tip love](https://lnbits.com/paywall/GAqKguK5S8f6w5VNjS9DfK)! [github-actions]: https://github.com/lnbits/lnbits/actions [github-actions-badge]: https://github.com/lnbits/lnbits/workflows/test%20suite/badge.svg diff --git a/docs/devs/installation.md b/docs/devs/installation.md index c3865de92..3502df325 100644 --- a/docs/devs/installation.md +++ b/docs/devs/installation.md @@ -5,30 +5,47 @@ title: Installation nav_order: 1 --- - Installation ============ -LNbits uses [Flask](http://flask.pocoo.org/). - +Download this repo and install the dependencies. Application dependencies ------------------------ The application uses [Pipenv][pipenv] to manage Python packages. -While in development, you will need to install all dependencies (includes packages like `black` and `flake8`): +While in development, you will need to install all dependencies: - $ pipenv shell - $ pipenv install --dev +```sh +$ pipenv shell +$ pipenv install --dev +``` +You will need to set the variables in `.env.example`, and rename the file to `.env`. + + + +You might also need to install additional packages, depending on the [backend wallets](../guide/wallets.md) you configured. +E.g. when you want to use LND you have to `pipenv install lnd-grpc`. + +Take a look at [Polar](https://lightningpolar.com/) for an excellent way of spinning up a Lightning Network dev environment. Running the server ------------------ - $ flask run +LNbits uses [Flask](http://flask.pocoo.org/) as an application server. + +```sh +$ pipenv run flask migrate +$ pipenv run flask run +``` There is an environment variable called `FLASK_ENV` that has to be set to `development` if you want to run Flask in debug mode with autoreload +[pipenv]: https://pipenv.pypa.io/ -[pipenv]: https://docs.pipenv.org/#install-pipenv-today +Frontend +-------- + +The views are build using [Vue.js and Quasar](https://quasar.dev/start/how-to-use-vue). diff --git a/lnbits/core/templates/core/index.html b/lnbits/core/templates/core/index.html index 7db8490a9..8b4d8cd87 100644 --- a/lnbits/core/templates/core/index.html +++ b/lnbits/core/templates/core/index.html @@ -47,7 +47,7 @@
Events alows you to make a wave of tickets for an event, each ticket is in the form of a unqiue QRcode, which the user presents at registration. Events comes with a shareable ticket scanner, which can be used to register attendees.
- Created by, Ben Arc
+ Events alows you to make a wave of tickets for an event, each ticket is
+ in the form of a unqiue QRcode, which the user presents at registration.
+ Events comes with a shareable ticket scanner, which can be used to
+ register attendees.
+
+ Created by, Ben Arc
+
+
Charge people per word for contacting you. Possible applications incude, paid support ticketing, PAYG language services, contact spam protection.
- Created by, Ben Arc
+ Charge people per word for contacting you. Possible applications incude,
+ paid support ticketing, PAYG language services, contact spam
+ protection.
+
+ Created by, Ben Arc
+
GET /paywall/api/v1/paywalls
+ GET /paywall/api/v1/paywalls
{"X-Api-Key": <invoice_key>}
POST
- /paywall/api/v1/paywalls
POST /paywall/api/v1/paywalls
{"X-Api-Key": <admin_key>}
{"amount": <integer>, "description": <string>,
- "memo": <string>, "remembers": <boolean>,
- "url": <string>}
{"amount": <integer>, "description": <string>, "memo":
+ <string>, "remembers": <boolean>, "url":
+ <string>}
{"amount": <integer>, "description": <string>,
- "id": <string>, "memo": <string>,
- "remembers": <boolean>, "time": <int>,
- "url": <string>, "wallet": <string>}
+ {"amount": <integer>, "description": <string>, "id":
+ <string>, "memo": <string>, "remembers": <boolean>,
+ "time": <int>, "url": <string>, "wallet":
+ <string>}
curl -X POST {{ request.url_root }}paywall/api/v1/paywalls -d
- '{"url": <string>, "memo": <string>,
- "description": <string>, "amount": <integer>,
- "remembers": <boolean>}' -H
- "Content-type: application/json" -H "X-Api-Key: {{
- g.user.wallets[0].adminkey }}"
+ '{"url": <string>, "memo": <string>, "description":
+ <string>, "amount": <integer>, "remembers":
+ <boolean>}' -H "Content-type: application/json" -H "X-Api-Key:
+ {{ g.user.wallets[0].adminkey }}"
Body (application/json)
- {"amount": <integer>}
+ {"amount": <integer>}
Returns 201 CREATED (application/json)
- {"checking_id": <string>, "payment_request": <string>}
+ {"checking_id": <string>, "payment_request":
+ <string>}
Curl example
curl -X POST {{ request.url_root }}paywall/api/v1/paywalls/<paywall_id>/invoice -d
- '{"amount": <integer>}' -H
- "Content-type: application/json"
+ >curl -X POST {{ request.url_root
+ }}paywall/api/v1/paywalls/<paywall_id>/invoice -d '{"amount":
+ <integer>}' -H "Content-type: application/json"
Body (application/json)
- {"checking_id": <string>}
+ {"checking_id": <string>}
Returns 200 OK (application/json)
- {"paid": false}
- {"paid": true, "url": <string>, "remembers": <boolean>}
+ {"paid": false}
+ {"paid": true, "url": <string>, "remembers":
+ <boolean>}
Curl example
curl -X POST {{ request.url_root }}paywall/api/v1/paywalls/<paywall_id>/check_invoice -d
- '{"checking_id": <string>}' -H
- "Content-type: application/json"
+ >curl -X POST {{ request.url_root
+ }}paywall/api/v1/paywalls/<paywall_id>/check_invoice -d
+ '{"checking_id": <string>}' -H "Content-type: application/json"
{{ paywall.description }}
+{{ paywall.description }}
{% endif %}GET /tpos/api/v1/tposs
@@ -31,9 +26,7 @@
POST /tpos/api/v1/tposs
+ POST /tpos/api/v1/tposs
{"X-Api-Key": <invoice_key>}
GET /withdraw/api/v1/links
+ GET /withdraw/api/v1/links
{"X-Api-Key": <invoice_key>}
POST
- /withdraw/api/v1/links
+ POST /withdraw/api/v1/links
{"X-Api-Key": <admin_key>}