Skip to content

Commit

Permalink
feat: Add roller config set hub-rpc (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayLevyOfficial authored Sep 12, 2023
1 parent 76429b8 commit 1ace736
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmd/config/set/hub_rpc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package set

import (
"github.com/dymensionxyz/roller/config"
"github.com/dymensionxyz/roller/relayer"
"github.com/dymensionxyz/roller/sequencer"
"github.com/dymensionxyz/roller/utils"
)

func setHubRPC(rlpCfg config.RollappConfig, value string) error {
rlpCfg.HubData.RPC_URL = value
if err := config.WriteConfigToTOML(rlpCfg); err != nil {
return err
}
if err := relayer.UpdateRlyConfigValue(rlpCfg, []string{"chains", rlpCfg.HubData.ID, "value", "rpc-addr"},
value); err != nil {
return err
}
dymintTomlPath := sequencer.GetDymintFilePath(rlpCfg.Home)
return utils.UpdateFieldInToml(dymintTomlPath, "node_address", value)
}
1 change: 1 addition & 0 deletions cmd/config/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var keyUpdateFuncs = map[string]func(cfg config.RollappConfig, value string) err
"rollapp-ws-port": setWSPort,
"rollapp-grpc-port": setGRPCPort,
"da": setDA,
"hub-rpc": setHubRPC,
}

func Cmd() *cobra.Command {
Expand Down

0 comments on commit 1ace736

Please sign in to comment.