lndk-org / lndk

MIT License
76 stars 19 forks source link

Add the option to load cert/macaroon directly into lndk #109

Closed orbitalturtle closed 2 months ago

orbitalturtle commented 2 months ago

As requested, this change adds the option to load the cert and macaroon strings directly to lndk and lndk-cli. I'll update the grpc server PR with these changes as well soon.

I wanted to get this up in case anyone has a chance for a high-level look. But I'd like to do a little more testing:

Note that for now there's a bit of a discrepancy between the lndk binary and lndk-cli. The cli currently allows the user to fall back on default paths for the credentials when none are provided, while the lndk binary doesn't. So validating in each scenario is a little different. We could avoid that by allowing the lndk binary to fall on default paths as well. But to try to just test one thing at a time, I think it'd be best to and then add that change in a future PR.

This change requires my custom branch of tonic_lnd, which allows for passing in these credentials directly. Hopefully we can push this change and the v18 proto updates upstream eventually: https://github.com/orbitalturtle/tonic_lnd/pull/3

orbitalturtle commented 2 months ago

I added some unit tests and did some integration testing. Passing in the credentials directly seems to be working pretty well to me. I'm going to merge this for now, since the grpc server PR and other future PRs depend on this functionality.