mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
[doc] Add lightning-pay script as example for using pylightning library
This commit is contained in:
parent
d18d950a0a
commit
6470630db9
1 changed files with 12 additions and 1 deletions
|
@ -14,9 +14,12 @@ pylightning is available on pip
|
|||
pip install pylightning
|
||||
```
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
```py
|
||||
"""
|
||||
Generate invoice on one daemon and pay it on the other
|
||||
"""
|
||||
from lightning import LightningRpc
|
||||
import random
|
||||
|
||||
|
@ -38,3 +41,11 @@ print(route)
|
|||
# Pay invoice
|
||||
print(l1.sendpay(route['route'], invoice['payment_hash']))
|
||||
```
|
||||
|
||||
Also see the included [lightning-pay](./lightning-pay) script, which uses the client library to pay invoices
|
||||
|
||||
```sh
|
||||
lightning-pay <bolt11 invoice>
|
||||
# or explicitly with
|
||||
lightning-pay <destination_id> <amount in millisatoshi> <payment_hash> <min_final_cltv_expiry>
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue