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

Standardize Module Client Interface Exports #2729

Closed
jackzampolin opened this issue Nov 7, 2018 · 2 comments
Closed

Standardize Module Client Interface Exports #2729

jackzampolin opened this issue Nov 7, 2018 · 2 comments
Labels
C:CLI S:proposal accepted T: Dev UX UX for SDK developers (i.e. how to call our code)

Comments

@jackzampolin
Copy link
Member

jackzampolin commented Nov 7, 2018

Updated per #1081

Currently modules export command line flags and LCD endpoints in an unstructured way. This leads to non standard command registration and can be confusing for users/devs. Modules offer three different interaction paths: cli-txs, cli-queries and lcd-routes.

Per #2575 we are moving each of the module's commands from being registered directly under the gaiacli query or gaiacli tx command to being registered under gaiacli query {{ .Module.Name }} and gaiacli tx {{ .Module.Name }}. Also per #1081 we are moving route registration from client/lcd to cmd/gaia/cmd/gaiacli in order to enable SDK devs to register routes from their own modules.

We should define a new interface for each module:

type ModuleCmds interface {
  GetQueryCmd() *cobra.Command
  GetTxCmd() *cobra.Command
  RegisterRoutes() *mux.Route
}

The interface will be implemented in a struct. The struct should contain all necessary pieces to build the query/tx commands and routes (codecs, storeKeys, etc...)

This would provide developers a standard way to expose their module functionality and would allow for a lot of cleanup in the cmd folder.

@alessio
Copy link
Contributor

alessio commented Nov 8, 2018

Seconded

@jackzampolin jackzampolin changed the title Standardize Module CLI Exports Standardize Module Client Interface Exports Nov 15, 2018
@jackzampolin jackzampolin added T: Dev UX UX for SDK developers (i.e. how to call our code) and removed gaia-lite labels Jan 28, 2019
@jackzampolin
Copy link
Member Author

Closing this issue as addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI S:proposal accepted T: Dev UX UX for SDK developers (i.e. how to call our code)
Projects
None yet
Development

No branches or pull requests

2 participants