|
|
|
@ -136,7 +136,7 @@ var ( |
|
|
|
|
} |
|
|
|
|
NetworkIdFlag = &cli.Uint64Flag{ |
|
|
|
|
Name: "networkid", |
|
|
|
|
Usage: "Explicitly set network id (integer)(For testnets: use --goerli, --sepolia instead)", |
|
|
|
|
Usage: "Explicitly set network id (integer)(For testnets: use --goerli, --sepolia, --holesky instead)", |
|
|
|
|
Value: ethconfig.Defaults.NetworkId, |
|
|
|
|
Category: flags.EthCategory, |
|
|
|
|
} |
|
|
|
@ -155,7 +155,11 @@ var ( |
|
|
|
|
Usage: "Sepolia network: pre-configured proof-of-work test network", |
|
|
|
|
Category: flags.EthCategory, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HoleskyFlag = &cli.BoolFlag{ |
|
|
|
|
Name: "holesky", |
|
|
|
|
Usage: "Holesky network: pre-configured proof-of-stake test network", |
|
|
|
|
Category: flags.EthCategory, |
|
|
|
|
} |
|
|
|
|
// Dev mode
|
|
|
|
|
DeveloperFlag = &cli.BoolFlag{ |
|
|
|
|
Name: "dev", |
|
|
|
@ -952,6 +956,7 @@ var ( |
|
|
|
|
TestnetFlags = []cli.Flag{ |
|
|
|
|
GoerliFlag, |
|
|
|
|
SepoliaFlag, |
|
|
|
|
HoleskyFlag, |
|
|
|
|
} |
|
|
|
|
// NetworkFlags is the flag group of all built-in supported networks.
|
|
|
|
|
NetworkFlags = append([]cli.Flag{MainnetFlag}, TestnetFlags...) |
|
|
|
@ -982,6 +987,9 @@ func MakeDataDir(ctx *cli.Context) string { |
|
|
|
|
if ctx.Bool(SepoliaFlag.Name) { |
|
|
|
|
return filepath.Join(path, "sepolia") |
|
|
|
|
} |
|
|
|
|
if ctx.Bool(HoleskyFlag.Name) { |
|
|
|
|
return filepath.Join(path, "holesky") |
|
|
|
|
} |
|
|
|
|
return path |
|
|
|
|
} |
|
|
|
|
Fatalf("Cannot determine default data directory, please set manually (--datadir)") |
|
|
|
@ -1028,6 +1036,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { |
|
|
|
|
switch { |
|
|
|
|
case ctx.IsSet(BootnodesFlag.Name): |
|
|
|
|
urls = SplitAndTrim(ctx.String(BootnodesFlag.Name)) |
|
|
|
|
case ctx.Bool(HoleskyFlag.Name): |
|
|
|
|
urls = params.HoleskyBootnodes |
|
|
|
|
case ctx.Bool(SepoliaFlag.Name): |
|
|
|
|
urls = params.SepoliaBootnodes |
|
|
|
|
case ctx.Bool(GoerliFlag.Name): |
|
|
|
@ -1480,6 +1490,8 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) { |
|
|
|
|
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli") |
|
|
|
|
case ctx.Bool(SepoliaFlag.Name) && cfg.DataDir == node.DefaultDataDir(): |
|
|
|
|
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia") |
|
|
|
|
case ctx.Bool(HoleskyFlag.Name) && cfg.DataDir == node.DefaultDataDir(): |
|
|
|
|
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "holesky") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1636,7 +1648,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) { |
|
|
|
|
// SetEthConfig applies eth-related command line flags to the config.
|
|
|
|
|
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { |
|
|
|
|
// Avoid conflicting network flags
|
|
|
|
|
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, GoerliFlag, SepoliaFlag) |
|
|
|
|
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag) |
|
|
|
|
CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") |
|
|
|
|
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
|
|
|
|
|
|
|
|
|
@ -1789,6 +1801,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { |
|
|
|
|
} |
|
|
|
|
cfg.Genesis = core.DefaultGenesisBlock() |
|
|
|
|
SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) |
|
|
|
|
case ctx.Bool(HoleskyFlag.Name): |
|
|
|
|
if !ctx.IsSet(NetworkIdFlag.Name) { |
|
|
|
|
cfg.NetworkId = 17000 |
|
|
|
|
} |
|
|
|
|
cfg.Genesis = core.DefaultHoleskyGenesisBlock() |
|
|
|
|
SetDNSDiscoveryDefaults(cfg, params.HoleskyGenesisHash) |
|
|
|
|
case ctx.Bool(SepoliaFlag.Name): |
|
|
|
|
if !ctx.IsSet(NetworkIdFlag.Name) { |
|
|
|
|
cfg.NetworkId = 11155111 |
|
|
|
@ -2121,6 +2139,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { |
|
|
|
|
switch { |
|
|
|
|
case ctx.Bool(MainnetFlag.Name): |
|
|
|
|
genesis = core.DefaultGenesisBlock() |
|
|
|
|
case ctx.Bool(HoleskyFlag.Name): |
|
|
|
|
genesis = core.DefaultHoleskyGenesisBlock() |
|
|
|
|
case ctx.Bool(SepoliaFlag.Name): |
|
|
|
|
genesis = core.DefaultSepoliaGenesisBlock() |
|
|
|
|
case ctx.Bool(GoerliFlag.Name): |
|
|
|
|