mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-02 13:08:41 +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.
|
// Configure log filter RPC API.
|
||||||
filterSystem := utils.RegisterFilterAPI(stack, backend, &cfg.Eth)
|
filterSystem := utils.RegisterFilterAPI(stack, backend, &cfg.Eth)
|
||||||
|
|
||||||
// TODO: ENG191 add flag to request endpoint
|
// Configure the healthcheck API if requested.
|
||||||
utils.RegisterHealthService(stack, &cfg.Node)
|
if ctx.IsSet(utils.HTTPHealthEnabledFlag.Name) {
|
||||||
|
utils.RegisterHealthService(stack, &cfg.Node)
|
||||||
|
}
|
||||||
// Configure GraphQL if requested.
|
// Configure GraphQL if requested.
|
||||||
if ctx.IsSet(utils.GraphQLEnabledFlag.Name) {
|
if ctx.IsSet(utils.GraphQLEnabledFlag.Name) {
|
||||||
utils.RegisterGraphQLService(stack, backend, filterSystem, &cfg.Node)
|
utils.RegisterGraphQLService(stack, backend, filterSystem, &cfg.Node)
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ var (
|
||||||
utils.HTTPListenAddrFlag,
|
utils.HTTPListenAddrFlag,
|
||||||
utils.HTTPPortFlag,
|
utils.HTTPPortFlag,
|
||||||
utils.HTTPCORSDomainFlag,
|
utils.HTTPCORSDomainFlag,
|
||||||
|
utils.HTTPHealthEnabledFlag,
|
||||||
utils.AuthListenFlag,
|
utils.AuthListenFlag,
|
||||||
utils.AuthPortFlag,
|
utils.AuthPortFlag,
|
||||||
utils.AuthVirtualHostsFlag,
|
utils.AuthVirtualHostsFlag,
|
||||||
|
|
|
||||||
|
|
@ -614,6 +614,11 @@ var (
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
|
HTTPHealthEnabledFlag = &cli.BoolFlag{
|
||||||
|
Name: "http.health",
|
||||||
|
Usage: "Enable the HTTP healthcheck API at path '/health'.",
|
||||||
|
Category: flags.APICategory,
|
||||||
|
}
|
||||||
GraphQLEnabledFlag = &cli.BoolFlag{
|
GraphQLEnabledFlag = &cli.BoolFlag{
|
||||||
Name: "graphql",
|
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.",
|
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