From 5e29f4be935ff227bbf07a0c6e80e8809f5e0202 Mon Sep 17 00:00:00 2001 From: bas-vk Date: Wed, 12 Apr 2017 23:04:14 +0200 Subject: cmd/utils, node: remove unused solc references and improve RPC config (#14324) Currently http cors and websocket origins are a comma separated string in the config object. These are replaced with string arrays that are more expressive in case of a config file. --- cmd/geth/main.go | 1 - cmd/geth/usage.go | 6 ------ cmd/utils/flags.go | 23 +++++++---------------- 3 files changed, 7 insertions(+), 23 deletions(-) (limited to 'cmd') diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 8e434948e..5fb50c4ad 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -140,7 +140,6 @@ func init() { utils.MetricsEnabledFlag, utils.FakePoWFlag, utils.NoCompactionFlag, - utils.SolcPathFlag, utils.GpoBlocksFlag, utils.GpoPercentileFlag, utils.ExtraDataFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 334d017d9..a172b4775 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -174,12 +174,6 @@ var AppHelpFlagGroups = []flagGroup{ utils.WhisperEnabledFlag, }, }, - { - Name: "MISCELLANEOUS", - Flags: []cli.Flag{ - utils.SolcPathFlag, - }, - }, } func init() { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1bd77139c..b35574c86 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -392,11 +392,6 @@ var ( Usage: "JavaScript root path for `loadScript`", Value: ".", } - SolcPathFlag = cli.StringFlag{ - Name: "solc", - Usage: "Solidity compiler command to be used", - Value: "solc", - } // Gas price oracle settings GpoBlocksFlag = cli.IntFlag{ @@ -528,9 +523,9 @@ func setNAT(ctx *cli.Context, cfg *p2p.Config) { } } -// makeRPCModules splits input separated by a comma and trims excessive white -// space from the substrings. -func makeRPCModules(input string) []string { +// splitAndTrim splits input separated by a comma +// and trims excessive white space from the substrings. +func splitAndTrim(input string) []string { result := strings.Split(input, ",") for i, r := range result { result[i] = strings.TrimSpace(r) @@ -552,10 +547,10 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) { cfg.HTTPPort = ctx.GlobalInt(RPCPortFlag.Name) } if ctx.GlobalIsSet(RPCCORSDomainFlag.Name) { - cfg.HTTPCors = ctx.GlobalString(RPCCORSDomainFlag.Name) + cfg.HTTPCors = splitAndTrim(ctx.GlobalString(RPCCORSDomainFlag.Name)) } if ctx.GlobalIsSet(RPCApiFlag.Name) { - cfg.HTTPModules = makeRPCModules(ctx.GlobalString(RPCApiFlag.Name)) + cfg.HTTPModules = splitAndTrim(ctx.GlobalString(RPCApiFlag.Name)) } } @@ -573,10 +568,10 @@ func setWS(ctx *cli.Context, cfg *node.Config) { cfg.WSPort = ctx.GlobalInt(WSPortFlag.Name) } if ctx.GlobalIsSet(WSAllowedOriginsFlag.Name) { - cfg.WSOrigins = ctx.GlobalString(WSAllowedOriginsFlag.Name) + cfg.WSOrigins = splitAndTrim(ctx.GlobalString(WSAllowedOriginsFlag.Name)) } if ctx.GlobalIsSet(WSApiFlag.Name) { - cfg.WSModules = makeRPCModules(ctx.GlobalString(WSApiFlag.Name)) + cfg.WSModules = splitAndTrim(ctx.GlobalString(WSApiFlag.Name)) } } @@ -828,10 +823,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if ctx.GlobalIsSet(GasPriceFlag.Name) { cfg.GasPrice = GlobalBig(ctx, GasPriceFlag.Name) } - - if ctx.GlobalIsSet(SolcPathFlag.Name) { - cfg.SolcPath = ctx.GlobalString(SolcPathFlag.Name) - } if ctx.GlobalIsSet(VMEnableDebugFlag.Name) { // TODO(fjl): force-enable this in --dev mode cfg.EnablePreimageRecording = ctx.GlobalBool(VMEnableDebugFlag.Name) -- cgit