From 608415adfd0d5fedb081c369268461541b3fe4e4 Mon Sep 17 00:00:00 2001 From: Sergey <83376337+freak12techno@users.noreply.github.com> Date: Fri, 9 Aug 2024 13:47:25 +0300 Subject: [PATCH] chore: add node service handler (#233) * chore: add node service handler * chore: fix --- app/app.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/app.go b/app/app.go index c5440361..9b14c64a 100644 --- a/app/app.go +++ b/app/app.go @@ -58,6 +58,7 @@ import ( fantokenclient "github.com/bitsongofficial/go-bitsong/x/fantoken/client" merkledropclient "github.com/bitsongofficial/go-bitsong/x/merkledrop/client" "github.com/cosmos/cosmos-sdk/baseapp" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/codec" @@ -818,6 +819,8 @@ func (app *BitsongApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.AP authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register new tendermint queries routes from grpc-gateway. + nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register legacy and grpc-gateway routes for all modules. ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) @@ -839,6 +842,11 @@ func (app *BitsongApp) RegisterTendermintService(clientCtx client.Context) { tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) } +// RegisterNodeService implements the Application.RegisterNodeService method. +func (app *BitsongApp) RegisterNodeService(clientCtx client.Context) { + nodeservice.RegisterNodeService(clientCtx, app.BaseApp.GRPCQueryRouter()) +} + func (app *BitsongApp) setupUpgradeStoreLoaders() { upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil {