wrap-cli icon indicating copy to clipboard operation
wrap-cli copied to clipboard

wrapper introspection

Open krisbitney opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Let's say I'm writing a wrapper and my dependencies have dependencies. Wrapper developers should be able to do something like polywrap introspect and get information such as the URIs used for all dependencies in their schema (and the dependencies of the dependencies...). The information should indicate whether the dependencies are used as interfaces.

Let's say I'm an app developer. I should be able to do something like polywrap introspect wrap://... to do the same with any arbitrary wrap uri.

Note that we use interfaces in two different ways: inheritance and composition. Sometimes we implement an interface (e.g. the http interface and plugin), while at other times we use getImplementations to get construct an instance and invoke it.

For example, the ENS text record resolver wrapper depends on the ENS wrapper, which depends on the Ethereum wrapper, which depends on the Ethereum provider interface.

When writing the ENS text record resolver, I need to know the URI used for the Ethereum provider interface. If I don't, my wrapper will never work.

Describe the solution you'd like My initial thinking is that it should be a CLI command polywrap inspect (name TBD).

Describe alternatives you've considered A client method like client.inspect is not reasonable for wrapper developers, and it's inconvenient for app developers. The CLI command could be based on a client method, though.

We have the client.validate method, but it doesn't output the information developers need and it's not available from the CLI.

Another solution might be to include this kind of information in a wrapper's page on a wrapper registry with a custom GUI.

krisbitney avatar Feb 15 '23 05:02 krisbitney