Skip to content

Commit

Permalink
seal the config
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Sep 11, 2024
1 parent 5c1942a commit 7ad8e19
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/minitiad/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
Use: basename,
Short: "minitia App",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// except for launch command, seal the config
if cmd.Name() != "launch" {
sdk.GetConfig().Seal()
}

// set the default command outputs
cmd.SetOut(cmd.OutOrStdout())
cmd.SetErr(cmd.ErrOrStderr())
Expand Down Expand Up @@ -165,8 +170,6 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig, b
server.AddCommandsWithStartCmdOptions(rootCmd, minitiaapp.DefaultNodeHome, a.AppCreator(), a.appExport, server.StartCmdOptions{
AddFlags: addModuleInitFlags,
PostSetup: func(svrCtx *server.Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error {
sdk.GetConfig().Seal()

// start jsonrpc server
if err := jsonrpc.StartJSONRPC(
ctx, g, a.App().(*minitiaapp.MinitiaApp),
Expand Down

0 comments on commit 7ad8e19

Please sign in to comment.