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 | |
parent | 5832a21db625bfa98a3b7909bb6996dd1fd2e4d3 (diff) | |
download | go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.gz go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.bz2 go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.lz go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.xz go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.tar.zst go-tangerine-27d1254cd5459b69217b4b7877493a008e9dbe3e.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 a2597c098..dcd46e796 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 910b6498b..093115b93 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 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") } |