diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-02-25 19:08:17 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:57 +0800 |
commit | 27d1254cd5459b69217b4b7877493a008e9dbe3e (patch) | |
tree | 125e8c41dd2c5a3fbde1d968d111c2f71dcec10e /cmd/utils/flags.go | |
parent | 5832a21db625bfa98a3b7909bb6996dd1fd2e4d3 (diff) | |
download | dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.gz dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.bz2 dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.lz dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.xz dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.zst dexon-27d1254cd5459b69217b4b7877493a008e9dbe3e.zip |
params: add Yilan network (#207)
* Add Yilan network
* Fixup: remove dummy log
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r-- | cmd/utils/flags.go | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d26bbb065..c6d60d0bb 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -130,7 +130,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{ @@ -141,6 +141,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", @@ -673,6 +677,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)") @@ -727,6 +734,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. } @@ -754,6 +763,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. } @@ -1030,6 +1041,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") } } @@ -1186,7 +1199,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) @@ -1256,6 +1269,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 @@ -1428,6 +1446,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") } |