@@ -128,7 +128,7 @@ var (
128128 }
129129 NetworkIdFlag = cli.Uint64Flag {
130130 Name : "networkid" ,
131- Usage : "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)" ,
131+ Usage : "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby, 5=Ottoman )" ,
132132 Value : eth .DefaultConfig .NetworkId ,
133133 }
134134 TestnetFlag = cli.BoolFlag {
@@ -143,6 +143,10 @@ var (
143143 Name : "dev" ,
144144 Usage : "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled" ,
145145 }
146+ OttomanFlag = cli.BoolFlag {
147+ Name : "ottoman" ,
148+ Usage : "Ottoman network: pre-configured istanbul bft test network" ,
149+ }
146150 DeveloperPeriodFlag = cli.IntFlag {
147151 Name : "dev.period" ,
148152 Usage : "Block period to use in developer mode (0 = mine only if transaction pending)" ,
@@ -548,6 +552,9 @@ func MakeDataDir(ctx *cli.Context) string {
548552 if ctx .GlobalBool (RinkebyFlag .Name ) {
549553 return filepath .Join (path , "rinkeby" )
550554 }
555+ if ctx .GlobalBool (OttomanFlag .Name ) {
556+ return filepath .Join (path , "ottoman" )
557+ }
551558 return path
552559 }
553560 Fatalf ("Cannot determine default data directory, please set manually (--datadir)" )
@@ -602,6 +609,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
602609 urls = params .TestnetBootnodes
603610 case ctx .GlobalBool (RinkebyFlag .Name ):
604611 urls = params .RinkebyBootnodes
612+ case ctx .GlobalBool (OttomanFlag .Name ):
613+ urls = params .OttomanBootnodes
605614 case cfg .BootstrapNodes != nil :
606615 return // already set, don't apply defaults.
607616 }
@@ -870,6 +879,8 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
870879 cfg .DataDir = filepath .Join (node .DefaultDataDir (), "testnet" )
871880 case ctx .GlobalBool (RinkebyFlag .Name ):
872881 cfg .DataDir = filepath .Join (node .DefaultDataDir (), "rinkeby" )
882+ case ctx .GlobalBool (OttomanFlag .Name ):
883+ cfg .DataDir = filepath .Join (node .DefaultDataDir (), "ottoman" )
873884 }
874885
875886 if ctx .GlobalIsSet (KeyStoreDirFlag .Name ) {
@@ -1009,7 +1020,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
10091020// SetEthConfig applies eth-related command line flags to the config.
10101021func SetEthConfig (ctx * cli.Context , stack * node.Node , cfg * eth.Config ) {
10111022 // Avoid conflicting network flags
1012- checkExclusive (ctx , DeveloperFlag , TestnetFlag , RinkebyFlag )
1023+ checkExclusive (ctx , DeveloperFlag , TestnetFlag , RinkebyFlag , OttomanFlag )
10131024 checkExclusive (ctx , FastSyncFlag , LightModeFlag , SyncModeFlag )
10141025 checkExclusive (ctx , LightServFlag , LightModeFlag )
10151026 checkExclusive (ctx , LightServFlag , SyncModeFlag , "light" )
@@ -1096,6 +1107,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
10961107 if ! ctx .GlobalIsSet (GasPriceFlag .Name ) {
10971108 cfg .GasPrice = big .NewInt (1 )
10981109 }
1110+ case ctx .GlobalBool (OttomanFlag .Name ):
1111+ if ! ctx .GlobalIsSet (NetworkIdFlag .Name ) {
1112+ cfg .NetworkId = 5
1113+ }
1114+ cfg .Genesis = core .DefaultOttomanGenesisBlock ()
10991115 }
11001116 // TODO(fjl): move trie cache generations into config
11011117 if gen := ctx .GlobalInt (TrieCacheGenFlag .Name ); gen > 0 {
@@ -1198,6 +1214,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
11981214 genesis = core .DefaultRinkebyGenesisBlock ()
11991215 case ctx .GlobalBool (DeveloperFlag .Name ):
12001216 Fatalf ("Developer chains are ephemeral" )
1217+ case ctx .GlobalBool (OttomanFlag .Name ):
1218+ genesis = core .DefaultOttomanGenesisBlock ()
12011219 }
12021220 return genesis
12031221}
0 commit comments