-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
roller config set hub-rpc
(#532)
- Loading branch information
1 parent
76429b8
commit 1ace736
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters