Skip to content

Commit

Permalink
Merge branch 'itaylevyofficial/399-run-without-output' into itaylevyo…
Browse files Browse the repository at this point in the history
…fficial/286-endtoendtests
  • Loading branch information
ItayLevyOfficial committed Aug 16, 2023
2 parents 1642b09 + 16c1d10 commit 2d58759
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var migrationsRegistry = []VersionMigrator{
&VersionMigratorV014{},
&VersionMigratorV015{},
&VersionMigratorV016{},
&VersionMigratorV018{},
}

func Cmd() *cobra.Command {
Expand Down
18 changes: 18 additions & 0 deletions cmd/migrate/v_0_1_8.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package migrate

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

type VersionMigratorV018 struct{}

func (v *VersionMigratorV018) ShouldMigrate(prevVersion VersionData) bool {
return prevVersion.Major < 1 && prevVersion.Minor < 2 && prevVersion.Patch < 8
}

func (v *VersionMigratorV018) PerformMigration(rlpCfg config.RollappConfig) error {
dymintTomlPath := sequencer.GetDymintFilePath(rlpCfg.Home)
return utils.UpdateFieldInToml(dymintTomlPath, "empty_blocks_max_time", "60s")
}
16 changes: 14 additions & 2 deletions cmd/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ import (
"github.com/spf13/cobra"
)

var flagNames = struct {
NoOutput string
}{
NoOutput: "no-output",
}

func Cmd() *cobra.Command {
cmd := &cobra.Command{
Use: "run",
Expand Down Expand Up @@ -47,7 +53,13 @@ func Cmd() *cobra.Command {
runRelayerWithRestarts(rollappConfig, serviceConfig)

/* ------------------------------ render output ----------------------------- */
RenderUI(rollappConfig, serviceConfig)
noOutput, err := cmd.Flags().GetBool(flagNames.NoOutput)
utils.PrettifyErrorIfExists(err)
if noOutput {
select {}
} else {
RenderUI(rollappConfig, serviceConfig)
}
cancel()
spin := utils.GetLoadingSpinner()
spin.Suffix = " Stopping rollapp services, please wait..."
Expand All @@ -57,7 +69,7 @@ func Cmd() *cobra.Command {
spin.Stop()
},
}

cmd.Flags().BoolP(flagNames.NoOutput, "", false, "Run the rollapp without rendering the UI.")
return cmd
}

Expand Down

0 comments on commit 2d58759

Please sign in to comment.