Commit graph

51 commits

Author SHA1 Message Date
fusion44
c6d17a8f8a
feat: improve CLN list channel implementation
refs #140
2022-08-03 20:43:25 +02:00
fusion44
ef34b42119
feat: log negative confirmation results from LND
refs #137
2022-08-01 19:21:29 +02:00
fusion44
6fada4ce42
feat: add some tx conf safeguards to GenericTx
refs #137
2022-07-31 18:01:02 +02:00
fusion44
d5d827ec5d
feat[CLN]: add error checks in LN models 2022-07-23 16:36:55 +02:00
fusion44
bed65dd97b
fix(CLN): fix multiple issues with send-payment
* CLN PaymentStatus decoding was incorrect
* don't set Amount when user passes None as the amount
* catch gRPC errors and return appropriate status codes
* clarify in docs that implementation behavior is different when
   attempting to pay an already paid invoice

refs #129, refs #131
2022-07-04 21:06:11 +02:00
fusion44
d997b17529
fix: decoding of bolt11 invoices with route hints
refs #129
2022-07-04 18:45:45 +02:00
fusion44
97c51da630
fix: check for none when parsing CLN Payment
refs #129
2022-07-01 20:47:58 +02:00
fusion44
0f06017b1c
feat: add optional currency field to PaymentRequest 2022-07-01 20:12:36 +02:00
fusion44
b318a494fc
feat: improve wallet readiness status detection 2022-06-17 21:14:33 +02:00
fusion44
2f5ce09b56
refactor: remove CLN socket impl; code cleanup
This implementation isn't used and was very inefficient due to
py-lightning not supporting asyncio.

Some minor fixes and code formatting
2022-06-12 08:06:55 +02:00
/rootzoll
15750e8149
#94 pubkey info on lightning lite info (#108) 2022-06-10 20:52:25 +02:00
fusion44
eb87b0501b
refactor: send warmup data to SSE clients
refs #97
2022-06-10 19:45:55 +02:00
fusion44
493d8039fa
refactor: improve startup procedure
During startup the API will try to connect to Bitcoin Core and the
Lightning Node. If it can't connect it will check every "n" seconds
(currently 2s) and connect when available. A new SSE event
called "system_startup_info" is introduced. This event contains
all startup status information during the startup procedure.

The old wallet_locked event is obsolete.

Sample:
--------------------------
event: system_startup_info
data: {"bitcoin": "offline", "bitcoin_msg": "", "lightning": "offline", "lightning_msg": "Unable to connect to LND daemon, waiting..."}
--------------------------
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "offline", "lightning_msg": "Unable to connect to LND daemon, waiting..."}
--------------------------
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "locked", "lightning_msg": "Wallet locked, unlock it to enable full RPC access"}
--------------------------
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "done", "lightning_msg": ""}
--------------------------
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "bootstraping", "lightning_msg": "RPC not yet available"}
--------------------------

