@@ -345,21 +345,21 @@ var (
345
345
Name : "miner-gaslimit" ,
346
346
Aliases : []string {"targetgaslimit" },
347
347
Usage : "Target gas limit sets the artificial target gas floor for the blocks to mine" ,
348
- Value : params . XDCGenesisGasLimit ,
348
+ Value : 50000000 ,
349
349
Category : flags .MinerCategory ,
350
350
}
351
351
MinerGasPriceFlag = & flags.BigFlag {
352
352
Name : "miner-gasprice" ,
353
353
Aliases : []string {"gasprice" },
354
354
Usage : "Minimal gas price to accept for mining a transactions" ,
355
- Value : ethconfig . Defaults . GasPrice ,
355
+ Value : big . NewInt ( 1 ) ,
356
356
Category : flags .MinerCategory ,
357
357
}
358
358
MinerEtherbaseFlag = & cli.StringFlag {
359
359
Name : "miner-etherbase" ,
360
360
Aliases : []string {"etherbase" },
361
361
Usage : "Public address for block mining rewards (default = first account created)" ,
362
- Value : "0 " ,
362
+ Value : "0x000000000000000000000000000000000000abcd " ,
363
363
Category : flags .MinerCategory ,
364
364
}
365
365
MinerExtraDataFlag = & cli.StringFlag {
@@ -437,13 +437,14 @@ var (
437
437
Name : "http" ,
438
438
Aliases : []string {"rpc" },
439
439
Usage : "Enable the HTTP-RPC server" ,
440
+ Value : true ,
440
441
Category : flags .APICategory ,
441
442
}
442
443
HTTPListenAddrFlag = & cli.StringFlag {
443
444
Name : "http-addr" ,
444
445
Aliases : []string {"rpcaddr" },
445
446
Usage : "HTTP-RPC server listening interface" ,
446
- Value : node . DefaultHTTPHost ,
447
+ Value : "0.0.0.0" ,
447
448
Category : flags .APICategory ,
448
449
}
449
450
HTTPPortFlag = & cli.IntFlag {
@@ -457,21 +458,21 @@ var (
457
458
Name : "http-corsdomain" ,
458
459
Aliases : []string {"rpccorsdomain" },
459
460
Usage : "Comma separated list of domains from which to accept cross origin requests (browser enforced)" ,
460
- Value : "" ,
461
+ Value : "* " ,
461
462
Category : flags .APICategory ,
462
463
}
463
464
HTTPVirtualHostsFlag = & cli.StringFlag {
464
465
Name : "http-vhosts" ,
465
466
Aliases : []string {"rpcvhosts" },
466
467
Usage : "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard." ,
467
- Value : strings . Join ( node . DefaultConfig . HTTPVirtualHosts , "," ) ,
468
+ Value : "*" ,
468
469
Category : flags .APICategory ,
469
470
}
470
471
HTTPApiFlag = & cli.StringFlag {
471
472
Name : "http-api" ,
472
473
Aliases : []string {"rpcapi" },
473
474
Usage : "API's offered over the HTTP-RPC interface" ,
474
- Value : "" ,
475
+ Value : "debug,eth,net,personal,txpool,web3,XDPoS " ,
475
476
Category : flags .APICategory ,
476
477
}
477
478
HTTPReadTimeoutFlag = & cli.DurationFlag {
@@ -498,13 +499,14 @@ var (
498
499
WSEnabledFlag = & cli.BoolFlag {
499
500
Name : "ws" ,
500
501
Usage : "Enable the WS-RPC server" ,
502
+ Value : true ,
501
503
Category : flags .APICategory ,
502
504
}
503
505
WSListenAddrFlag = & cli.StringFlag {
504
506
Name : "ws-addr" ,
505
507
Aliases : []string {"wsaddr" },
506
508
Usage : "WS-RPC server listening interface" ,
507
- Value : node . DefaultWSHost ,
509
+ Value : "0.0.0.0" ,
508
510
Category : flags .APICategory ,
509
511
}
510
512
WSPortFlag = & cli.IntFlag {
@@ -518,14 +520,14 @@ var (
518
520
Name : "ws-api" ,
519
521
Aliases : []string {"wsapi" },
520
522
Usage : "API's offered over the WS-RPC interface" ,
521
- Value : "" ,
523
+ Value : "debug,eth,net,personal,txpool,web3,XDPoS " ,
522
524
Category : flags .APICategory ,
523
525
}
524
526
WSAllowedOriginsFlag = & cli.StringFlag {
525
527
Name : "ws-origins" ,
526
528
Aliases : []string {"wsorigins" },
527
529
Usage : "Origins from which to accept websockets requests" ,
528
- Value : "" ,
530
+ Value : "* " ,
529
531
Category : flags .APICategory ,
530
532
}
531
533
ExecFlag = & cli.StringFlag {
@@ -970,11 +972,11 @@ func splitAndTrim(input string) (ret []string) {
970
972
// setHTTP creates the HTTP RPC listener interface string from the set
971
973
// command line flags, returning empty if the HTTP endpoint is disabled.
972
974
func setHTTP (ctx * cli.Context , cfg * node.Config ) {
973
- if ctx .Bool (HTTPEnabledFlag .Name ) && cfg .HTTPHost == "" {
974
- cfg .HTTPHost = "127.0.0.1"
975
- if ctx .IsSet (HTTPListenAddrFlag .Name ) {
976
- cfg .HTTPHost = ctx .String (HTTPListenAddrFlag .Name )
975
+ if ctx .Bool (HTTPEnabledFlag .Name ) {
976
+ if cfg .HTTPHost == "" {
977
+ cfg .HTTPHost = "127.0.0.1"
977
978
}
979
+ cfg .HTTPHost = ctx .String (HTTPListenAddrFlag .Name )
978
980
}
979
981
980
982
if ctx .IsSet (HTTPPortFlag .Name ) {
@@ -989,36 +991,26 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
989
991
if ctx .IsSet (HTTPIdleTimeoutFlag .Name ) {
990
992
cfg .HTTPTimeouts .IdleTimeout = ctx .Duration (HTTPIdleTimeoutFlag .Name )
991
993
}
992
- if ctx .IsSet (HTTPCORSDomainFlag .Name ) {
993
- cfg .HTTPCors = splitAndTrim (ctx .String (HTTPCORSDomainFlag .Name ))
994
- }
995
- if ctx .IsSet (HTTPApiFlag .Name ) {
996
- cfg .HTTPModules = splitAndTrim (ctx .String (HTTPApiFlag .Name ))
997
- }
998
- if ctx .IsSet (HTTPVirtualHostsFlag .Name ) {
999
- cfg .HTTPVirtualHosts = splitAndTrim (ctx .String (HTTPVirtualHostsFlag .Name ))
1000
- }
994
+ cfg .HTTPCors = splitAndTrim (ctx .String (HTTPCORSDomainFlag .Name ))
995
+ cfg .HTTPModules = splitAndTrim (ctx .String (HTTPApiFlag .Name ))
996
+ cfg .HTTPVirtualHosts = splitAndTrim (ctx .String (HTTPVirtualHostsFlag .Name ))
1001
997
}
1002
998
1003
999
// setWS creates the WebSocket RPC listener interface string from the set
1004
1000
// command line flags, returning empty if the HTTP endpoint is disabled.
1005
1001
func setWS (ctx * cli.Context , cfg * node.Config ) {
1006
- if ctx .Bool (WSEnabledFlag .Name ) && cfg .WSHost == "" {
1007
- cfg .WSHost = "127.0.0.1"
1008
- if ctx .IsSet (WSListenAddrFlag .Name ) {
1009
- cfg .WSHost = ctx .String (WSListenAddrFlag .Name )
1002
+ if ctx .Bool (WSEnabledFlag .Name ) {
1003
+ if cfg .WSHost == "" {
1004
+ cfg .WSHost = "127.0.0.1"
1010
1005
}
1006
+ cfg .WSHost = ctx .String (WSListenAddrFlag .Name )
1011
1007
}
1012
1008
1013
1009
if ctx .IsSet (WSPortFlag .Name ) {
1014
1010
cfg .WSPort = ctx .Int (WSPortFlag .Name )
1015
1011
}
1016
- if ctx .IsSet (WSAllowedOriginsFlag .Name ) {
1017
- cfg .WSOrigins = splitAndTrim (ctx .String (WSAllowedOriginsFlag .Name ))
1018
- }
1019
- if ctx .IsSet (WSApiFlag .Name ) {
1020
- cfg .WSModules = splitAndTrim (ctx .String (WSApiFlag .Name ))
1021
- }
1012
+ cfg .WSOrigins = splitAndTrim (ctx .String (WSAllowedOriginsFlag .Name ))
1013
+ cfg .WSModules = splitAndTrim (ctx .String (WSApiFlag .Name ))
1022
1014
}
1023
1015
1024
1016
// setIPC creates an IPC path configuration from the set command line flags,
@@ -1098,6 +1090,8 @@ func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ethconfig.Config
1098
1090
Fatalf ("Option %q: %v" , MinerEtherbaseFlag .Name , err )
1099
1091
}
1100
1092
cfg .Etherbase = account .Address
1093
+ } else {
1094
+ cfg .Etherbase = common .HexToAddress (ctx .String (MinerEtherbaseFlag .Name ))
1101
1095
}
1102
1096
}
1103
1097
@@ -1482,9 +1476,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
1482
1476
if ctx .IsSet (MinerExtraDataFlag .Name ) {
1483
1477
cfg .ExtraData = []byte (ctx .String (MinerExtraDataFlag .Name ))
1484
1478
}
1485
- if ctx .IsSet (MinerGasPriceFlag .Name ) {
1486
- cfg .GasPrice = flags .GlobalBig (ctx , MinerGasPriceFlag .Name )
1487
- }
1479
+ cfg .GasPrice = flags .GlobalBig (ctx , MinerGasPriceFlag .Name )
1488
1480
if ctx .IsSet (CacheLogSizeFlag .Name ) {
1489
1481
cfg .FilterLogCacheSize = ctx .Int (CacheLogSizeFlag .Name )
1490
1482
}
0 commit comments