diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 04ff396c4f84..0298fdf9a837 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -6,7 +6,7 @@ replace ( // pseudo version lower than the latest tag cosmossdk.io/api => cosmossdk.io/api v0.7.3-0.20240924065902-eb7653cfecdf // main // pseudo version lower than the latest tag - cosmossdk.io/store => cosmossdk.io/store v1.0.0-rc.0.0.20241108140525-43e28b43ad7a // main + cosmossdk.io/store => cosmossdk.io/store v1.0.0-rc.0.0.20241202115147-f350775d0ed2 // main cosmossdk.io/x/bank => ../../../x/bank cosmossdk.io/x/consensus => ../../../x/consensus cosmossdk.io/x/staking => ../../../x/staking @@ -20,10 +20,10 @@ require ( cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 cosmossdk.io/log v1.5.0 cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b //main - cosmossdk.io/server/v2 v2.0.0-20241129190247-24d456db40a8 // main + cosmossdk.io/server/v2 v2.0.0-20241202115147-f350775d0ed2 // main cosmossdk.io/server/v2/appmanager v0.0.0-20241119134933-d697a3de0f95 // main cosmossdk.io/server/v2/stf v0.0.0-20241119134933-d697a3de0f95 // main - cosmossdk.io/store/v2 v2.0.0-20241129190247-24d456db40a8 // main + cosmossdk.io/store/v2 v2.0.0-20241202115147-f350775d0ed2 // main cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 github.com/cometbft/cometbft v1.0.0-rc2.0.20241127125717-4ce33b646ac9 github.com/cometbft/cometbft/api v1.0.0-rc2 diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 3bdd012d6e86..76a27890d6ba 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -24,16 +24,16 @@ cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b h1:svpFdulZRrYz+RTHu2u9CeKkMKrIHx5354vjiHerovo= cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/server/v2 v2.0.0-20241129190247-24d456db40a8 h1:FkHyUGwkMdohzNls+7qmg7nPjOLidMDOP6X0N21kD5g= -cosmossdk.io/server/v2 v2.0.0-20241129190247-24d456db40a8/go.mod h1:NT1O+DPv2bWxqX8QTtvBbjXpeXFw5doT2hoRRNr8ob4= +cosmossdk.io/server/v2 v2.0.0-20241202115147-f350775d0ed2 h1:PBV8S+nGjXNEW/sGUgYYwsyI315I4LtXQTrKk5g8G2A= +cosmossdk.io/server/v2 v2.0.0-20241202115147-f350775d0ed2/go.mod h1:NT1O+DPv2bWxqX8QTtvBbjXpeXFw5doT2hoRRNr8ob4= cosmossdk.io/server/v2/appmanager v0.0.0-20241119134933-d697a3de0f95 h1:GOznErJieaI0OS0LDUsu5Vy3qPnCyjdvkncejP0Zv5s= cosmossdk.io/server/v2/appmanager v0.0.0-20241119134933-d697a3de0f95/go.mod h1:elhlrldWtm+9U4PxE0G3wjz83yQwVVGVAOncXJPY1Xc= cosmossdk.io/server/v2/stf v0.0.0-20241119134933-d697a3de0f95 h1:cK7wvmlA18AvLcaInseKTBmt5EXtLwafe7oH1rx7veU= cosmossdk.io/server/v2/stf v0.0.0-20241119134933-d697a3de0f95/go.mod h1:4e9SzLyeGptQ3tSR6nKCNwCu7Ye4uUS2WIJih29dG2c= -cosmossdk.io/store v1.0.0-rc.0.0.20241108140525-43e28b43ad7a h1:5ENKFUhhJPkpx6dGDmc0/LXinjE3oIQDEES9gVVA4xM= -cosmossdk.io/store v1.0.0-rc.0.0.20241108140525-43e28b43ad7a/go.mod h1:pjNPBX9giCOI18kf3mgNtn4J3SFaZbV1mAmM58iHdgg= -cosmossdk.io/store/v2 v2.0.0-20241129190247-24d456db40a8 h1:LvlYyjMBF6+CV3lOCnkZqNk0+LkVehDnTPHh+JLO7Mg= -cosmossdk.io/store/v2 v2.0.0-20241129190247-24d456db40a8/go.mod h1:1DbksNgjyQ1XxlCYqkU82WqBGWcxmgciO5dBf6dRhKM= +cosmossdk.io/store v1.0.0-rc.0.0.20241202115147-f350775d0ed2 h1:UCe04NMBR+1M5JRpZJvM+I0EZzD3zXrk9YOm2RZdKDg= +cosmossdk.io/store v1.0.0-rc.0.0.20241202115147-f350775d0ed2/go.mod h1:oZBBY4BrkYnghr6MFL0MP5mGqpkPedHcWkXwXddd6tU= +cosmossdk.io/store/v2 v2.0.0-20241202115147-f350775d0ed2 h1:SmP9frnyUuBXW6rqNfPXDGaLfgN9INaHzBMZZW8ZraU= +cosmossdk.io/store/v2 v2.0.0-20241202115147-f350775d0ed2/go.mod h1:1DbksNgjyQ1XxlCYqkU82WqBGWcxmgciO5dBf6dRhKM= cosmossdk.io/x/tx v1.0.0-alpha.2 h1:UW80FMm7B0fiAMsrfe5+HabSJ3XBg+tQa6/GK9prqWk= cosmossdk.io/x/tx v1.0.0-alpha.2/go.mod h1:r4yTKSJ7ZCCR95YbBfY3nfvbgNw6m9F6f25efWYYQWo= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index da70c1ca5456..68c5655414cd 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -11,9 +11,9 @@ require ( cosmossdk.io/log v1.5.0 cosmossdk.io/math v1.4.0 cosmossdk.io/runtime/v2 v2.0.0-20241119134933-d697a3de0f95 // main - cosmossdk.io/server/v2 v2.0.0-20241129190247-24d456db40a8 // main + cosmossdk.io/server/v2 v2.0.0-20241202115147-f350775d0ed2 // main cosmossdk.io/server/v2/cometbft v0.0.0-00010101000000-000000000000 - cosmossdk.io/store/v2 v2.0.0-20241129190247-24d456db40a8 // main + cosmossdk.io/store/v2 v2.0.0-20241202115147-f350775d0ed2 // main cosmossdk.io/tools/confix v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 3c904371cbce..37323eae69c5 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -214,16 +214,16 @@ cosmossdk.io/runtime/v2 v2.0.0-20241119134933-d697a3de0f95 h1:hYI7pvrmdkgFZJ4HVQ cosmossdk.io/runtime/v2 v2.0.0-20241119134933-d697a3de0f95/go.mod h1:J4Wv2eOwAz8t14Ak8XBMWDoFbwqwyllMaJF91O7n/wI= cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b h1:svpFdulZRrYz+RTHu2u9CeKkMKrIHx5354vjiHerovo= cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/server/v2 v2.0.0-20241129190247-24d456db40a8 h1:FkHyUGwkMdohzNls+7qmg7nPjOLidMDOP6X0N21kD5g= -cosmossdk.io/server/v2 v2.0.0-20241129190247-24d456db40a8/go.mod h1:NT1O+DPv2bWxqX8QTtvBbjXpeXFw5doT2hoRRNr8ob4= +cosmossdk.io/server/v2 v2.0.0-20241202115147-f350775d0ed2 h1:PBV8S+nGjXNEW/sGUgYYwsyI315I4LtXQTrKk5g8G2A= +cosmossdk.io/server/v2 v2.0.0-20241202115147-f350775d0ed2/go.mod h1:NT1O+DPv2bWxqX8QTtvBbjXpeXFw5doT2hoRRNr8ob4= cosmossdk.io/server/v2/appmanager v0.0.0-20241119134933-d697a3de0f95 h1:GOznErJieaI0OS0LDUsu5Vy3qPnCyjdvkncejP0Zv5s= cosmossdk.io/server/v2/appmanager v0.0.0-20241119134933-d697a3de0f95/go.mod h1:elhlrldWtm+9U4PxE0G3wjz83yQwVVGVAOncXJPY1Xc= cosmossdk.io/server/v2/stf v0.0.0-20241119134933-d697a3de0f95 h1:cK7wvmlA18AvLcaInseKTBmt5EXtLwafe7oH1rx7veU= cosmossdk.io/server/v2/stf v0.0.0-20241119134933-d697a3de0f95/go.mod h1:4e9SzLyeGptQ3tSR6nKCNwCu7Ye4uUS2WIJih29dG2c= cosmossdk.io/store v1.0.0-rc.0.0.20241119134933-d697a3de0f95 h1:5hIgRL6VsicdJ7FVK6AG7cSy1C8tiVbCp6W3Y+QQ5ko= cosmossdk.io/store v1.0.0-rc.0.0.20241119134933-d697a3de0f95/go.mod h1:ceNwMZIU8ZIDoeUdA9+sGxz3GVt0orEGoVpkBfa/UtU= -cosmossdk.io/store/v2 v2.0.0-20241129190247-24d456db40a8 h1:LvlYyjMBF6+CV3lOCnkZqNk0+LkVehDnTPHh+JLO7Mg= -cosmossdk.io/store/v2 v2.0.0-20241129190247-24d456db40a8/go.mod h1:1DbksNgjyQ1XxlCYqkU82WqBGWcxmgciO5dBf6dRhKM= +cosmossdk.io/store/v2 v2.0.0-20241202115147-f350775d0ed2 h1:SmP9frnyUuBXW6rqNfPXDGaLfgN9INaHzBMZZW8ZraU= +cosmossdk.io/store/v2 v2.0.0-20241202115147-f350775d0ed2/go.mod h1:1DbksNgjyQ1XxlCYqkU82WqBGWcxmgciO5dBf6dRhKM= cosmossdk.io/x/tx v1.0.0-alpha.2 h1:UW80FMm7B0fiAMsrfe5+HabSJ3XBg+tQa6/GK9prqWk= cosmossdk.io/x/tx v1.0.0-alpha.2/go.mod h1:r4yTKSJ7ZCCR95YbBfY3nfvbgNw6m9F6f25efWYYQWo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index 9b587e6dc477..a2eea8b49fbc 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -12,6 +12,7 @@ import ( runtimev2 "cosmossdk.io/runtime/v2" serverv2 "cosmossdk.io/server/v2" grpcserver "cosmossdk.io/server/v2/api/grpc" + "cosmossdk.io/server/v2/api/grpcgateway" "cosmossdk.io/server/v2/api/rest" "cosmossdk.io/server/v2/api/telemetry" "cosmossdk.io/server/v2/cometbft" @@ -26,6 +27,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/rpc" sdktelemetry "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/genutil" @@ -85,6 +87,7 @@ func InitRootCmd[T transaction.Tx]( &serverstore.Server[T]{}, &telemetry.Server[T]{}, &rest.Server[T]{}, + &grpcgateway.Server[T]{}, ) } @@ -142,6 +145,22 @@ func InitRootCmd[T transaction.Tx]( return nil, err } + grpcgatewayServer, err := grpcgateway.New[T]( + logger, + deps.GlobalConfig, + simApp.InterfaceRegistry(), + ) + if err != nil { + return nil, err + } + + for _, mod := range deps.ModuleManager.Modules() { + if gmod, ok := mod.(module.HasGRPCGateway); ok { + // TODO(@julienrbrt) https://github.com/cosmos/cosmos-sdk/pull/22701#pullrequestreview-2470651390 + gmod.RegisterGRPCGatewayRoutes(deps.ClientContext, grpcgatewayServer.GRPCGatewayRouter) + } + } + // wire server commands return serverv2.AddCommands[T]( rootCmd, @@ -154,6 +173,7 @@ func InitRootCmd[T transaction.Tx]( storeComponent, telemetryServer, restServer, + grpcgatewayServer, ) } diff --git a/simapp/v2/simdv2/cmd/testnet.go b/simapp/v2/simdv2/cmd/testnet.go index 3886b90add4e..be8189a7cd50 100644 --- a/simapp/v2/simdv2/cmd/testnet.go +++ b/simapp/v2/simdv2/cmd/testnet.go @@ -20,6 +20,7 @@ import ( runtimev2 "cosmossdk.io/runtime/v2" serverv2 "cosmossdk.io/server/v2" "cosmossdk.io/server/v2/api/grpc" + "cosmossdk.io/server/v2/api/grpcgateway" "cosmossdk.io/server/v2/api/rest" "cosmossdk.io/server/v2/cometbft" "cosmossdk.io/server/v2/store" @@ -193,7 +194,9 @@ func initTestnetFiles[T transaction.Tx]( for i := 0; i < args.numValidators; i++ { var portOffset int grpcConfig := grpc.DefaultConfig() + grpcgatewayConfig := grpcgateway.DefaultConfig() restConfig := rest.DefaultConfig() + if args.singleMachine { portOffset = i p2pPortStart = 16656 // use different start point to not conflict with rpc port @@ -208,6 +211,11 @@ func initTestnetFiles[T transaction.Tx]( MaxSendMsgSize: grpc.DefaultConfig().MaxSendMsgSize, } + grpcgatewayConfig = &grpcgateway.Config{ + Enable: true, + Address: fmt.Sprintf("127.0.0.1:%d", apiPort+portOffset), + } + restConfig = &rest.Config{ Enable: true, Address: fmt.Sprintf("127.0.0.1:%d", restPort+portOffset), @@ -345,8 +353,9 @@ func initTestnetFiles[T transaction.Tx]( cometServer := cometbft.NewWithConfigOptions[T](cometbft.OverwriteDefaultConfigTomlConfig(nodeConfig)) storeServer := &store.Server[T]{} grpcServer := grpc.NewWithConfigOptions[T](grpc.OverwriteDefaultConfig(grpcConfig)) + grpcgatewayServer := grpcgateway.NewWithConfigOptions[T](grpcgateway.OverwriteDefaultConfig(grpcgatewayConfig)) restServer := rest.NewWithConfigOptions[T](rest.OverwriteDefaultConfig(restConfig)) - server := serverv2.NewServer[T](serverCfg, cometServer, storeServer, grpcServer, restServer) + server := serverv2.NewServer[T](serverCfg, cometServer, storeServer, grpcServer, grpcgatewayServer, restServer) err = server.WriteConfig(filepath.Join(nodeDir, "config")) if err != nil { return err