diff --git a/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md b/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md new file mode 100644 index 00000000000..2ad2b3700dc --- /dev/null +++ b/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md @@ -0,0 +1,3 @@ +- register NodeService to enable query /cosmos/base/node/v1beta1/config + gRPC query to disclose node operator's configured minimum-gas-price. + ([\#2629](https://github.com/cosmos/gaia/issues/2629)) \ No newline at end of file diff --git a/app/app.go b/app/app.go index d43e43de4e2..6953942ccaf 100644 --- a/app/app.go +++ b/app/app.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + 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" @@ -307,6 +308,8 @@ func (app *GaiaApp) SimulationManager() *module.SimulationManager { func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx rpc.RegisterRoutes(clientCtx, apiSvr.Router) + + nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register legacy tx routes. authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) // Register new tx routes from grpc-gateway. @@ -324,6 +327,11 @@ func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo } } +// RegisterTxService allows query minimum-gas-prices in app.toml +func (app *GaiaApp) RegisterNodeService(clientCtx client.Context) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +} + // RegisterTxService implements the Application.RegisterTxService method. func (app *GaiaApp) RegisterTxService(clientCtx client.Context) { authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) diff --git a/tests/e2e/e2e_rest_regression_test.go b/tests/e2e/e2e_rest_regression_test.go index 8777c516a69..56747278102 100644 --- a/tests/e2e/e2e_rest_regression_test.go +++ b/tests/e2e/e2e_rest_regression_test.go @@ -43,6 +43,7 @@ const ( slashingParamsModuleQueryPath = "/slashing/parameters" stakingParamsModuleQueryPath = "/staking/parameters" missingPath = "/missing_endpoint" + localMinGasPriceQueryPath = "/cosmos/base/node/v1beta1/config" ) func (s *IntegrationTestSuite) testRestInterfaces() { @@ -73,6 +74,8 @@ func (s *IntegrationTestSuite) testRestInterfaces() { {slashingParamsModuleQueryPath, 200}, {stakingParamsModuleQueryPath, 200}, {missingPath, 501}, + // node config Endpoint + {localMinGasPriceQueryPath, 200}, } )