-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
server/v2 start commands and helpers #19720
Comments
One challenge with this work is maintaining compatibility in command handlers when a server command context is created in server v2 vs v1. See usages of server.GetServerContextFromCmd (30 usages in the SDK). This fn expects server v1
All this work is done in server v1 in preparation for implementing server v2 command handler which will use the same context keys. Once completed the v2 command handlers should be pretty simple. |
|
Yes, this is what I was trying to convey last meeting. Just viper + logger should be sufficient. We only need to have context keys in core (for logger and viper). |
Currently, the SDK provides helpers functions for applications to use for starting the app and cometbft:
cosmos-sdk/server/util.go
Line 327 in defab1a
That function is then used by the app developer, who does not need to care about wiring a start command.
cosmos-sdk/simapp/simd/cmd/commands.go
Line 54 in b304cf7
We should provide a start command for the comet server (equivalent of https://github.com/cosmos/cosmos-sdk/blob/defab1a1a1520cd6dd0d80768d345560d7c99663/server/start.go) and add a helper in server/v2 to combine all server commands (equivalent
server.AddCommands
).Additionally, the SDK provides another helper for config management:
cosmos-sdk/server/util.go
Line 102 in defab1a
server.InterceptConfigsPreRunHandler
). This helper should create the config when it doesn't exist and provide a viper with all the config values.The text was updated successfully, but these errors were encountered: