Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ jobs:
id: git_diff
with:
PATTERNS: |
contrib/rosetta/*
tools/rosetta/**/*.go
tools/rosetta/go.mod
tools/rosetta/go.sum
Expand Down
2 changes: 1 addition & 1 deletion contrib/rosetta/configuration/data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sed -i 's/127.0.0.1/0.0.0.0/g' /root/.simapp/config/config.toml

# start simd
echo starting simd...
simd start --pruning=nothing --api.enable true &
simd start --pruning=nothing &
pid=$!
echo simd started with PID $pid

Expand Down
2 changes: 1 addition & 1 deletion contrib/rosetta/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
services:
cosmos:
image: rosetta-ci:latest
command: ["simd", "start", "--pruning", "nothing", "--grpc.enable", "true", "--grpc.address", "0.0.0.0:9090", "--grpc-web.enable", "true", "--api.enable", "true"]
command: ["simd", "start", "--pruning", "nothing", "--grpc.enable", "true", "--grpc.address", "0.0.0.0:9090", "--grpc-web.enable", "true"]
ports:
- 9090:9090
- 26657:26657
Expand Down
11 changes: 11 additions & 0 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down