-
-
Notifications
You must be signed in to change notification settings - Fork 371
feat: Blink funding source #2477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
96ccbf2 to
0ac3ce1
Compare
|
@prusnak ok |
|
Maybe our typing guru @dni can help with the typing issues? :) |
|
Hi - I could use some feedback on the unit test which was written before @motorina0 came up with the current unit test structure, but afaik the rest of the PR should be in theory OK. If @openoms could please confirm that this branch is working to satisfaction, including all the extensions, e.g. lnurlp, events, tipjar and any other commonly used extensions that would be most helpful |
|
@openoms i confirmed this branch is working, i used this .env.example, not the one from previous @prusnak @motorina0 unit test is for graphql not rest api, let me know if you need it to be adjusted to fit the others |
|
Where are we with this current PR? i'm getting a little thin on free time here in the next few..., so would be good to let me know |
We still need to figure out the typing issues and fix them (mypy/pyright) |
I'm reviewing it now. |
|
I've tested a good list of extensions using this branch using Zeus (connecting to LND) and with another Blink connected LNbits wallet mixed:
only has an issue with the LNcalendar - the incoming payment is not picked up - only getting Apart from the documentation change suggestion above I found this PR to be fully functional and working as expected. |
|
I have reviewed the code and made some refactoring. |
|
@openoms regarding
This is expected, the websocket connection is not implemented, I will handle that next. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #2477 +/- ##
==========================================
- Coverage 61.35% 60.67% -0.68%
==========================================
Files 69 70 +1
Lines 9925 10117 +192
==========================================
+ Hits 6089 6138 +49
- Misses 3836 3979 +143 ☔ View full report in Codecov by Sentry. |
|
The CI is green now, thanks @motorina0! Can you please retest @openoms with the changes from Vlad? If you say it still works, we can merge 🎉 |
|
Please wait with the testing until we merge PR #2577 into this PR so we can also test WebSockets |
Done, payment notifications can be tested now. |
|
CI not failing anymore. Marked as ready for review (turning off the draft status). |
|
@motorina0 ran a quick test with the updates using the websocket. Found the LNcalendar unreliable especially when paying the invoice with a Blink funded LNbits subaccount or with another Blink wallet. |
| settlementVia { | ||
| ... on SettlementViaLn { | ||
| preImage | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The payments are not picked up when paying with Blink wallet or a Blink funded LNbits wallets which means that the intra-ledger payments are not picked up (not sure why only in LNcalendar).
The Blink backend does decide to settle depending on the invoice. It does return the preimage in this case also since it is known when creating the invoice.
.... on SettlementViaIntraLedger needs to be added to the query to cover for this case:
| settlementVia { | |
| ... on SettlementViaLn { | |
| preImage | |
| } | |
| settlementVia { | |
| ... on SettlementViaLn { | |
| preImage | |
| } | |
| ... on SettlementViaIntraLedger { | |
| preImage | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change does not seem to be necessary as Blink intraledger payments are being picked up in most extensions
I did test LNcalendar with a CLN backed LNbits instance where it had no problems. It is a useful extension I would plan to use myself and testing it particularly beacuse it was the only one not working. Hope to have a solution here: #2477 (comment) |
|
Sounds like an issue with lncalendar and self payments, rather than blink |
|
Possible fixed with lnbits/lncalendar#8 |
|
@dni @talvasconcelos can you please review so we can finally merge? |
Weird - I see it in both |
|
Weird, i must have some bundle issue. My mistake, will try again 👍 |
|
Its outside of the scope of this pr, but the issue was LNBITS_ALLOWED_FUNDING_SOURCES in env needing Blinkwallet, even though LNBITS_ADMIN_UI=true was set. |
* refactor: mark `graphql_query` as private (`_` prefix) * feat: set default value for `blink_api_endpoint` * fix: raise if HTTP call failed * refactor: move private method to the bottom * refactor: make `wallet_id` a property * fix: key mapping for attribute * chore: fix `mypy` * chore: fix `make check` * refactor: extract query strings * refactor: extract `BlinkGrafqlQueries` class * chore: code clean-up * chore: add `try-catch` * refactor: extract `tx_query` * chore: format grapfhql queries * fix: set funding source class * chore: `make format` * fix: test by following the other patterns
Co-authored-by: openoms <[email protected]>
* feat: add websocket connection to blink * feat: close websocket on shutdown
|
Thank you all who have worked on improving and reviewing this PR. As you might know there is a 1M sats bounty offered for this feature which is now completed and ready to be paid. The original initiative and the bulk of the work was taken up by @bitkarrot who would be entitled to receive the bounty, but given the additional work done (especially by @motorina0 and all the reviewers) I’d like to make sure that we offer to share the bounty if wanted. So please comment if you have an opinion about how it would be best to deal with the payout. Planning to finalize it by the end of this week. |
|
As far as I'm concerned the bounty belongs entirely to @bitkarrot |
Same 👍 |
supersedes #2270 (this PR is just a rebase and squash of that PR)
ready for review
still in draft, because type checks (mypy and pyright) still need to be fixed