Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Aug 17, 2022
1 parent ce77eb0 commit 5782188
Show file tree
Hide file tree
Showing 4 changed files with 240 additions and 205 deletions.
23 changes: 18 additions & 5 deletions cmd/control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ func newAddNodeCommand() *cobra.Command {
&chainConfigs,
"chain-configs",
"",
"[optional] JSON string of map that maps from chain id to its config file contents",
"[optional] JSON string of map from chain id to its config file contents",
)
cmd.PersistentFlags().StringVar(
&upgradeConfigs,
"upgrade-configs",
"",
"[optional] JSON string of map that maps from chain id to its upgrade file contents",
"[optional] JSON string of map from chain id to its upgrade file contents",
)
return cmd
}
Expand Down Expand Up @@ -589,13 +589,13 @@ func newRestartNodeCommand() *cobra.Command {
&chainConfigs,
"chain-configs",
"",
"[optional] JSON string of map that maps from chain id to its config file contents",
"[optional] JSON string of map from chain id to its config file contents",
)
cmd.PersistentFlags().StringVar(
&upgradeConfigs,
"upgrade-configs",
"",
"[optional] JSON string of map that maps from chain id to its upgrade file contents",
"[optional] JSON string of map from chain id to its upgrade file contents",
)
return cmd
}
Expand Down Expand Up @@ -821,7 +821,13 @@ func newLoadSnapshotCommand() *cobra.Command {
&chainConfigs,
"chain-configs",
"",
"[optional] JSON string of map that maps from chain id to its config file contents",
"[optional] JSON string of map from chain id to its config file contents",
)
cmd.PersistentFlags().StringVar(
&upgradeConfigs,
"upgrade-configs",
"",
"[optional] JSON string of map from chain id to its upgrade file contents",
)
cmd.PersistentFlags().StringVar(
&globalNodeConfig,
Expand Down Expand Up @@ -852,6 +858,13 @@ func loadSnapshotFunc(cmd *cobra.Command, args []string) error {
}
opts = append(opts, client.WithChainConfigs(chainConfigsMap))
}
if upgradeConfigs != "" {
upgradeConfigsMap := make(map[string]string)
if err := json.Unmarshal([]byte(upgradeConfigs), &upgradeConfigsMap); err != nil {
return err
}
opts = append(opts, client.WithUpgradeConfigs(upgradeConfigsMap))
}

if globalNodeConfig != "" {
ux.Print(log, logging.Yellow.Wrap("global node config provided, will be applied to all nodes: %s"), globalNodeConfig)
Expand Down
Loading

0 comments on commit 5782188

Please sign in to comment.