refs #97
2022-06-06 19:29:21 +02:00
fusion44
887d44be44
chores: remove unused health messages; Fix typos
closes remove confusing "health" message in system_info #95
2022-06-04 14:46:03 +02:00
fusion44
de9a96e621
feat: implement Core Lightning gRPC backend (#98)
Some remaining issues with current implementation:

Some remaining issues with current implementation:

* Some calls require shell access to lightning-cli as some gRPC calls are not yet implemented
* Getting on-chain fund flows is not as nice as it is with LND and required access to the Core Lightning SQlite database
* With current API you can only get current outputs
* High probability of bugs arising

closes #45
2022-06-04 14:10:44 +02:00
fusion44
a34dd7954c
chore: apply pre_commit, fix typos, update deps 2022-05-18 18:20:13 +02:00
rootzoll
79a1690d11 fix if softforks unavailable 2022-05-18 17:31:43 +02:00
/rootzoll
57f733ebb5
Adding identity_uri to /lightning/get-info (#89) 2022-05-18 00:14:35 +02:00
/rootzoll
5f9bdf4a45
merge: add connection info endpoint (#86) 2022-05-12 19:49:01 +02:00
/rootzoll
d5a7e3f186
Channels: Open, List & Close (#82) 2022-05-09 19:45:18 +02:00
fusion44
7d452be179
feat: implement "rawblock" zmq sub as a fallback
Lightning Polar only exposes "rawblock" and not "hashblock
=> make it configurable which one to use
2022-04-05 16:40:18 +02:00
fusion44
516550bd9f
chore: format source using the pre_commit command 2022-03-20 17:20:56 +01:00
fusion44
9665d694b7
feat: check defer starting LN and Bitcoin handlers
This really applies only to RaspiBlitz. Depending on the current
setup step there still isn't a Bitcoin Deamon or Lightning Node running.
We must defer the registration of all those handlers until later when
everything is properly setup.

Since there is a final reboot after the setup there is no need to
check in the background whether setup is finished. The API server
is restartet anyway.

refs #71
2022-03-19 09:29:09 +01:00
Stefan Stammberger
233a41eb96
feat: implement forward success SSE notifications
refs #64
2022-01-15 14:27:08 +01:00
Stefan Stammberger
78db9f3d71
feat: implement basic fee revenue endpoint
closes #48
2022-01-09 20:20:21 +01:00
Stefan Stammberger
4157058a54
feat: implement get-system-info backends
Raspiblitz and native-python implementations should work.
Only feature still missing is system health related stuff.

refs #47
2021-12-25 16:53:42 +01:00
Stefan Stammberger
316b105cb0
feat: implement fee estimation endpoint
closes #44
2021-12-06 18:38:01 +01:00
Stefan Stammberger
7e2d383ea5
fix: process payment requests with route hints
fixes #54
2021-12-04 12:13:23 +01:00
Stefan Stammberger
782464b61d
feat: implement handling of locked wallets
* new endpoint: /lightning/unlock-wallet
* ln endpoints return HTTP_423_LOCKED status if wallet is locked
* bootup sequence defers ln listeners setup if wallet is locked

refs #34
2021-11-24 11:12:10 +01:00
Stefan Stammberger
3c7a22e417
feat: implement /lightning/new-address endpoint
closes #43
2021-11-22 21:54:42 +01:00
Stefan Stammberger
58af4f56d5
feat: send full LnInfo when a new client connects 2021-11-18 19:50:04 +01:00
Stefan Stammberger
ae59ef9181
feat: implement /lightning/list-all-tx endpoint
This call currently fetches all invoices, payments and transactions each
time the endpoint is hit. TODO: Find a better way to cache this.
Possibly it is a good idea to build this list once on startup and
keep it updatedwhen new transactions roll in.

refs #30
2021-11-02 19:02:08 +01:00
Stefan Stammberger
21f0f389e3
refactor: implement grpc loaders as classmethods 2021-10-31 18:15:43 +01:00
Stefan Stammberger
5e068f0cb1
feat: implement list-onchain-tx endpoint for LND
Low level on-chain API in preparation to implement #30.
2021-10-31 16:49:15 +01:00
Stefan Stammberger
2d18e5a33f
refactor: Rename poorly named classes and events 2021-10-05 19:34:06 +02:00
Stefan Stammberger
a8355687d4
feat: implement send coins (on-chain) endpoint
closes #15
2021-10-03 20:55:28 +02:00
Stefan Stammberger
acf7c7a03d
fix: Argument errors in Bip9Statistics.from_rpc 2021-10-02 12:02:29 +02:00
Stefan Stammberger
abc8b258ff
fix: BtcLocalAddress.from_rpc method 2021-10-01 22:31:22 +02:00
Stefan Stammberger
ffdfe9fed6
feat: implement decode pay req endpoint
closes #16
2021-09-20 17:00:36 +02:00
Stefan Stammberger
43783549d1
feat: implement get a raw system logs endpoint
Not tested yet on a real Raspiblitz!

refs #18
2021-09-20 11:22:50 +02:00
Stefan Stammberger
c673394fa8
refactor: system API
refs #11
2021-09-05 20:23:59 +02:00
Stefan Stammberger
79be6eaf34
refactor: lightning API
refs #11
2021-09-05 19:19:53 +02:00
Stefan Stammberger
f482c441cc
chore: format all files using black 2021-09-05 08:56:53 +02:00
Stefan Stammberger
f0b911db1e
refactor: bitcoin API
refs #11
2021-09-04 15:38:17 +02:00
Stefan Stammberger
2b03882907
refactor: rename "password_a" to "password" 2021-08-17 18:53:53 +02:00
Stefan Stammberger
7ecf29cef0
feat: enhancements to /system/login
* password_a must now be posted in the request body as a json object
* password is now read from the .env file instead of hardcoded
* password will be checked if it is min 8 chars
* one_time_password is not yet in use and optional
2021-08-17 18:34:05 +02:00
Stefan Stammberger
0c90450bea
feat: improve how to fetch wallet balances
* /lightning/getbalance now returns onchain funds and channel
balances as one object
* changes to the wallet balance are now pushed through the SSE channel
2021-08-03 21:20:24 +02:00
Stefan Stammberger
e65c5bfc3f
feat: implement LN info endpoint / SSE messages 2021-08-02 20:30:18 +02:00
Stefan Stammberger
38c93f6b58
feat: implement sendpayment endpoint for LND 2021-07-27 21:10:25 +02:00
Stefan Stammberger
da5d97a550
feat: watch for invoice changes and push via SSE
Currently only LND is implemented.
2021-07-25 18:15:26 +02:00