Commit graph

145 commits

Author SHA1 Message Date
rootzoll
6ceaacfc23 Merge branch 'main' of https://github.com/fusion44/blitz_api 2022-03-23 22:14:41 +01:00
rootzoll
55144f3c6a fresh setup implementation 2022-03-23 22:06:31 +01:00
fusion44
85d2de19e4
chore: fix some naming issues 2022-03-23 21:03:50 +01:00
Christoph Stenglein
924f0643ed
implement reboot & shutdown (#70)
* implement reboot & shutdown
* fix waiting for script by using event loop
* implemented suggestions
* remove unused import
* implement suggestions #2
2022-03-23 20:20:58 +01:00
rootzoll
f057f37cf0 first implementation working for recovery 2022-03-23 00:52:37 +01:00
rootzoll
aa4435656b start also with blitz without lightning 2022-03-21 13:03:15 +01:00
fusion44
84fecd1dcc
feat: implement simple docker compose dev env
refs #62
2022-03-20 19:55:52 +01:00
fusion44
516550bd9f
chore: format source using the pre_commit command 2022-03-20 17:20:56 +01:00
fusion44
20f60abaf3
feat: add a pre-commit hook to format source code
refs #14
2022-03-20 16:00:25 +01:00
fusion44
028cfc866e
feat: improve error messages on startup failures 2022-03-20 10:04:00 +01:00
fusion44
b1dc854dd2
refactor: use app.utils.redis_get() everywhere 2022-03-19 12:36:03 +01:00
fusion44
6546240dff
feat: add ping check to sync_to_blitz script 2022-03-19 12:22:15 +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
rootzoll
56039a0593 first implementation /status & /setup_start_info 2022-03-18 12:04:02 +01:00
rootzoll
de840cf1e0 improved sync_to_blitz script 2022-03-16 23:33:44 +01:00
/rootzoll
d466d3ab47
Add TODO for system redis channel 2022-03-16 09:46:58 +01:00
/rootzoll
803404726d
preparing for new setup logic 2022-03-16 09:45:28 +01:00
fusion44
54b4a32f4e
feat: improve sync script 2022-03-13 18:46:47 +01:00
Stefan Stammberger
927bffa701
fix: add fee data to SSE warmup package 2022-01-22 20:47:28 +01:00
Stefan Stammberger
04a93833c5
refactor: rename wallet balance update function 2022-01-15 14:29:55 +01:00
Stefan Stammberger
233a41eb96
feat: implement forward success SSE notifications
refs #64
2022-01-15 14:27:08 +01:00
Stefan Stammberger
18822e68cc
fix: don't update wallet if update is pending 2022-01-15 14:03:44 +01:00
Stefan Stammberger
78db9f3d71
feat: implement basic fee revenue endpoint
closes #48
2022-01-09 20:20:21 +01:00
Stefan Stammberger
c9a2b78a92
feat: add support for zero amount invoices
closes #63
2022-01-09 18:04:10 +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
9223a14798
fix: typo in blitz hardware implementation 2021-12-25 08:59:53 +01:00
Stefan Stammberger
739ebdd3a1
feat: round percentages in Blitz hardware repo 2021-12-23 16:29:10 +01:00
Stefan Stammberger
a864e134ed
fix: remove deprecated "publicIP" field 2021-12-23 16:04:02 +01:00
Stefan Stammberger
bc53069234
fix: log a warning if a Redis key doesn't exist 2021-12-23 15:25:51 +01:00
Stefan Stammberger
e4c050d4c4
fix: crash when platform was not set in .env file 2021-12-22 21:46:34 +01:00
fusion44
77db3a16cb
Merge pull request #59 from fusion44/raspiblitz-hw-codepath
Implement hardware status fetching on RaspiBlitz platform
2021-12-18 13:52:48 +01:00
Stefan Stammberger
228ae2100a
feat: set raspiblitz as default platform
Rationale: No need to change RaspiBlitz install scripts
2021-12-18 13:27:47 +01:00
Stefan Stammberger
ab0a8f2575
feat: fetch hardware data via Redis
To keep Blitz API platform independent two code paths have been
implemented. A new "platform" .env variable must be set if running
on a raspiblitz to fetch hardware data from Redis. See the comments
in .env_sample for further explanation.
2021-12-15 21:11:46 +01:00
Stefan Stammberger
316b105cb0
feat: implement fee estimation endpoint
closes #44
2021-12-06 18:38:01 +01:00
Stefan Stammberger
b51f78a349
Merge branch 'main' of github.com:fusion44/blitz_api into main 2021-12-06 18:36:23 +01:00
Stefan Stammberger
5eb39c52a0
feat: add sync to blitz make target 2021-12-05 21:14:25 +01:00
fusion44
9d16a76133
Merge pull request #56 from escapedcat/docs/readme-update
docs: simplify and rework readme
2021-12-05 10:35:37 +01:00
escapedcat
5c36c09bd2 docs: simplify and rework readme 2021-12-05 16:32:51 +08:00
Stefan Stammberger
7e2d383ea5
fix: process payment requests with route hints
fixes #54
2021-12-04 12:13:23 +01:00
Stefan Stammberger
20e0457a73
feat: send a wallet_locked_status SSE message
When someone connects to the SSE endpoint and the wallet is
locked a message with event name `wallet_lock_status` type is sent:
```js
// only sent when a new SSE connection is established and the wallet is
//  locked at the same time
event: wallet_lock_status
data: {"locked": true}
```
When the wallet is unlocked either through SSH or the API, another
event is sent:
```js
// sent always when a new connection is established when the wallet
// is unlocked, or it is sent when the wallet was unlocked after
// connection was established
event: wallet_lock_status
data: {"locked": false}
```

It is always the first thing the client receives. After the unlock
event, the usual warmup data is sent.

refs #34
2021-11-30 19:57:17 +01:00
Stefan Stammberger
8e32b68786
feat: listen for external unlocks via command line
refs #34
2021-11-30 17:18:42 +01:00
Stefan Stammberger
a7dfe14aea
feat: round verification_progress value in SSE
Bitcoin Core calculates the blockchain verification by including
unconfirmed transactions. This means that everytime there is
a new transaction, a `btc_info`  event is fired through  the SSE
channel. For clients this information is usually not  useful beyond
two digits. Solution: round to two digits for SSE events.

The full floating point value can still be fetched through
`/bitcoin/get-blockhain-info`

closes #52
2021-11-28 10:30:54 +01:00
Stefan Stammberger
71f87e06d7
feat: implement local cookie authentication
This is only useful for application running directly on the Raspiblitz.
This will create a file in ~/.blitz_api/.cookie with a valid JWT token.
Local applications can use this to authenticate to the API without
having to ask for the password. This is similar to how Bitcoin Cores
cookie auth works.
2021-11-28 08:42:52 +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
ba4aa25c01
chore: update grpc files and add WalletUnlocker 2021-11-23 20:19:03 +01:00
Stefan Stammberger
3c7a22e417
feat: implement /lightning/new-address endpoint
closes #43
2021-11-22 21:54:42 +01:00
Stefan Stammberger
63c52d2ba7
fix: encode JWT expiry time as int, not float
fixes #46
2021-11-22 20:44:14 +01:00
Stefan Stammberger
7b94aac3d8
feat: add "/system/refresh-token" endpoint
closes #41
2021-11-19 18:32:30 +01:00
Stefan Stammberger
bd6d293259
fix: tests and simplify the test code
refs# 21
2021-11-19 17:28:39 +01:00
Stefan Stammberger
964514f90c
fix: return HTTP status 401 when unauthorized
Previous status code 403 was inappropriately used.
2021-11-19 08:36:15 +01:00