Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions evolve/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## [`v0.4.0`](https://github.com/ignite/apps/releases/tag/evolve/v0.4.0)

- [#220](https://github.com/ignite/apps/pull/220) Rename app, flags and commands from `rollkit` to `evolve` following the rebranding of Rollkit to Evolve.
- [#223](https://github.com/ignite/apps/pull/223) Wire rollback command.

## [`v0.3.0`](https://github.com/ignite/apps/releases/tag/rollkit/v0.3.0)

Expand Down
11 changes: 7 additions & 4 deletions evolve/template/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ const (

const (
GoExecPackage = "github.com/evstack/ev-abci"
GoExecVersion = "v0.3.1-0.20250818181501-f014411689fd" // main until tag
GoExecVersion = "v0.3.1-0.20250908162746-8c3ef4776667"

EvNodePackage = "github.com/evstack/ev-node"
EvNodeVersion = "v1.0.0-beta.2.0.20250818133040-d096a24e7052" // main until tag
EvNodeVersion = "v1.0.0-beta.2.0.20250908090838-0584153217ed"

EvNodeDaCmd = "github.com/evstack/ev-node/da/cmd/local-da"
EvNodeDaVersion = "v1.0.0-beta.1"
GoDataStorePackageFork = "github.com/celestiaorg/go-datastore"
GoDataStoreVersionFork = "v0.0.0-20250801131506-48a63ae531e4"
GoDataStorePackage = "github.com/ipfs/go-datastore"

EvNodeDaCmd = "github.com/evstack/ev-node/da/cmd/local-da"
)
1 change: 1 addition & 0 deletions evolve/template/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func NewEvolveGenerator(chain *chain.Chain, withCometMigration bool) (*genny.Gen

g.RunFn(commandsStartModify(appPath, binaryName, chain.Version))
g.RunFn(commandsGenesisModify(appPath, binaryName))
g.RunFn(commandsRollbackModify(appPath, binaryName))
if withCometMigration {
g.RunFn(migrateFromCometModify(appPath))
}
Expand Down
32 changes: 32 additions & 0 deletions evolve/template/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,35 @@ func commandsGenesisModify(appPath, binaryName string) genny.RunFn {
}
}

// commandsRollbackModify modifies the application rollback command to use evolve.
func commandsRollbackModify(appPath, binaryName string) genny.RunFn {
return func(r *genny.Runner) error {
cmdPath := filepath.Join(appPath, "cmd", binaryName, "cmd/commands.go")
f, err := r.Disk.Find(cmdPath)
if err != nil {
return err
}

// use ast to modify the function that initializes genesisCmd
content, err := xast.ModifyFunction(f.String(), "initRootCmd",
xast.AppendFuncCode(`
// override rollback command
evNodeRollbackCmd := abciserver.NewRollbackCmd(newApp, app.DefaultNodeHome)
if currentRollbackCmd, _, err := rootCmd.Find([]string{evNodeRollbackCmd.Name()}); err == nil{
rootCmd.RemoveCommand(currentRollbackCmd)
}
rootCmd.AddCommand(evNodeRollbackCmd)
`,
),
)
if err != nil {
return err
}

return r.File(genny.NewFileS(cmdPath, content))
}
}

// updateDependencies makes sure the correct dependencies are added to the go.mod files.
// ev-abci expects evolve v1 to be used.
func updateDependencies(appPath string) error {
Expand All @@ -144,6 +173,9 @@ func updateDependencies(appPath string) error {
return errors.Errorf("failed to add local-da tool: %w", err)
}

// add required replaces
gomod.AddReplace(GoDataStorePackage, "", GoDataStorePackageFork, GoDataStoreVersionFork)

// save go.mod
data, err := gomod.Format()
if err != nil {
Expand Down
Loading