aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-26 13:54:28 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:19 +0800
commit06276babe273f248ba1177f2a7bc369d09c303dd (patch)
treee4f4bd4612acc0b693ef93bd8a8177cf982bb94b /cmd
parentafc6a417210dc43a5a38ece5302de6801785316f (diff)
downloadgo-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.tar
go-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.tar.gz
go-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.tar.bz2
go-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.tar.lz
go-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.tar.xz
go-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.tar.zst
go-tangerine-06276babe273f248ba1177f2a7bc369d09c303dd.zip
core: add Taipei testnet (#47)
Add a new testnet named Taipei.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gdex/consolecmd.go2
-rw-r--r--cmd/gdex/main.go1
-rw-r--r--cmd/gdex/usage.go3
-rw-r--r--cmd/utils/flags.go28
4 files changed, 29 insertions, 5 deletions
diff --git a/cmd/gdex/consolecmd.go b/cmd/gdex/consolecmd.go
index 9915e1ee0..8b9d58dad 100644
--- a/cmd/gdex/consolecmd.go
+++ b/cmd/gdex/consolecmd.go
@@ -124,6 +124,8 @@ func remoteConsole(ctx *cli.Context) error {
if path != "" {
if ctx.GlobalBool(utils.TestnetFlag.Name) {
path = filepath.Join(path, "testnet")
+ } else if ctx.GlobalBool(utils.TaipeiFlag.Name) {
+ path = filepath.Join(path, "taipei")
}
}
endpoint = fmt.Sprintf("%s/gdex.ipc", path)
diff --git a/cmd/gdex/main.go b/cmd/gdex/main.go
index 0fb94b89e..1ca7cd766 100644
--- a/cmd/gdex/main.go
+++ b/cmd/gdex/main.go
@@ -122,6 +122,7 @@ var (
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.TestnetFlag,
+ utils.TaipeiFlag,
utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
utils.ConstantinopleOverrideFlag,
diff --git a/cmd/gdex/usage.go b/cmd/gdex/usage.go
index 496e20ecf..d67817096 100644
--- a/cmd/gdex/usage.go
+++ b/cmd/gdex/usage.go
@@ -65,7 +65,7 @@ type flagGroup struct {
// AppHelpFlagGroups is the application flags, grouped by functionality.
var AppHelpFlagGroups = []flagGroup{
{
- Name: "ETHEREUM",
+ Name: "DEXON",
Flags: []cli.Flag{
configFileFlag,
utils.DataDirFlag,
@@ -73,6 +73,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.NoUSBFlag,
utils.NetworkIdFlag,
utils.TestnetFlag,
+ utils.TaipeiFlag,
utils.SyncModeFlag,
utils.GCModeFlag,
utils.EthStatsURLFlag,
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index fd5ea757d..03b0841b0 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -130,12 +130,16 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
- Usage: "Network identifier (integer, 237=Mainnet, 238=Testnet) (default: 237)",
+ Usage: "Network identifier (integer, 237=Mainnet, 238=Testnet, 239=Taipei) (default: 237)",
Value: eth.DefaultConfig.NetworkId,
}
TestnetFlag = cli.BoolFlag{
Name: "testnet",
- Usage: "Ropsten network: pre-configured proof-of-work test network",
+ Usage: "Taiwan network: default public testnet",
+ }
+ TaipeiFlag = cli.BoolFlag{
+ Name: "taipei",
+ Usage: "Taipei network: tapei public testnet",
}
ConstantinopleOverrideFlag = cli.Uint64Flag{
Name: "override.constantinople",
@@ -158,7 +162,7 @@ var (
Usage: "Document Root for HTTPClient file scheme",
Value: DirectoryString{homeDir()},
}
- defaultSyncMode = eth.DefaultConfig.SyncMode
+ defaultSyncMode = dex.DefaultConfig.SyncMode
SyncModeFlag = TextMarshalerFlag{
Name: "syncmode",
Usage: `Blockchain sync mode ("fast", "full", or "light")`,
@@ -650,6 +654,9 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.GlobalBool(TestnetFlag.Name) {
return filepath.Join(path, "testnet")
}
+ if ctx.GlobalBool(TaipeiFlag.Name) {
+ return filepath.Join(path, "taipei")
+ }
return path
}
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
@@ -702,6 +709,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
}
case ctx.GlobalBool(TestnetFlag.Name):
urls = params.TestnetBootnodes
+ case ctx.GlobalBool(TaipeiFlag.Name):
+ urls = params.TaipeiBootnodes
case cfg.BootstrapNodes != nil:
return // already set, don't apply defaults.
}
@@ -727,6 +736,8 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
} else {
urls = strings.Split(ctx.GlobalString(BootnodesFlag.Name), ",")
}
+ case ctx.GlobalBool(TaipeiFlag.Name):
+ urls = params.TaipeiBootnodes
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
}
@@ -1001,6 +1012,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = "" // unless explicitly requested, use memory databases
case ctx.GlobalBool(TestnetFlag.Name):
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet")
+ case ctx.GlobalBool(TaipeiFlag.Name):
+ cfg.DataDir = filepath.Join(node.DefaultDataDir(), "taipei")
}
}
@@ -1157,7 +1170,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)
+ checkExclusive(ctx, DeveloperFlag, TestnetFlag, TaipeiFlag)
checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")
ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
@@ -1222,6 +1235,11 @@ func SetDexConfig(ctx *cli.Context, stack *node.Node, cfg *dex.Config) {
cfg.NetworkId = 238
}
cfg.Genesis = core.DefaultTestnetGenesisBlock()
+ case ctx.GlobalBool(TaipeiFlag.Name):
+ if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
+ cfg.NetworkId = 239
+ }
+ cfg.Genesis = core.DefaultTaipeiGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
@@ -1375,6 +1393,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
switch {
case ctx.GlobalBool(TestnetFlag.Name):
genesis = core.DefaultTestnetGenesisBlock()
+ case ctx.GlobalBool(TaipeiFlag.Name):
+ genesis = core.DefaultTaipeiGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
Fatalf("Developer chains are ephemeral")
}