Skip to content

Commit

Permalink
feat(simapp): Add snapshots commands (backport #21065) (#21185)
Browse files Browse the repository at this point in the history
Co-authored-by: Hieu Vu <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
3 people authored Aug 6, 2024
1 parent 77f1ef7 commit c21b606
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions simapp/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ require (
cosmossdk.io/log v1.3.1
cosmossdk.io/math v1.3.0
cosmossdk.io/runtime/v2 v2.0.0-20240801110532-c55e8d71014b // main
cosmossdk.io/server/v2 v2.0.0-20240802142126-a26970e547ab // main
cosmossdk.io/server/v2 v2.0.0-20240806152830-8fb47b368cd4 // main
cosmossdk.io/server/v2/cometbft v0.0.0-00010101000000-000000000000
cosmossdk.io/store/v2 v2.0.0-20240731205446-aee9803a0af6 // indirect; main
cosmossdk.io/store/v2 v2.0.0-20240806152830-8fb47b368cd4 // indirect; main
cosmossdk.io/tools/confix v0.0.0-00010101000000-000000000000
cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91
cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -93,7 +93,7 @@ require (
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.5.0 // indirect
github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 // indirect
github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/creachadair/atomicfile v0.3.4 // indirect
Expand Down Expand Up @@ -221,7 +221,7 @@ require (
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions simapp/v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ cosmossdk.io/runtime/v2 v2.0.0-20240801110532-c55e8d71014b h1:1xgRbIPLToBCoclz8I
cosmossdk.io/runtime/v2 v2.0.0-20240801110532-c55e8d71014b/go.mod h1:08wVxHFbXSjlB0JUxTxdtLihqSj8rf8k6FuF4tJUJUU=
cosmossdk.io/schema v0.1.1 h1:I0M6pgI7R10nq+/HCQfbO6BsGBZA8sQy+duR1Y3aKcA=
cosmossdk.io/schema v0.1.1/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ=
cosmossdk.io/server/v2 v2.0.0-20240802142126-a26970e547ab h1:6IGp/R/6D4NZT+MKIoM2OkmxZG4UFh32HgwN7mYynvk=
cosmossdk.io/server/v2 v2.0.0-20240802142126-a26970e547ab/go.mod h1:alRmtz2gedZe+goFHbNjkBPNTkShFW6HEeXiyT7hdHM=
cosmossdk.io/server/v2 v2.0.0-20240806152830-8fb47b368cd4 h1:nIVWYPExxgabz1A5B0DGYNgBifCXsEA5CESVzlUlVCc=
cosmossdk.io/server/v2 v2.0.0-20240806152830-8fb47b368cd4/go.mod h1:PwgccTJDuBFbRoQZ4RqWAO7bdWWPACS4PiovK8RgBfk=
cosmossdk.io/server/v2/appmanager v0.0.0-20240731205446-aee9803a0af6 h1:vrHmVjfEjEwQh90dim272gYq7OFILg4Yrv3XzreMpe4=
cosmossdk.io/server/v2/appmanager v0.0.0-20240731205446-aee9803a0af6/go.mod h1:Xm5IOSjw45Sew7fiVckaTCIU5oQPs20V+54NOqR3H4o=
cosmossdk.io/server/v2/stf v0.0.0-20240731205446-aee9803a0af6 h1:F8yfqCf1cAwuZZnIxinmzr/2nmLjhK9K/BJfBjW3nJ0=
cosmossdk.io/server/v2/stf v0.0.0-20240731205446-aee9803a0af6/go.mod h1:IUbZp79IZ4NCR2eNXA0utcQOS8lz34BvsAWTeCGwGAM=
cosmossdk.io/store v1.0.0-rc.0.0.20240731205446-aee9803a0af6 h1:lhyOHcIJU+IB6i5sO36DWC2r4QXDEk/bsno7jrTr28k=
cosmossdk.io/store v1.0.0-rc.0.0.20240731205446-aee9803a0af6/go.mod h1:CY8wAToETz/dmuuKwf/qfXEImtey4jWdWWcoavfQWNw=
cosmossdk.io/store/v2 v2.0.0-20240731205446-aee9803a0af6 h1:/ffIfMKzoCVUI38t5Vq3BNW9U8exRMxK5QgS/ujn0lA=
cosmossdk.io/store/v2 v2.0.0-20240731205446-aee9803a0af6/go.mod h1:aG3brMLcldPsdhfkdCaisGDIe+tXTNWdUDt5JYsRDl8=
cosmossdk.io/store/v2 v2.0.0-20240806152830-8fb47b368cd4 h1:DEMdx+6DoGVcvrhE94eaSvZIma7aXgPWDEhPJ7PgfrI=
cosmossdk.io/store/v2 v2.0.0-20240806152830-8fb47b368cd4/go.mod h1:iKP7MlnL6iXszrsErFv9PMTVvut8BNuMa60z6fzaLZg=
cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 h1:GuBrfHsK3RD5vlD4DuBz3DXslR6VlnzrYmHOC3L679Q=
cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337/go.mod h1:PhLn1pMBilyRC4GfRkoYhm+XVAYhF4adVrzut8AdpJI=
cosmossdk.io/x/tx v0.13.4-0.20240802064046-23fac2f1b8ab h1:8NdM5U/ga6R+CkoDoSFTbBaRkKREUay4oG8dc6+Dcjw=
Expand Down Expand Up @@ -349,8 +349,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o=
github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I=
github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE=
github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw=
github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e h1:5bxw1E0peLMrr8ZO9mYT0d9sxy0WgR1ZEWb92yjKnnk=
github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
Expand Down Expand Up @@ -1029,8 +1029,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
4 changes: 1 addition & 3 deletions simapp/v2/simdv2/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ func initRootCmd[T transaction.Tx](
debug.Cmd(),
confixcmd.ConfigCommand(),
NewTestnetCmd(moduleManager),
// pruning.Cmd(newApp), // TODO add to comet server
// snapshot.Cmd(newApp), // TODO add to comet server
)

logger, err := serverv2.NewLogger(viper.New(), rootCmd.OutOrStdout())
Expand All @@ -77,7 +75,7 @@ func initRootCmd[T transaction.Tx](
logger,
cometbft.New(&genericTxDecoder[T]{txConfig}, cometbft.DefaultServerOptions[T]()),
grpc.New[T](),
store.New[T](),
store.New[T](newApp),
); err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions simapp/v2/simdv2/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ func initTestnetFiles[T transaction.Tx](
cometbft.ServerOptions[T]{},
cometbft.OverwriteDefaultConfigTomlConfig(nodeConfig),
)
storeServer := store.New[T](newApp)
grpcServer := grpc.New[T](grpc.OverwriteDefaultConfig(grpcConfig))
storeServer := store.New[T]()
server := serverv2.NewServer(log.NewNopLogger(), cometServer, grpcServer, storeServer)
err = server.WriteConfig(filepath.Join(nodeDir, "config"))
if err != nil {
Expand All @@ -366,7 +366,7 @@ func initTestnetFiles[T transaction.Tx](
}

// Update viper root since root dir become rootdir/node/simd
client.GetViperFromCmd(cmd).Set(flags.FlagHome, nodeConfig.RootDir)
serverv2.GetViperFromCmd(cmd).Set(flags.FlagHome, nodeConfig.RootDir)

cmd.PrintErrf("Successfully initialized %d node directories\n", args.numValidators)
return nil
Expand Down

0 comments on commit c21b606

Please sign in to comment.