|
|
|
@ -233,6 +233,11 @@ var ( |
|
|
|
|
cacheTimeFlag, |
|
|
|
|
cacheSizeFlag, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
metricsFlags = []cli.Flag{ |
|
|
|
|
metricsETHFlag, |
|
|
|
|
metricsExpensiveETHFlag, |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
@ -339,6 +344,7 @@ func getRootFlags() []cli.Flag { |
|
|
|
|
flags = append(flags, prometheusFlags...) |
|
|
|
|
flags = append(flags, syncFlags...) |
|
|
|
|
flags = append(flags, shardDataFlags...) |
|
|
|
|
flags = append(flags, metricsFlags...) |
|
|
|
|
|
|
|
|
|
return flags |
|
|
|
|
} |
|
|
|
@ -1754,6 +1760,22 @@ var ( |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// metrics flags required for the go-eth library
|
|
|
|
|
// https://github.com/ethereum/go-ethereum/blob/master/metrics/metrics.go#L35-L55
|
|
|
|
|
var ( |
|
|
|
|
metricsETHFlag = cli.BoolFlag{ |
|
|
|
|
Name: "metrics", // https://github.com/ethereum/go-ethereum/blob/master/metrics/metrics.go#L30
|
|
|
|
|
Usage: "flag required to enable the eth metrics", |
|
|
|
|
DefValue: false, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
metricsExpensiveETHFlag = cli.BoolFlag{ |
|
|
|
|
Name: "metrics.expensive", // https://github.com/ethereum/go-ethereum/blob/master/metrics/metrics.go#L33
|
|
|
|
|
Usage: "flag required to enable the expensive eth metrics", |
|
|
|
|
DefValue: false, |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func applyShardDataFlags(cmd *cobra.Command, cfg *harmonyconfig.HarmonyConfig) { |
|
|
|
|
if cli.IsFlagChanged(cmd, enableShardDataFlag) { |
|
|
|
|
cfg.ShardData.EnableShardData = cli.GetBoolFlagValue(cmd, enableShardDataFlag) |
|
|
|
|