From ba8d717352ae2b48daa7b55aeec2a26d2eb566ad Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:57:07 +0100 Subject: [PATCH] refactor(simapp/v2): wire telemetry in testnet command (partial backport #23022) (#23033) Co-authored-by: mmsqe Co-authored-by: Julien Robert --- server/v2/cometbft/go.mod | 8 ++++---- server/v2/cometbft/go.sum | 16 ++++++++-------- simapp/v2/go.mod | 8 ++++---- simapp/v2/go.sum | 16 ++++++++-------- simapp/v2/simdv2/cmd/testnet.go | 19 ++++++++++++++----- 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 3675b152c74a..79397248f370 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -12,10 +12,10 @@ require ( cosmossdk.io/errors/v2 v2.0.0 cosmossdk.io/log v1.5.0 cosmossdk.io/schema v1.0.0 //main - cosmossdk.io/server/v2 v2.0.0-20241219154748-69025c556666 // main - cosmossdk.io/server/v2/appmanager v0.0.0-20241219154748-69025c556666 // main - cosmossdk.io/server/v2/stf v0.0.0-20241219154748-69025c556666 // main - cosmossdk.io/store/v2 v2.0.0-20241216193553-ee5da1a70d7a // main + cosmossdk.io/server/v2 v2.0.0-20241220083032-422be7044259 // main + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 // main + cosmossdk.io/server/v2/stf v1.0.0-beta.1 // main + cosmossdk.io/store/v2 v2.0.0-beta.1 // main cosmossdk.io/x/consensus v0.2.0-rc.1 github.com/cometbft/cometbft v1.0.0 github.com/cometbft/cometbft/api v1.0.0 diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 0e15b48c14a5..ca0a6a0ffcab 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 v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/server/v2 v2.0.0-20241219154748-69025c556666 h1:0MyUvSupaaAvlrA0+oLNlGrvLWZhBSU5PQfZmP9VpKg= -cosmossdk.io/server/v2 v2.0.0-20241219154748-69025c556666/go.mod h1:X2x+lbW6HCtRHZ5FEZAs+KmrIrMu6sM8gsZtSLAz/ko= -cosmossdk.io/server/v2/appmanager v0.0.0-20241219154748-69025c556666 h1:9JqIsgUlqRf4/PyV9MBUGAqiAv9Zwi0GCJ/M+qYTEAQ= -cosmossdk.io/server/v2/appmanager v0.0.0-20241219154748-69025c556666/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A= -cosmossdk.io/server/v2/stf v0.0.0-20241219154748-69025c556666 h1:AwgAI0SSC0mBmPKelUq8tD4iROSc3UDp3yONGeWWfNA= -cosmossdk.io/server/v2/stf v0.0.0-20241219154748-69025c556666/go.mod h1:nfjihbofEF2GGadkYSFmgy5tqrAnSrmGcXUDZmmWyi8= +cosmossdk.io/server/v2 v2.0.0-20241220083032-422be7044259 h1:JJdL59NWGbozmItKaptEZpvkiPJdogiXF9i53TW/a8g= +cosmossdk.io/server/v2 v2.0.0-20241220083032-422be7044259/go.mod h1:X2x+lbW6HCtRHZ5FEZAs+KmrIrMu6sM8gsZtSLAz/ko= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 h1:EISWki+z9SDAt3OJnUl2y5Ow4qjOb+epYjLb1C7CN/E= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A= +cosmossdk.io/server/v2/stf v1.0.0-beta.1 h1:s+nRgjhKVC08/qpr51eFVodLhyyQ9ASvJBanLBfQVNI= +cosmossdk.io/server/v2/stf v1.0.0-beta.1/go.mod h1:nfjihbofEF2GGadkYSFmgy5tqrAnSrmGcXUDZmmWyi8= cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43 h1:glZ6MpmD+5AhwJYV4jzx+rn7cgUB2owHgk9o+93luz0= cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43/go.mod h1:XCWpgfueHSBY+B7Cf2Aq/CcsU+6XoFH+EmseCKglFrU= -cosmossdk.io/store/v2 v2.0.0-20241216193553-ee5da1a70d7a h1:pZbBjdj1fWKEtArkITrHyeTFucyz11IktJvw3OC03Uc= -cosmossdk.io/store/v2 v2.0.0-20241216193553-ee5da1a70d7a/go.mod h1:pqUtZ68WrKkdHF2FdvFlPmmUA1mwZwABo+enSZItluY= +cosmossdk.io/store/v2 v2.0.0-beta.1 h1:p1fdZ9uNijhpXZXdqs0QS6NmXNDVPNyT4DHV4yQnF64= +cosmossdk.io/store/v2 v2.0.0-beta.1/go.mod h1:qHQmf/9mnsXwo/Ypp2u2Zs6BmkYcx1R/Jrpyn9Ro13A= cosmossdk.io/x/bank v0.2.0-rc.1 h1:tLYxL2N0U19tU50euZZKdsixsQcU6V+eMfudn/Y7YyY= cosmossdk.io/x/bank v0.2.0-rc.1/go.mod h1:y1HipKOoiieb2gEZOQJPGwbwUBSYbIY+vG7XZAUstAE= cosmossdk.io/x/consensus v0.2.0-rc.1 h1:6Df5E4lR7ggmOxZsm953ZR+gA6PwZzU0vpG9dmZtwuw= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index eb7a659825d1..46461b70c039 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -12,9 +12,9 @@ require ( cosmossdk.io/log v1.5.0 cosmossdk.io/math v1.4.0 cosmossdk.io/runtime/v2 v2.0.0-20241219154748-69025c556666 // main - cosmossdk.io/server/v2 v2.0.0-20241219154748-69025c556666 // main + cosmossdk.io/server/v2 v2.0.0-20241220083032-422be7044259 // main cosmossdk.io/server/v2/cometbft v0.0.0-00010101000000-000000000000 - cosmossdk.io/store/v2 v2.0.0-20241216193553-ee5da1a70d7a // main + cosmossdk.io/store/v2 v2.0.0-beta.1 // main cosmossdk.io/tools/benchmark v0.2.0-rc.1 cosmossdk.io/tools/confix v0.2.0-rc.1 cosmossdk.io/x/accounts v0.2.0-rc.1 @@ -61,8 +61,8 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/errors/v2 v2.0.0 // indirect cosmossdk.io/schema v1.0.0 // indirect - cosmossdk.io/server/v2/appmanager v0.0.0-20241219154748-69025c556666 // indirect; main - cosmossdk.io/server/v2/stf v0.0.0-20241219154748-69025c556666 // indirect; main + cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 // indirect; main + cosmossdk.io/server/v2/stf v1.0.0-beta.1 // indirect; main cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43 // indirect; main cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect; main filippo.io/edwards25519 v1.1.0 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 2ddf3ed95be4..38c296806ffa 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -218,16 +218,16 @@ cosmossdk.io/runtime/v2 v2.0.0-20241219154748-69025c556666 h1:zFMi1URvs3NiJdSf2z cosmossdk.io/runtime/v2 v2.0.0-20241219154748-69025c556666/go.mod h1:C0MTcmQlZFPQvYoXzYiWP+h9lFOgezzafEFiQBa6xYo= cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/server/v2 v2.0.0-20241219154748-69025c556666 h1:0MyUvSupaaAvlrA0+oLNlGrvLWZhBSU5PQfZmP9VpKg= -cosmossdk.io/server/v2 v2.0.0-20241219154748-69025c556666/go.mod h1:X2x+lbW6HCtRHZ5FEZAs+KmrIrMu6sM8gsZtSLAz/ko= -cosmossdk.io/server/v2/appmanager v0.0.0-20241219154748-69025c556666 h1:9JqIsgUlqRf4/PyV9MBUGAqiAv9Zwi0GCJ/M+qYTEAQ= -cosmossdk.io/server/v2/appmanager v0.0.0-20241219154748-69025c556666/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A= -cosmossdk.io/server/v2/stf v0.0.0-20241219154748-69025c556666 h1:AwgAI0SSC0mBmPKelUq8tD4iROSc3UDp3yONGeWWfNA= -cosmossdk.io/server/v2/stf v0.0.0-20241219154748-69025c556666/go.mod h1:nfjihbofEF2GGadkYSFmgy5tqrAnSrmGcXUDZmmWyi8= +cosmossdk.io/server/v2 v2.0.0-20241220083032-422be7044259 h1:JJdL59NWGbozmItKaptEZpvkiPJdogiXF9i53TW/a8g= +cosmossdk.io/server/v2 v2.0.0-20241220083032-422be7044259/go.mod h1:X2x+lbW6HCtRHZ5FEZAs+KmrIrMu6sM8gsZtSLAz/ko= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1 h1:EISWki+z9SDAt3OJnUl2y5Ow4qjOb+epYjLb1C7CN/E= +cosmossdk.io/server/v2/appmanager v1.0.0-beta.1/go.mod h1:RVYxIaEdIT10nWSRqbwKDLFWfvCVx+cwAorCyPAQg9A= +cosmossdk.io/server/v2/stf v1.0.0-beta.1 h1:s+nRgjhKVC08/qpr51eFVodLhyyQ9ASvJBanLBfQVNI= +cosmossdk.io/server/v2/stf v1.0.0-beta.1/go.mod h1:nfjihbofEF2GGadkYSFmgy5tqrAnSrmGcXUDZmmWyi8= cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43 h1:glZ6MpmD+5AhwJYV4jzx+rn7cgUB2owHgk9o+93luz0= cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43/go.mod h1:XCWpgfueHSBY+B7Cf2Aq/CcsU+6XoFH+EmseCKglFrU= -cosmossdk.io/store/v2 v2.0.0-20241216193553-ee5da1a70d7a h1:pZbBjdj1fWKEtArkITrHyeTFucyz11IktJvw3OC03Uc= -cosmossdk.io/store/v2 v2.0.0-20241216193553-ee5da1a70d7a/go.mod h1:pqUtZ68WrKkdHF2FdvFlPmmUA1mwZwABo+enSZItluY= +cosmossdk.io/store/v2 v2.0.0-beta.1 h1:p1fdZ9uNijhpXZXdqs0QS6NmXNDVPNyT4DHV4yQnF64= +cosmossdk.io/store/v2 v2.0.0-beta.1/go.mod h1:qHQmf/9mnsXwo/Ypp2u2Zs6BmkYcx1R/Jrpyn9Ro13A= cosmossdk.io/tools/benchmark v0.2.0-rc.1 h1:Jgk0FLvnMQJrivrSMhKQBwaTiJz6MGq5ZbaHag7Sqq0= cosmossdk.io/tools/benchmark v0.2.0-rc.1/go.mod h1:tnGa8L7xHFMp26FbLvU5MRlS89BFrCxSOKR8jCi7kVU= cosmossdk.io/tools/confix v0.2.0-rc.1 h1:sVYXR89OKW19oCnr232m9/pE3+oJllNTZlTypWhXHNI= diff --git a/simapp/v2/simdv2/cmd/testnet.go b/simapp/v2/simdv2/cmd/testnet.go index be8189a7cd50..4a7abe6ed2c7 100644 --- a/simapp/v2/simdv2/cmd/testnet.go +++ b/simapp/v2/simdv2/cmd/testnet.go @@ -22,6 +22,7 @@ import ( "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" "cosmossdk.io/server/v2/store" banktypes "cosmossdk.io/x/bank/types" @@ -182,10 +183,11 @@ func initTestnetFiles[T transaction.Tx]( genFiles []string ) const ( - rpcPort = 26657 - apiPort = 1317 - grpcPort = 9090 - restPort = 8080 + rpcPort = 26657 + apiPort = 1317 + grpcPort = 9090 + restPort = 8080 + telemetryPort = 7180 ) p2pPortStart := 26656 @@ -196,6 +198,7 @@ func initTestnetFiles[T transaction.Tx]( grpcConfig := grpc.DefaultConfig() grpcgatewayConfig := grpcgateway.DefaultConfig() restConfig := rest.DefaultConfig() + telemetryConfig := telemetry.DefaultConfig() if args.singleMachine { portOffset = i @@ -220,6 +223,11 @@ func initTestnetFiles[T transaction.Tx]( Enable: true, Address: fmt.Sprintf("127.0.0.1:%d", restPort+portOffset), } + + telemetryConfig = &telemetry.Config{ + Enable: true, + Address: fmt.Sprintf("127.0.0.1:%d", telemetryPort+portOffset), + } } nodeDirName := fmt.Sprintf("%s%d", args.nodeDirPrefix, i) @@ -355,7 +363,8 @@ func initTestnetFiles[T transaction.Tx]( 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, grpcgatewayServer, restServer) + telemetryServer := telemetry.NewWithConfigOptions[T](telemetry.OverwriteDefaultConfig(telemetryConfig)) + server := serverv2.NewServer[T](serverCfg, cometServer, storeServer, grpcServer, grpcgatewayServer, restServer, telemetryServer) err = server.WriteConfig(filepath.Join(nodeDir, "config")) if err != nil { return err