* Fix dev_setfees to set slow and normal fees correctly.
Due to a bug def_setfees(100, slow=100) would instead set immediate and
normal fees to 100. This behavior has been updated to set fees to
correct values, make the values truly optional as per documentation and
unit test this behavior.
* Fix pay() to set msatoshi, description and risk factor properly
Due to a bug pay(invoice, description='1000') resulted in payment of
1000 msatoshi instead. This was fixed and covered with tests.
* Fix named args in listpayments, listpeers and connect
* Do not pass None to methods where it is default value
* Make description on invoice and pay match.
Suggested-by: @ZmnSCPxj
* Fix dev_setfees to set slow and normal fees correctly.
Due to a bug def_setfees(100, slow=100) would instead set immediate and
normal fees to 100. This behavior has been updated to set fees to
correct values, make the values truly optional as per documentation and
unit test this behavior.
* Fix pay() to set msatoshi, description and risk factor properly
Due to a bug pay(invoice, description='1000') resulted in payment of
1000 msatoshi instead. This was fixed and covered with tests.
* Fix named args in listpayments, listpeers and connect
* Do not pass None to methods where it is default value
* Make description on invoice and pay match.
Suggested-by: @ZmnSCPxj
pylightning: A python client library for lightningd
Installation
Note: With Python 2 you need to have the futures python library installed to be able to use pylightning:
pip install futures
pylightning is available on pip
pip install pylightning
Example
fromlightningimportLightningRpcimportrandom# Create two instances of the LightningRpc object using two different c-lightning daemons on your computerl1=LightningRpc("/tmp/lightning1/lightning-rpc")l5=LightningRpc("/tmp/lightning5/lightning-rpc")info5=l5.getinfo()print(info5)# Create invoice for test paymentinvoice=l5.invoice(100,"lbl{}".format(random.random()),"testpayment")print(invoice)# Get route to l1route=l1.getroute(info5['id'],100,1)print(route)# Pay invoiceprint(l1.sendpay(route['route'],invoice['payment_hash']))