diff --git a/cmd/geth/config.go b/cmd/geth/config.go index befca177f7..c427da1fcc 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -196,9 +196,10 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { // Configure log filter RPC API. filterSystem := utils.RegisterFilterAPI(stack, backend, &cfg.Eth) - // TODO: ENG191 add flag to request endpoint - utils.RegisterHealthService(stack, &cfg.Node) - + // Configure the healthcheck API if requested. + if ctx.IsSet(utils.HTTPHealthEnabledFlag.Name) { + utils.RegisterHealthService(stack, &cfg.Node) + } // Configure GraphQL if requested. if ctx.IsSet(utils.GraphQLEnabledFlag.Name) { utils.RegisterGraphQLService(stack, backend, filterSystem, &cfg.Node) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 2f7d37fdd7..bfeab56070 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -153,6 +153,7 @@ var ( utils.HTTPListenAddrFlag, utils.HTTPPortFlag, utils.HTTPCORSDomainFlag, + utils.HTTPHealthEnabledFlag, utils.AuthListenFlag, utils.AuthPortFlag, utils.AuthVirtualHostsFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index fc0c987537..826aa915db 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -614,6 +614,11 @@ var ( Value: "", Category: flags.APICategory, } + HTTPHealthEnabledFlag = &cli.BoolFlag{ + Name: "http.health", + Usage: "Enable the HTTP healthcheck API at path '/health'.", + Category: flags.APICategory, + } GraphQLEnabledFlag = &cli.BoolFlag{ Name: "graphql", Usage: "Enable GraphQL on the HTTP-RPC server. Note that GraphQL can only be started if an HTTP server is started as well.",