Commit graph

205 commits

Author SHA1 Message Date
fusion44
554709db14
chore: fix wakatime EOL 2022-07-23 15:12:20 +02:00
fusion44
cdfdba16fa
chore: lock dependencies to latest versions 2022-07-23 15:07:32 +02:00
fusion44
45436bcc8e
fix[CLN]: return onchain funds in sat not msat 2022-07-23 14:48:34 +02:00
fusion44
ce8be908ac
fix: /reboot should reboot and not shutdown 2022-07-23 13:59:38 +02:00
fusion44
2a11b21a83
feat: add .wakatime_project file 2022-07-20 08:10:52 +02:00
fusion44
92ed1832f8
Implement unlock CLN wallet for RaspiBlitz only (#135)
* feat: implement SSH CLN wallet unlock on the Blitz
* feat: implement API CLN wallet unlock on the Blitz
* feat: return error when wallet is already unlocked
* docs: update unlock-wallet docs
* fix: add more safety checks
    * return 423 error on API calls if wallet locked
    * check if unlock script exits with 1
* fix: call_script deprecation warning crash

closes #133
2022-07-13 07:08:00 +02:00
pre-commit-ci[bot]
447c259699 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0)
2022-07-10 16:46:49 +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
100bb80b17
fix: don't assume that there is a bolt11 string
On keysend payments there usually is no bolt11 string.

refs #125
2022-07-01 21:12:54 +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
911e1a7976
fix: handle all LND init events correctly
fixes #130 (LND Unlock Error)
2022-07-01 19:38:57 +02:00
rootzoll
62965584fd correct file ownership after make sync 2022-06-30 12:48:58 +02:00
rootzoll
91becc8873 fix changed path/user of blitzapi on raspiblitz 2022-06-30 12:44:13 +02:00
openoms
9203e0c031
feat: call_script with sudo where needed (#127)
* call_script with sudo

* add call_sudo_script and use where needed

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-26 13:13:50 +02:00
fusion44
868070214a
feat: improve error handling and logging 2022-06-26 11:06:56 +02:00
fusion44
d573217bd7
fix(LND_GRPC): two potential async bugs
* gRPC channel not created in all cases
* possible infinite loop while waiting for lnd to boot up

refs #126
2022-06-26 10:59:56 +02:00
fusion44
1cfab33a5c
Merge pull request #119 from openoms/fix-dependencies
fix: install for python 3.9 and add hash
2022-06-19 10:30:04 +02:00
openoms
b54ee77745
fix: install for python 3.9 and add hash 2022-06-18 22:45:56 +01:00
pre-commit-ci[bot]
47d3d1023c
[pre-commit.ci] pre-commit autoupdate (#112)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v3.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v3.2.0...v4.3.0)
- [github.com/psf/black: 21.9b0 → 22.3.0](https://github.com/psf/black/compare/21.9b0...22.3.0)
- [github.com/pycqa/isort: 5.6.4 → 5.10.1](https://github.com/pycqa/isort/compare/5.6.4...5.10.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-17 21:39:48 +02:00
fusion44
778139d74c
fix: pre-commit hook error and formatting issues 2022-06-17 21:35:35 +02:00
fusion44
b318a494fc
feat: improve wallet readiness status detection 2022-06-17 21:14:33 +02:00
/rootzoll
453937b0f6
fix core lightning db path (#116) 2022-06-17 00:09:27 +02:00
/rootzoll
cc05605853
filter apps for core lightning & bitcoin-only 2022-06-16 21:17:33 +02:00
/rootzoll
67a9242301
fix bitcoin-only Warumup info (#114) 2022-06-16 15:30:14 +02:00
/rootzoll
cb71b26431
fix setup block (#113) 2022-06-14 14:44:55 +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
fusion44
c08e604d55
feat: send warmup data as available
When neither BTC nor LN is running:
send hardware_info

When BTC is running and LN is not:
send hardware_info and btc_info

When both are running:
send the full package

This code doesn't keep track of which connection has received
which data already, so it may send data twice data to the client
when the startup state changes. Especially the hardware info
is rather data intensive. This is OK for now, to keep the code simple.

closes #110
2022-06-12 07:59:40 +02:00
/rootzoll
15750e8149
#94 pubkey info on lightning lite info (#108) 2022-06-10 20:52:25 +02:00
fusion44
a373957914
Merge pull request #109 from fusion44/startup_refactor
Startup process refactoring

fixes #97
2022-06-10 20:04:27 +02:00
fusion44
50fae41158
Merge branch 'main' of github.com:fusion44/blitz_api into startup_refactor 2022-06-10 19:52:18 +02:00
fusion44
eb87b0501b
refactor: send warmup data to SSE clients
refs #97
2022-06-10 19:45:55 +02:00
fusion44
4f33bdfc79
fix: send a disabled msg when ln_node is "none"
refs #97
2022-06-08 20:39:12 +02:00
fusion44
95ed6e812e
refactor: improve startup procedure for CLN too
refs #97
2022-06-08 19:25:45 +02:00
fusion44
41cc8208e7
refactor: move bitcoin config the bitcoin repo 2022-06-06 20:21:19 +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
/rootzoll
2962b522b7
Fix Update Setup (#107)
* #104 fix default value
* handle update state on setup
2022-06-06 15:36:30 +02:00
rootzoll
ec39b9aeb1 #102 change error string detail 2022-06-06 09:54:28 +02:00
Christoph Stenglein
80282c318f
add correct expiry time definition and set to 60m (#104) 2022-06-06 09:42:52 +02:00
/rootzoll
d890907028
#100 fix bitcoin-only (#101) 2022-06-04 16:45:32 +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
762b79fde2
refactor: make running without LN explicit in .env 2022-06-04 14:16:19 +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
bb6d6a6bff
chore: dep update; update version to 0.5.0 2022-05-28 12:38:10 +02:00
geco91
0054945171
Exclude .git on sync_to_blitz (#91) 2022-05-27 01:03:37 +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