mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
health: Add CLI flag
This commit is contained in:
parent
adc14c80f0
commit
6fc5fbee21
3 changed files with 10 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ var (
|
|||
utils.HTTPListenAddrFlag,
|
||||
utils.HTTPPortFlag,
|
||||
utils.HTTPCORSDomainFlag,
|
||||
utils.HTTPHealthEnabledFlag,
|
||||
utils.AuthListenFlag,
|
||||
utils.AuthPortFlag,
|
||||
utils.AuthVirtualHostsFlag,
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue