From 7477b04d2834d7f86f1bc7dd1cc21e09c15b85f0 Mon Sep 17 00:00:00 2001 From: Collin Brittain Date: Wed, 8 May 2024 09:28:39 -0500 Subject: [PATCH] Add autocli query service --- app/app.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/app.go b/app/app.go index e3f92289..9f225bc2 100644 --- a/app/app.go +++ b/app/app.go @@ -9,6 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" @@ -20,6 +22,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -744,6 +747,14 @@ func NewSommelierApp( app.MountTransientStores(tkeys) app.MountMemoryStores(memKeys) + 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)