fix: allow grpc server enabled even when api off (#14890)

This commit is contained in:
Julien Robert
2023-02-02 20:34:46 +01:00
committed by GitHub
parent 79f51403a9
commit 12394c8b99
4 changed files with 14 additions and 2 deletions
+11
View File
@@ -441,6 +441,17 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
}
}
// If gRPC is enabled but API is not, we need to start the gRPC server
// without the API server. If the API server is enabled, we've already
// started the grpc server.
if config.GRPC.Enable && !config.API.Enable {
grpcSrv, err = servergrpc.StartGRPCServer(clientCtx, app, config.GRPC)
if err != nil {
return err
}
defer grpcSrv.Stop()
}
// At this point it is safe to block the process if we're in gRPC only mode as
// we do not need to handle any Tendermint related processes.
if gRPCOnly {