Skip to content

Commit b933f38

Browse files
authored
refactor(evolve): split command and update docs (#237)
* refactor(evolve): split command and update docs * add missing * cl + test * always add staking * cmds * merge in one generator * fixes * use latest * updates * bumps
1 parent 0b2e0cf commit b933f38

File tree

13 files changed

+308
-193
lines changed

13 files changed

+308
-193
lines changed

evolve/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
## [`v0.5.0`](https://github.com/ignite/apps/releases/tag/evolve/v0.5.0)
6+
7+
- [#237](https://github.com/ignite/apps/pull/237) Remove `--start` and `--migrate` flags from `evolve add` command. Split into `evolve add` and `evolve add-migrate` commands.
8+
- [#237](https://github.com/ignite/apps/pull/237) Bump dependencies.
59
- [#236](https://github.com/ignite/apps/pull/236) Add `--start` flag to `evolve add` command to optionally disable addition of the start command.
610

711
## [`v0.4.3`](https://github.com/ignite/apps/releases/tag/evolve/v0.4.3)

evolve/README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This Ignite App is aimed to extend [Ignite CLI](https://github.com/ignite/cli) a
44

55
## Prerequisites
66

7-
* Ignite CLI version v28.9.0 or greater.
8-
* Knowledge of blockchain development (Cosmos SDK).
7+
- Ignite CLI version v28.9.0 or greater.
8+
- Knowledge of blockchain development (Cosmos SDK).
99

1010
## Usage
1111

@@ -15,7 +15,7 @@ cd gm
1515
ignite app install -g github.com/ignite/apps/evolve@latest
1616
ignite evolve add
1717
ignite chain build --skip-proto
18-
ignite evolve init
18+
ignite evolve init # only for genesis chains. Otherwise follow the migration steps.
1919
```
2020

2121
Then start `local-da` or use Celestia mainnet as data availability layer.
@@ -31,7 +31,25 @@ Finally, run the network:
3131
gmd start --rollkit.node.aggregator
3232
```
3333

34+
### Migrations
35+
36+
If you want to migrate your running chain to Evolve, first scaffold the migrations commands on your CometBFT chain:
37+
38+
```sh
39+
ignite evolve add-migrate
40+
```
41+
42+
This will add the migration module to your chain. Then add manually a chain migration in the upgrade handler to add this new module and submit a gov proposal to initiate the validator set migration.
43+
44+
Once the chain has halted, run the migration command on each node:
45+
46+
```sh
47+
gmd evolve-migrate
48+
```
49+
50+
You are ready to integrate Evolve! Follow the [1](#Usage) steps to add it to your chain.
51+
3452
Learn more about Evolve and Ignite in their respective documentation:
3553

36-
* <https://docs.ignite.com>
37-
* <https://rollkit.dev/>
54+
- <https://docs.ignite.com>
55+
- <https://ev.xyz/>

evolve/cmd/add.go

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"context"
5-
"errors"
65
"path/filepath"
76

87
"github.com/ignite/cli/v29/ignite/pkg/cliui"
@@ -17,9 +16,7 @@ import (
1716
const (
1817
statusScaffolding = "Scaffolding..."
1918

20-
flagPath = "path"
21-
flagStart = "start"
22-
flagMigrate = "migrate"
19+
flagPath = "path"
2320
)
2421

2522
func AddHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
@@ -33,16 +30,6 @@ func AddHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
3330
return err
3431
}
3532

36-
withStartCmd, err := flags.GetBool(flagStart)
37-
if err != nil {
38-
return err
39-
}
40-
41-
migrateCometBFT, err := flags.GetBool(flagMigrate)
42-
if err != nil {
43-
return err
44-
}
45-
4633
absPath, err := filepath.Abs(appPath)
4734
if err != nil {
4835
return err
@@ -53,12 +40,9 @@ func AddHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
5340
return err
5441
}
5542

56-
binaryName, err := c.Binary()
57-
if err != nil {
58-
return err
59-
}
60-
61-
g, err := template.NewEvolveGenerator(c, migrateCometBFT, withStartCmd)
43+
g, err := template.NewEvolveGenerator(c, template.GeneratorOptions{
44+
WithStart: true,
45+
})
6246
if err != nil {
6347
return err
6448
}
@@ -72,16 +56,7 @@ func AddHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
7256
return err
7357
}
7458

75-
err = session.Printf("🎉 Evolve (ev-abci) added (`%[1]v`).\n", c.AppPath(), c.Name())
76-
77-
if migrateCometBFT {
78-
err = errors.Join(session.Printf("\n"))
79-
err = errors.Join(err, session.Println("Additionally, evolve migration commands and modules successfully scaffolded!"))
80-
err = errors.Join(err, session.Printf("If %s is already live, check out the newly added evolve manager to prepare the chain for migration\n", c.Name()))
81-
err = errors.Join(err, session.Printf("Run `%s evolve-migrate` to migrate CometBFT state to the evolve state.\n", binaryName))
82-
}
83-
84-
return err
59+
return session.Printf("🎉 Evolve (ev-abci) added (`%[1]v`).\n", c.AppPath())
8560
}
8661

8762
// finish finalize the scaffolded code (formating, dependencies).

evolve/cmd/cmd.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,24 @@ func GetCommands() []*plugin.Command {
2323
Shorthand: "p",
2424
Type: plugin.FlagTypeString,
2525
},
26+
},
27+
},
28+
{
29+
Use: "add-migrate",
30+
Short: "Add evolve migration support",
31+
Long: "Add evolve migration helpers and modules for migrating from CometBFT",
32+
Flags: []*plugin.Flag{
2633
{
27-
Name: flagStart,
28-
Usage: "modify start command to use ev-abci (set to false to only add migrate command)",
29-
Type: plugin.FlagTypeBool,
30-
DefaultValue: "true",
31-
},
32-
{
33-
Name: flagMigrate,
34-
Usage: "scaffolds the migrations helpers and modules (to use when migrating from CometBFT)",
35-
Type: plugin.FlagTypeBool,
34+
Name: flagPath,
35+
Usage: "path of the app",
36+
Shorthand: "p",
37+
Type: plugin.FlagTypeString,
3638
},
3739
},
3840
},
3941
{
4042
Use: "init",
41-
Short: "Init ev-abci support",
43+
Short: "Init evolve support",
4244
Long: "Initialize the chain and a ev-node sequencer via ev-abci.",
4345
Flags: []*plugin.Flag{
4446
{

evolve/cmd/migrate.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package cmd
2+
3+
import (
4+
"context"
5+
"errors"
6+
"path/filepath"
7+
8+
"github.com/ignite/cli/v29/ignite/pkg/cliui"
9+
"github.com/ignite/cli/v29/ignite/pkg/xgenny"
10+
"github.com/ignite/cli/v29/ignite/services/chain"
11+
"github.com/ignite/cli/v29/ignite/services/plugin"
12+
13+
"github.com/ignite/apps/evolve/template"
14+
)
15+
16+
func MigrateHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
17+
flags := plugin.Flags(cmd.Flags)
18+
19+
session := cliui.New(cliui.StartSpinnerWithText(statusScaffolding))
20+
defer session.End()
21+
22+
appPath, err := flags.GetString(flagPath)
23+
if err != nil {
24+
return err
25+
}
26+
27+
absPath, err := filepath.Abs(appPath)
28+
if err != nil {
29+
return err
30+
}
31+
32+
c, err := chain.New(absPath, chain.CollectEvents(session.EventBus()))
33+
if err != nil {
34+
return err
35+
}
36+
37+
binaryName, err := c.Binary()
38+
if err != nil {
39+
return err
40+
}
41+
42+
g, err := template.NewEvolveGenerator(c, template.GeneratorOptions{
43+
WithMigration: true,
44+
})
45+
if err != nil {
46+
return err
47+
}
48+
49+
_, err = xgenny.NewRunner(ctx, appPath).RunAndApply(g)
50+
if err != nil {
51+
return err
52+
}
53+
54+
if finish(ctx, session, c.AppPath()) != nil {
55+
return err
56+
}
57+
58+
err = session.Printf("🎉 Evolve migration support added (`%[1]v`).\n", c.AppPath())
59+
err = errors.Join(err, session.Println("Evolve migration command and module successfully scaffolded!"))
60+
err = errors.Join(err, session.Println("Check out the newly added evolve manager to prepare the chain for migration."))
61+
err = errors.Join(err, session.Printf("Once the app state is migrated, run `%s evolve-migrate` to migrate CometBFT state to the Evolve state.\n", binaryName))
62+
63+
return err
64+
}

evolve/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ go 1.24.1
55
require (
66
cosmossdk.io/math v1.5.3
77
github.com/cometbft/cometbft v0.38.17
8-
github.com/cosmos/cosmos-sdk v0.53.3
8+
github.com/cosmos/cosmos-sdk v0.53.4
99
github.com/evstack/ev-node v1.0.0-beta.2.0.20250908090838-0584153217ed
1010
github.com/gobuffalo/genny/v2 v2.1.0
1111
github.com/gobuffalo/plush/v4 v4.1.22
1212
github.com/hashicorp/go-plugin v1.6.3
13-
github.com/ignite/cli/v29 v29.4.0
13+
github.com/ignite/cli/v29 v29.6.0
1414
github.com/spf13/viper v1.20.1
1515
github.com/stretchr/testify v1.10.0
1616
)
@@ -210,7 +210,7 @@ require (
210210
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect
211211
github.com/spaolacci/murmur3 v1.1.0 // indirect
212212
github.com/spf13/afero v1.12.0 // indirect
213-
github.com/spf13/cast v1.8.0 // indirect
213+
github.com/spf13/cast v1.9.2 // indirect
214214
github.com/spf13/cobra v1.9.1 // indirect
215215
github.com/spf13/pflag v1.0.7 // indirect
216216
github.com/subosito/gotenv v1.6.0 // indirect
@@ -227,6 +227,7 @@ require (
227227
go.mongodb.org/mongo-driver v1.14.0 // indirect
228228
go.opencensus.io v0.24.0 // indirect
229229
go.uber.org/multierr v1.11.0 // indirect
230+
go.yaml.in/yaml/v2 v2.4.2 // indirect
230231
golang.org/x/arch v0.17.0 // indirect
231232
golang.org/x/crypto v0.41.0 // indirect
232233
golang.org/x/exp v0.0.0-20250811191247-51f88131bc50 // indirect
@@ -248,5 +249,5 @@ require (
248249
lukechampine.com/blake3 v1.4.1 // indirect
249250
nhooyr.io/websocket v1.8.6 // indirect
250251
pgregory.net/rapid v1.2.0 // indirect
251-
sigs.k8s.io/yaml v1.4.0 // indirect
252+
sigs.k8s.io/yaml v1.6.0 // indirect
252253
)

evolve/go.sum

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNC
172172
github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw=
173173
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
174174
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
175-
github.com/cosmos/cosmos-sdk v0.53.3 h1:GbDJNUP9OD0gGDVnjecZVZr0ZReD1BtIIxmtgrAsWiw=
176-
github.com/cosmos/cosmos-sdk v0.53.3/go.mod h1:90S054hIbadFB1MlXVZVC5w0QbKfd1P4b79zT+vvJxw=
175+
github.com/cosmos/cosmos-sdk v0.53.4 h1:kPF6vY68+/xi1/VebSZGpoxQqA52qkhUzqkrgeBn3Mg=
176+
github.com/cosmos/cosmos-sdk v0.53.4/go.mod h1:7U3+WHZtI44dEOnU46+lDzBb2tFh1QlMvi8Z5JugopI=
177177
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
178178
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
179179
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
@@ -422,7 +422,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
422422
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
423423
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
424424
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
425-
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
426425
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
427426
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
428427
github.com/google/go-github/v48 v48.2.0 h1:68puzySE6WqUY9KWmpOsDEQfDZsso98rT6pZcz9HqcE=
@@ -514,8 +513,8 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK
514513
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
515514
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
516515
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
517-
github.com/ignite/cli/v29 v29.4.0 h1:6ieiEknAXRDUfaAkdGxErPnlS3xRcQE9QxhnrYNvHqk=
518-
github.com/ignite/cli/v29 v29.4.0/go.mod h1:dICC6a96N8eYxqwgar3buBduNlA4e+AVs4vH6IJltL8=
516+
github.com/ignite/cli/v29 v29.6.0 h1:+HaYMD1unqfIo4NbHzwVCnwf9ovYCsPVlo+hS2XLolQ=
517+
github.com/ignite/cli/v29 v29.6.0/go.mod h1:YCMxU6oBvOgb+SehwksJknNwOEj5wN7CFm7V10RU9/M=
519518
github.com/ignite/web v1.0.8 h1:St3L6UJj70+h16+No5em8Vn2Hx93tS2G1MyWO/Kt1cc=
520519
github.com/ignite/web v1.0.8/go.mod h1:WZWBaBYF8RazN7dE462BLpvXDY8ScacxcJ07BKwX/jY=
521520
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
@@ -839,8 +838,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b
839838
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
840839
github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs=
841840
github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4=
842-
github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk=
843-
github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
841+
github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
842+
github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
844843
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
845844
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
846845
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
@@ -945,6 +944,10 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E
945944
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
946945
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
947946
go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
947+
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
948+
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
949+
go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE=
950+
go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
948951
golang.org/x/arch v0.17.0 h1:4O3dfLzd+lQewptAHqjewQZQDyEdejz3VwgeYwkZneU=
949952
golang.org/x/arch v0.17.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
950953
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -1236,6 +1239,6 @@ nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYm
12361239
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
12371240
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
12381241
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
1239-
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
1240-
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
1242+
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
1243+
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
12411244
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=

evolve/integration/app_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ func TestEvolve(t *testing.T) {
4949
)),
5050
))
5151

52+
env.Must(env.Exec("run evolve add-migrate",
53+
step.NewSteps(step.New(
54+
step.Exec(
55+
envtest.IgniteApp,
56+
"evolve",
57+
"add-migrate",
58+
),
59+
step.Workdir(app.SourcePath()),
60+
)),
61+
))
62+
5263
buf := &bytes.Buffer{}
5364
bin := path.Join(goenv.Bin(), app.Binary())
5465
env.Must(env.Exec("check evolved", step.NewSteps(

evolve/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ func (app) Execute(ctx context.Context, c *plugin.ExecutedCommand, _ plugin.Clie
3232
switch args[0] {
3333
case "add":
3434
return cmd.AddHandler(ctx, c)
35+
case "add-migrate":
36+
return cmd.MigrateHandler(ctx, c)
3537
case "init":
3638
return cmd.InitHandler(ctx, c)
3739
case "edit-genesis":

evolve/template/constants.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const (
1010

1111
const (
1212
EvABCIPackage = "github.com/evstack/ev-abci"
13-
EvABCIVersion = "v1.0.0-beta.2"
13+
EvABCIVersion = "v1.0.0-beta.3"
1414

1515
EvNodePackage = "github.com/evstack/ev-node"
16-
EvNodeVersion = "v1.0.0-beta.5"
16+
EvNodeVersion = "v1.0.0-beta.7"
1717

1818
GoHeaderPackageFork = "github.com/julienrbrt/go-header"
1919
GoHeaderVersionFork = "v0.0.0-20250909151551-cb11b091bf58"

0 commit comments

Comments
 (0)