aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index f55c7eac2..53d5e75cb 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -129,7 +129,7 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
- Usage: "Network identifier (integer, 237=Mainnet, 238=Testnet, 239=Taipei) (default: 237)",
+ Usage: "Network identifier (integer, 237=Mainnet, 238=Testnet, 239=Taipei, 240=Yilan) (default: 237)",
Value: eth.DefaultConfig.NetworkId,
}
TestnetFlag = cli.BoolFlag{
@@ -140,6 +140,10 @@ var (
Name: "taipei",
Usage: "Taipei network: tapei public testnet",
}
+ YilanFlag = cli.BoolFlag{
+ Name: "yilan",
+ Usage: "Yilan network: yilan public testnet",
+ }
ConstantinopleOverrideFlag = cli.Uint64Flag{
Name: "override.constantinople",
Usage: "Manually specify constantinople fork-block, overriding the bundled setting",
@@ -668,6 +672,9 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.GlobalBool(TaipeiFlag.Name) {
return filepath.Join(path, "taipei")
}
+ if ctx.GlobalBool(YilanFlag.Name) {
+ return filepath.Join(path, "yilan")
+ }
return path
}
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
@@ -722,6 +729,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.TestnetBootnodes
case ctx.GlobalBool(TaipeiFlag.Name):
urls = params.TaipeiBootnodes
+ case ctx.GlobalBool(YilanFlag.Name):
+ urls = params.YilanBootnodes
case cfg.BootstrapNodes != nil:
return // already set, don't apply defaults.
}
@@ -749,6 +758,8 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
}
case ctx.GlobalBool(TaipeiFlag.Name):
urls = params.TaipeiBootnodes
+ case ctx.GlobalBool(YilanFlag.Name):
+ urls = params.YilanBootnodes
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
}
@@ -1025,6 +1036,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet")
case ctx.GlobalBool(TaipeiFlag.Name):
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "taipei")
+ case ctx.GlobalBool(YilanFlag.Name):
+ cfg.DataDir = filepath.Join(node.DefaultDataDir(), "yilan")
}
}
@@ -1181,7 +1194,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
// SetDexConfig applies eth-related command line flags to the config.
func SetDexConfig(ctx *cli.Context, stack *node.Node, cfg *dex.Config) {
// Avoid conflicting network flags
- checkExclusive(ctx, DeveloperFlag, TestnetFlag, TaipeiFlag)
+ checkExclusive(ctx, DeveloperFlag, TestnetFlag, TaipeiFlag, YilanFlag)
checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")
ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
@@ -1248,6 +1261,11 @@ func SetDexConfig(ctx *cli.Context, stack *node.Node, cfg *dex.Config) {
cfg.NetworkId = 239
}
cfg.Genesis = core.DefaultTaipeiGenesisBlock()
+ case ctx.GlobalBool(YilanFlag.Name):
+ if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
+ cfg.NetworkId = 240
+ }
+ cfg.Genesis = core.DefaultYilanGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
@@ -1420,6 +1438,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultTestnetGenesisBlock()
case ctx.GlobalBool(TaipeiFlag.Name):
genesis = core.DefaultTaipeiGenesisBlock()
+ case ctx.GlobalBool(YilanFlag.Name):
+ genesis = core.DefaultYilanGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
Fatalf("Developer chains are ephemeral")
}