From 48357ed8efb10386681dee0730febe8da56c3cff Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Tue, 10 Oct 2023 02:31:54 +0530 Subject: [PATCH] newer gRPC services --- app/app.go | 11 +++++++++++ cmd/comdex/root.go | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index ca16c5d2b..2822e5664 100644 --- a/app/app.go +++ b/app/app.go @@ -119,9 +119,12 @@ import ( ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "github.com/comdex-official/comdex/x/liquidation" liquidationkeeper "github.com/comdex-official/comdex/x/liquidation/keeper" liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" tmdb "github.com/cometbft/cometbft-db" abcitypes "github.com/cometbft/cometbft/abci/types" @@ -1152,6 +1155,14 @@ func New( app.MountTransientStores(app.tkeys) app.MountMemoryStores(app.mkeys) + // SDK v47 - since we do not use dep inject, this gives us access to newer gRPC services. + autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) + reflectionSvc, err := runtimeservices.NewReflectionService() + if err != nil { + panic(err) + } + reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) + // initialize BaseApp app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) diff --git a/cmd/comdex/root.go b/cmd/comdex/root.go index 078fe8dcf..20c205d0b 100644 --- a/cmd/comdex/root.go +++ b/cmd/comdex/root.go @@ -51,7 +51,7 @@ func NewRootCmd() (*cobra.Command, comdex.EncodingConfig) { WithLegacyAmino(encodingConfig.Amino). WithInput(os.Stdin). WithAccountRetriever(authtypes.AccountRetriever{}). - // WithBroadcastMode(flags.FlagBroadcastMode). + WithBroadcastMode(flags.FlagBroadcastMode). WithHomeDir(comdex.DefaultNodeHome). WithViper("")