add support for lnrpc subservices - #31
Open
johncantrell97 wants to merge 1 commit into
Open
Conversation
Owner
|
Hey John, thanks for adding support for all these new services! There's obviously been some big API changes since I last played with LND, so I appreciate you doing all the leg work bringing this project back up to speed. I like how you've implemented tree shaking on all the new services, which might otherwise be overkill for the average lnrpc user. Great design decision here 👍 . Here's what I'm thinking needs to be addressed to merge:
Anything I missed? Would love your feedback. Btw I'll commit to this PR soon, so if you've got to move on, you've done more than enough already! However I'll be sure your work gets published. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for all of the rpc subservices that lnd exposes. The original implementation of lnrpc was loading only the services found in rpc.proto (lightning, walletUnlocker).
I ended up refactoring a lot of how lnrpc.js works by allowing a user pass which services they want to load (defaults to [lightning, walletUnlocker) so it won't break existing users.
I also bumped the version number and the version of grpc being used.
This works fine for the project I needed subservices for (router, signer) but probably needs to be cleaned up further to be merged into master.
The old code exposed all of the lightning and walletUnlocker methods on the root lnrpc object. This presents a problem because some of the subservices share the same method names as those found in the lightning service. For now I did not change how this works so if you want to use a subservice you are required to use it directly (e.g. lnrpc.signer.verifyMessage({})) whereas if you used lnrpc.verifyMessage it would default to the method exposed by the lightning service.