modified deprecated comments for consistency, added warn log for --rpc

This commit is contained in:
renaynay 2020-04-22 15:49:00 +02:00
parent 7161010f95
commit f88d01503c
No known key found for this signature in database
GPG key ID: 6557F5413D663EDB
2 changed files with 7 additions and 5 deletions

View file

@ -887,6 +887,7 @@ func splitAndTrim(input string) []string {
// command line flags, returning empty if the HTTP endpoint is disabled. // command line flags, returning empty if the HTTP endpoint is disabled.
func setHTTP(ctx *cli.Context, cfg *node.Config) { func setHTTP(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalBool(LegacyRPCEnabledFlag.Name) && cfg.HTTPHost == "" { if ctx.GlobalBool(LegacyRPCEnabledFlag.Name) && cfg.HTTPHost == "" {
log.Warn("The flag --rpc is deprecated and will be removed in the future, please use --http")
cfg.HTTPHost = "127.0.0.1" cfg.HTTPHost = "127.0.0.1"
if ctx.GlobalIsSet(LegacyRPCListenAddrFlag.Name) { if ctx.GlobalIsSet(LegacyRPCListenAddrFlag.Name) {
cfg.HTTPHost = ctx.GlobalString(LegacyRPCListenAddrFlag.Name) cfg.HTTPHost = ctx.GlobalString(LegacyRPCListenAddrFlag.Name)

View file

@ -86,26 +86,27 @@ var (
Name: "trace", Name: "trace",
Usage: "Write execution trace to the given file", Usage: "Write execution trace to the given file",
} }
legacyPprofPortFlag = cli.IntFlag{ // (Deprecated April 2020) // (Deprecated April 2020)
legacyPprofPortFlag = cli.IntFlag{
Name: "pprofport", Name: "pprofport",
Usage: "pprof HTTP server listening port (deprecated, use --pprof.port)", Usage: "pprof HTTP server listening port (deprecated, use --pprof.port)",
Value: 6060, Value: 6060,
} }
legacyPprofAddrFlag = cli.StringFlag{ // (Deprecated April 2020) legacyPprofAddrFlag = cli.StringFlag{
Name: "pprofaddr", Name: "pprofaddr",
Usage: "pprof HTTP server listening interface (deprecated, use --pprof.addr)", Usage: "pprof HTTP server listening interface (deprecated, use --pprof.addr)",
Value: "127.0.0.1", Value: "127.0.0.1",
} }
legacyMemprofilerateFlag = cli.IntFlag{ // (Deprecated April 2020) legacyMemprofilerateFlag = cli.IntFlag{
Name: "memprofilerate", Name: "memprofilerate",
Usage: "Turn on memory profiling with the given rate (deprecated, use --pprof.memprofilerate)", Usage: "Turn on memory profiling with the given rate (deprecated, use --pprof.memprofilerate)",
Value: runtime.MemProfileRate, Value: runtime.MemProfileRate,
} }
legacyBlockprofilerateFlag = cli.IntFlag{ // (Deprecated April 2020) legacyBlockprofilerateFlag = cli.IntFlag{
Name: "blockprofilerate", Name: "blockprofilerate",
Usage: "Turn on block profiling with the given rate (deprecated, use --pprof.blockprofilerate)", Usage: "Turn on block profiling with the given rate (deprecated, use --pprof.blockprofilerate)",
} }
legacyCpuprofileFlag = cli.StringFlag{ // (Deprecated April 2020) legacyCpuprofileFlag = cli.StringFlag{
Name: "cpuprofile", Name: "cpuprofile",
Usage: "Write CPU profile to the given file (deprecated, use --pprof.cpuprofile)", Usage: "Write CPU profile to the given file (deprecated, use --pprof.cpuprofile)",
} }