@ -392,11 +392,6 @@ var (
Usage : "JavaScript root path for `loadScript`" ,
Usage : "JavaScript root path for `loadScript`" ,
Value : "." ,
Value : "." ,
}
}
SolcPathFlag = cli . StringFlag {
Name : "solc" ,
Usage : "Solidity compiler command to be used" ,
Value : "solc" ,
}
// Gas price oracle settings
// Gas price oracle settings
GpoBlocksFlag = cli . IntFlag {
GpoBlocksFlag = cli . IntFlag {
@ -528,9 +523,9 @@ func setNAT(ctx *cli.Context, cfg *p2p.Config) {
}
}
}
}
// makeRPCModule s splits input separated by a comma and trims excessive white
// splitAndTrim splits input separated by a comma
// space from the substrings.
// and trims excessive white space from the substrings.
func makeRPCModule s( input string ) [ ] string {
func splitAndTrim ( input string ) [ ] string {
result := strings . Split ( input , "," )
result := strings . Split ( input , "," )
for i , r := range result {
for i , r := range result {
result [ i ] = strings . TrimSpace ( r )
result [ i ] = strings . TrimSpace ( r )
@ -552,10 +547,10 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
cfg . HTTPPort = ctx . GlobalInt ( RPCPortFlag . Name )
cfg . HTTPPort = ctx . GlobalInt ( RPCPortFlag . Name )
}
}
if ctx . GlobalIsSet ( RPCCORSDomainFlag . Name ) {
if ctx . GlobalIsSet ( RPCCORSDomainFlag . Name ) {
cfg . HTTPCors = ctx . GlobalString ( RPCCORSDomainFlag . Name )
cfg . HTTPCors = splitAndTrim ( ctx . GlobalString ( RPCCORSDomainFlag . Name ) )
}
}
if ctx . GlobalIsSet ( RPCApiFlag . Name ) {
if ctx . GlobalIsSet ( RPCApiFlag . Name ) {
cfg . HTTPModules = makeRPCModule s( 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 )
cfg . WSPort = ctx . GlobalInt ( WSPortFlag . Name )
}
}
if ctx . GlobalIsSet ( WSAllowedOriginsFlag . Name ) {
if ctx . GlobalIsSet ( WSAllowedOriginsFlag . Name ) {
cfg . WSOrigins = ctx . GlobalString ( WSAllowedOriginsFlag . Name )
cfg . WSOrigins = splitAndTrim ( ctx . GlobalString ( WSAllowedOriginsFlag . Name ) )
}
}
if ctx . GlobalIsSet ( WSApiFlag . Name ) {
if ctx . GlobalIsSet ( WSApiFlag . Name ) {
cfg . WSModules = makeRPCModule s( 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 ) {
if ctx . GlobalIsSet ( GasPriceFlag . Name ) {
cfg . GasPrice = GlobalBig ( ctx , GasPriceFlag . Name )
cfg . GasPrice = GlobalBig ( ctx , GasPriceFlag . Name )
}
}
if ctx . GlobalIsSet ( SolcPathFlag . Name ) {
cfg . SolcPath = ctx . GlobalString ( SolcPathFlag . Name )
}
if ctx . GlobalIsSet ( VMEnableDebugFlag . Name ) {
if ctx . GlobalIsSet ( VMEnableDebugFlag . Name ) {
// TODO(fjl): force-enable this in --dev mode
// TODO(fjl): force-enable this in --dev mode
cfg . EnablePreimageRecording = ctx . GlobalBool ( VMEnableDebugFlag . Name )
cfg . EnablePreimageRecording = ctx . GlobalBool ( VMEnableDebugFlag . Name )