Skip to content

Commit 5d4463a

Browse files
committed
cmd/utils: change default value of some flags to simplify sync
1 parent 47543e8 commit 5d4463a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

cmd/utils/flags.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -350,21 +350,21 @@ var (
350350
Name: "miner-gaslimit",
351351
Aliases: []string{"targetgaslimit"},
352352
Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine",
353-
Value: params.XDCGenesisGasLimit,
353+
Value: 50000000,
354354
Category: flags.MinerCategory,
355355
}
356356
MinerGasPriceFlag = &flags.BigFlag{
357357
Name: "miner-gasprice",
358358
Aliases: []string{"gasprice"},
359359
Usage: "Minimal gas price to accept for mining a transactions",
360-
Value: ethconfig.Defaults.GasPrice,
360+
Value: big.NewInt(1),
361361
Category: flags.MinerCategory,
362362
}
363363
MinerEtherbaseFlag = &cli.StringFlag{
364364
Name: "miner-etherbase",
365365
Aliases: []string{"etherbase"},
366366
Usage: "Public address for block mining rewards (default = first account created)",
367-
Value: "0",
367+
Value: "0x000000000000000000000000000000000000abcd",
368368
Category: flags.MinerCategory,
369369
}
370370
MinerExtraDataFlag = &cli.StringFlag{
@@ -442,13 +442,14 @@ var (
442442
Name: "http",
443443
Aliases: []string{"rpc"},
444444
Usage: "Enable the HTTP-RPC server",
445+
Value: true,
445446
Category: flags.APICategory,
446447
}
447448
HTTPListenAddrFlag = &cli.StringFlag{
448449
Name: "http-addr",
449450
Aliases: []string{"rpcaddr"},
450451
Usage: "HTTP-RPC server listening interface",
451-
Value: node.DefaultHTTPHost,
452+
Value: "0.0.0.0",
452453
Category: flags.APICategory,
453454
}
454455
HTTPPortFlag = &cli.IntFlag{
@@ -462,21 +463,21 @@ var (
462463
Name: "http-corsdomain",
463464
Aliases: []string{"rpccorsdomain"},
464465
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
465-
Value: "",
466+
Value: "*",
466467
Category: flags.APICategory,
467468
}
468469
HTTPVirtualHostsFlag = &cli.StringFlag{
469470
Name: "http-vhosts",
470471
Aliases: []string{"rpcvhosts"},
471472
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
472-
Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
473+
Value: "*",
473474
Category: flags.APICategory,
474475
}
475476
HTTPApiFlag = &cli.StringFlag{
476477
Name: "http-api",
477478
Aliases: []string{"rpcapi"},
478479
Usage: "API's offered over the HTTP-RPC interface",
479-
Value: "",
480+
Value: "eth,debug,net,txpool,personal,web3,XDPoS",
480481
Category: flags.APICategory,
481482
}
482483
HTTPReadTimeoutFlag = &cli.DurationFlag{
@@ -503,13 +504,14 @@ var (
503504
WSEnabledFlag = &cli.BoolFlag{
504505
Name: "ws",
505506
Usage: "Enable the WS-RPC server",
507+
Value: true,
506508
Category: flags.APICategory,
507509
}
508510
WSListenAddrFlag = &cli.StringFlag{
509511
Name: "ws-addr",
510512
Aliases: []string{"wsaddr"},
511513
Usage: "WS-RPC server listening interface",
512-
Value: node.DefaultWSHost,
514+
Value: "0.0.0.0",
513515
Category: flags.APICategory,
514516
}
515517
WSPortFlag = &cli.IntFlag{
@@ -523,14 +525,14 @@ var (
523525
Name: "ws-api",
524526
Aliases: []string{"wsapi"},
525527
Usage: "API's offered over the WS-RPC interface",
526-
Value: "",
528+
Value: "eth,debug,net,txpool,personal,web3,XDPoS",
527529
Category: flags.APICategory,
528530
}
529531
WSAllowedOriginsFlag = &cli.StringFlag{
530532
Name: "ws-origins",
531533
Aliases: []string{"wsorigins"},
532534
Usage: "Origins from which to accept websockets requests",
533-
Value: "",
535+
Value: "*",
534536
Category: flags.APICategory,
535537
}
536538
ExecFlag = &cli.StringFlag{
@@ -1004,9 +1006,7 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
10041006
if ctx.IsSet(HTTPCORSDomainFlag.Name) {
10051007
cfg.HTTPCors = splitAndTrim(ctx.String(HTTPCORSDomainFlag.Name))
10061008
}
1007-
if ctx.IsSet(HTTPApiFlag.Name) {
1008-
cfg.HTTPModules = splitAndTrim(ctx.String(HTTPApiFlag.Name))
1009-
}
1009+
cfg.HTTPModules = splitAndTrim(ctx.String(HTTPApiFlag.Name))
10101010
if ctx.IsSet(HTTPVirtualHostsFlag.Name) {
10111011
cfg.HTTPVirtualHosts = splitAndTrim(ctx.String(HTTPVirtualHostsFlag.Name))
10121012
}
@@ -1028,9 +1028,7 @@ func setWS(ctx *cli.Context, cfg *node.Config) {
10281028
if ctx.IsSet(WSAllowedOriginsFlag.Name) {
10291029
cfg.WSOrigins = splitAndTrim(ctx.String(WSAllowedOriginsFlag.Name))
10301030
}
1031-
if ctx.IsSet(WSApiFlag.Name) {
1032-
cfg.WSModules = splitAndTrim(ctx.String(WSApiFlag.Name))
1033-
}
1031+
cfg.WSModules = splitAndTrim(ctx.String(WSApiFlag.Name))
10341032
}
10351033

10361034
// setIPC creates an IPC path configuration from the set command line flags,
@@ -1110,6 +1108,8 @@ func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ethconfig.Config
11101108
Fatalf("Option %q: %v", MinerEtherbaseFlag.Name, err)
11111109
}
11121110
cfg.Etherbase = account.Address
1111+
} else {
1112+
cfg.Etherbase = common.HexToAddress("0x000000000000000000000000000000000000abcd")
11131113
}
11141114
}
11151115

0 commit comments

Comments
 (0)