Skip to content
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

Expose the RPC litrpc.Proxy.GetInfo via LNC wasm #83

Open
jamaljsr opened this issue Sep 14, 2023 · 4 comments
Open

Expose the RPC litrpc.Proxy.GetInfo via LNC wasm #83

jamaljsr opened this issue Sep 14, 2023 · 4 comments
Assignees

Comments

@jamaljsr
Copy link
Member

jamaljsr commented Sep 14, 2023

In Terminal Web, we'd like to get able to get the version of litd that the WASM is connected to. This information is available via the litrpc.Proxy.GetInfo. Unfortunately, when I attempt to call this RPC using make example-server, no response is returned. The WASM doesn't even log that the method is called in the browser console.

I have tried to fix this by adding litrpc.RegisterProxyJSONCallbacks to jsoncallbacks.go but this results in the error

rpc error: code = Unimplemented desc = unknown service /litrpc.Proxy/GetInfo

It looks like this sub-server is being blocked by litd in rpc_proxy.go. I'm not sure what code need to change to unblock just this GetInfo RPC.

@itsrachelfish
Copy link

I'm wondering if it would make more sense to include version numbers in the subserver RPC instead of exposing GetInfo?

It looks like GetInfo only returns version information for litd:

Screenshot from 2023-09-14 12-53-28

If the subserver status server returned version information for all subservers it would be a lot more useful for feature detection for loop, pool, etc. not just lit

@ellemouton
Copy link
Member

The issue is on the LiT side. Currently we dont expose Proxy calls over LNC since it would also expose things like Stop. So either we just say we are ok with the user being able to call Stop over LNC if they have an admin session in which case this is an easy fix on the LiT side. Otherwise we should consider splitting up the Proxy service a bit.

@ellemouton
Copy link
Member

If the subserver status server returned version information for all subservers it would be a lot more useful for feature detection for loop, pool, etc. not just lit

I think these are already queryable directly though? Pool, Loop and Taproot-assets all have a GetInfo call. So those can just be called directly. So the only TODO here imo is adding a GetInfo to faraday

@jamaljsr
Copy link
Member Author

Thanks for the additional context here @ellemouton. I also agree that Stop shouldn't be exposed over LNC. We'd still like to have a way to get the litd version in addition to faraday so I'd like to add that as a TODO as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants