-
Notifications
You must be signed in to change notification settings - Fork 52
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
Lnd manager #163
Lnd manager #163
Conversation
Looks good to me besides a few indentations that need to be fixed. |
@mably thanks for the review. As suggested by you, I have implemented the Airbnb Style Guide that we will be using from now onwards (including the files in this PR). If you don't have any technical comments I would suggest:
Alternatively, I can close this PR and open one containing the style changes for these files, but the line count to review go up 2x :( |
Merged. Thanks for your great work! |
Ok, just deployed it on some of my node and it looks like a few things are broken 😢 |
@PirosB3 looks like error handling needs to be improved quickly, every error returns UNCATEGORIZED now. |
I'm sorry to hear this. I'll gladly fix this. Do you have some specific
spec you would like me to follow? What error messages do not want to
categorize?
Would you mind opening a ticket, assigned to me, with the above answer and
also the other bugs you found?
Thanks!
On Sat, Sep 29, 2018 at 4:52 AM François ***@***.***> wrote:
@PirosB3 <https://github.com/PirosB3> looks like error handling needs to
be improved quickly, every error returns UNCATEGORIZED now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#163 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAztS3HsqTTupnnrM0R7R5amb2JCoL5Rks5uf18FgaJpZM4W1lqg>
.
--
*************
PirosB3
https://github.com/PirosB3
|
You just need to handle the gRPC as they were handled before, so the web front-end can display the correct error message to the user instead of a generic UNCATEGORIZED one. |
Sounds great. I can work on it this weekend at some point (out of town).
Does that timeline work for you?
On Sat, Sep 29, 2018 at 7:21 AM François ***@***.***> wrote:
You just need to handle the gRPC as they were handled before, so the web
front-end can display the correct error message to the user instead of a
generic UNCATEGORIZED one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#163 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAztS2OH2KihSxrtEU0K7CUdDvgmLlIaks5uf4IGgaJpZM4W1lqg>
.
--
*************
PirosB3
https://github.com/PirosB3
|
break; | ||
default: | ||
logger.error("Unrecognized gRPC error: " + err); | ||
reject(LightningError.UNCATEGORIZED); |
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.
@PirosB3 looks like we are losing the original gRPC error here.
We need it to be able to handle it correctly on the web-client side.
Yup. I know exactly where to fix it.
On Sat, Sep 29, 2018 at 7:45 AM François ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/lightning.js
<#163 (comment)>:
>
- logger.error("Required lnd certificate path missing from application configuration.");
- process.exit(1);
+ switch(err.code) {
+ case grpc.status.UNIMPLEMENTED:
+ reject(LightningError.WALLET_LOCKED);
+ break;
+ case grpc.status.UNAVAILABLE:
+ reject(LightningError.NODE_UNREACHABLE);
+ break;
+ default:
+ logger.error("Unrecognized gRPC error: " + err);
+ reject(LightningError.UNCATEGORIZED);
@PirosB3 <https://github.com/PirosB3> looks like we are losing the
original gRPC error here.
We need it to be able to handle it correctly on the web-client side.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#163 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAztS3ZrR66MPEhS4c0IpEbPlQhaBoPYks5uf4ejgaJpZM4W1lqg>
.
--
*************
PirosB3
https://github.com/PirosB3
|
|
||
} else { | ||
// drop active client, so that it can be recreated | ||
this.activeClient = null; |
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.
@PirosB3 seems a bit excessive to me to drop the client on every gRPC error we are receiving 🤔
Ok, no pb, you can work on it next week, I already fixed the most urgent issues. |
Pushed a quick hack to allow display of API errors in the web client: #177 |
This is a stepping stone in order to tackle #162. As of today, if the
lightning
RPC service disconnects, there is no way for the client to reconnect automatically and the only solution is to restart the server. This PR tries to address that by providing a wrapper aroundlightning
that handles internal stateWhat does this PR address (in order of relevance)
lightning
intoLightningManager
classapp/routes
to use an instance ofLightningManager
, using a small adaptorLightningManager
server
andserver-le
Advice for reviewing this PR, where to start
LightningManager
, and review how the external API (.call
) is usedlightningRPCAdapter
functionapp/routes
to make sure they were refactored appropriatelymakeLightningManager
server functionApologies if I didn't respect a specific stile guide, since none was enforced in README or in the files. I'm definitely happy to refactor stile/documentation/anything to fit the projects needs. Let me know if I should be doing something differently :) I will happily adapt