Skip to content

Commit

Permalink
fix: cleanup unnecessary wallets, improve command output (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs committed Aug 22, 2024
1 parent 9617189 commit e9852f2
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 26 deletions.
17 changes: 9 additions & 8 deletions cmd/config/init/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func getDefaultGenesisParams(
{"app_state.bank.denom_metadata", getBankDenomMetadata(raCfg.BaseDenom, raCfg.Decimals)},

{"app_state.sequencers.genesis_operator_address", genesisOperatorAddress},
{
"app_state.hubgenesis.params.genesis_triggerer_allowlist.0",
map[string]string{"address": sequencerAddr},
},
// {
// "app_state.hubgenesis.params.genesis_triggerer_allowlist.0",
// map[string]string{"address": sequencerAddr},
// },
{"app_state.denommetadata.params.allowed_addresses.0", sequencerAddr},
}
}
Expand Down Expand Up @@ -79,10 +79,11 @@ func UpdateGenesisParams(home string, raCfg *config.RollappConfig) error {
return err
}
params := getDefaultGenesisParams(sa, oa, raCfg)

// TODO: move to generalized helper
amount := fmt.Sprintf("%s%s", consts.DefaultTokenSupply, raCfg.BaseDenom)
addGenAccountCmd := GetAddGenesisAccountCmd(consts.KeysIds.RollappSequencer, amount, raCfg)
addGenAccountCmd := GetAddGenesisAccountCmd(
consts.KeysIds.RollappSequencer,
consts.DefaultTokenSupply,
raCfg,
)

_, err = bash.ExecCommandWithStdout(addGenAccountCmd)
if err != nil {
Expand Down
20 changes: 7 additions & 13 deletions cmd/config/init/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,13 @@ func getSequencerKeysConfig(rollappConfig config.RollappConfig) []utils.KeyConfi
// Eventhough the hub can get evm signatures, we still use the native
Type: consts.SDK_ROLLAPP,
},
{
Dir: consts.ConfigDirName.HubKeys,
ID: consts.KeysIds.HubGenesis,
ChainBinary: consts.Executables.Dymension,
// Eventhough the hub can get evm signatures, we still use the native
Type: consts.SDK_ROLLAPP,
},
{
Dir: consts.ConfigDirName.Rollapp,
ID: consts.KeysIds.RollappSequencer,
ChainBinary: rollappConfig.RollappBinary,
Type: rollappConfig.VMType,
},
// {
// Dir: consts.ConfigDirName.HubKeys,
// ID: consts.KeysIds.HubGenesis,
// ChainBinary: consts.Executables.Dymension,
// // Eventhough the hub can get evm signatures, we still use the native
// Type: consts.SDK_ROLLAPP,
// },
}
}

Expand Down
10 changes: 10 additions & 0 deletions cmd/eibc/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ func initCmd() *cobra.Command {
}

pterm.Info.Println("eibc config updated successfully")
pterm.Info.Printf("eibc client initialized successfully at %s\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf(eibcHome),
)
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to start the eibc client in interactive mode\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller eibc start"),
)
},
}
return cmd
Expand Down
10 changes: 6 additions & 4 deletions cmd/rollapp/init/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,12 @@ func runInit(cmd *cobra.Command, env string, raID string) error {
// }

// adds the sequencer address to the whitelists
err = initconfig.UpdateGenesisParams(home, &initConfig)
if err != nil {
pterm.Error.Println("failed to update genesis")
return err
if env == "mock" {
err = initconfig.UpdateGenesisParams(home, &initConfig)
if err != nil {
pterm.Error.Println("failed to update genesis")
return err
}
}

/* ------------------------------ Create Init Files ---------------------------- */
Expand Down
2 changes: 2 additions & 0 deletions cmd/rollapp/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Consider using 'services' if you want to run a 'systemd' service instead.
func printOutput(rlpCfg config.RollappConfig, cmd *exec.Cmd) {
seq := sequencer.GetInstance(rlpCfg)
fmt.Println("πŸ’ˆ The Rollapp sequencer is running on your local machine!")
fmt.Printf("πŸ’ˆ RollApp ID: %s\n", pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf(rlpCfg.RollappID))
fmt.Println("πŸ’ˆ Endpoints:")

fmt.Printf("πŸ’ˆ EVM RPC: http://0.0.0.0:%v\n", seq.JsonRPCPort)
Expand Down
2 changes: 1 addition & 1 deletion utils/config/tomlconfig/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func LoadRollappMetadataFromChain(
if hd.ID == "mock" {
cfg = config.RollappConfig{
Home: home,
RollappID: "mock_1000-1",
RollappID: raID,
GenesisHash: "",
GenesisUrl: "",
RollappBinary: consts.Executables.RollappEVM,
Expand Down

0 comments on commit e9852f2

Please sign in to comment.