diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-02-25 19:08:17 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | f3658a11e0a72da8da4c716cbcecc69d79f396ce (patch) | |
tree | bec0b457f6305f58473974bb855bf69519a873e3 /cmd | |
parent | d779f5aead9e91b97c8d05136ddb7a6bd84f4276 (diff) | |
download | dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.gz dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.bz2 dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.lz dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.xz dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.tar.zst dexon-f3658a11e0a72da8da4c716cbcecc69d79f396ce.zip |
params: add Yilan network (#207)
* Add Yilan network
* Fixup: remove dummy log
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gdex/consolecmd.go | 2 | ||||
-rw-r--r-- | cmd/gdex/main.go | 1 | ||||
-rw-r--r-- | cmd/gdex/usage.go | 1 | ||||
-rw-r--r-- | cmd/utils/flags.go | 24 |
4 files changed, 26 insertions, 2 deletions
diff --git a/cmd/gdex/consolecmd.go b/cmd/gdex/consolecmd.go index 8b9d58dad..bc447fefd 100644 --- a/cmd/gdex/consolecmd.go +++ b/cmd/gdex/consolecmd.go @@ -126,6 +126,8 @@ func remoteConsole(ctx *cli.Context) error { path = filepath.Join(path, "testnet") } else if ctx.GlobalBool(utils.TaipeiFlag.Name) { path = filepath.Join(path, "taipei") + } else if ctx.GlobalBool(utils.YilanFlag.Name) { + path = filepath.Join(path, "yilan") } } endpoint = fmt.Sprintf("%s/gdex.ipc", path) diff --git a/cmd/gdex/main.go b/cmd/gdex/main.go index ca2f55d3c..46c48d254 100644 --- a/cmd/gdex/main.go +++ b/cmd/gdex/main.go @@ -123,6 +123,7 @@ var ( utils.DeveloperPeriodFlag, utils.TestnetFlag, utils.TaipeiFlag, + utils.YilanFlag, utils.VMEnableDebugFlag, utils.NetworkIdFlag, utils.ConstantinopleOverrideFlag, diff --git a/cmd/gdex/usage.go b/cmd/gdex/usage.go index 6427fd870..2a644e594 100644 --- a/cmd/gdex/usage.go +++ b/cmd/gdex/usage.go @@ -74,6 +74,7 @@ var AppHelpFlagGroups = []flagGroup{ utils.NetworkIdFlag, utils.TestnetFlag, utils.TaipeiFlag, + utils.YilanFlag, utils.SyncModeFlag, utils.GCModeFlag, utils.EthStatsURLFlag, 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") } |