@@ -141,6 +141,10 @@ var (
141141 Name : "rinkeby" ,
142142 Usage : "Rinkeby network: pre-configured proof-of-authority test network" ,
143143 }
144+ GoerliFlag = cli.BoolFlag {
145+ Name : "goerli" ,
146+ Usage : "Görli network: pre-configured proof-of-authority test network" ,
147+ }
144148 ConstantinopleOverrideFlag = cli.Uint64Flag {
145149 Name : "override.constantinople" ,
146150 Usage : "Manually specify constantinople fork-block, overriding the bundled setting" ,
@@ -692,6 +696,9 @@ func MakeDataDir(ctx *cli.Context) string {
692696 if ctx .GlobalBool (RinkebyFlag .Name ) {
693697 return filepath .Join (path , "rinkeby" )
694698 }
699+ if ctx .GlobalBool (GoerliFlag .Name ) {
700+ return filepath .Join (path , "goerli" )
701+ }
695702 return path
696703 }
697704 Fatalf ("Cannot determine default data directory, please set manually (--datadir)" )
@@ -746,6 +753,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
746753 urls = params .TestnetBootnodes
747754 case ctx .GlobalBool (RinkebyFlag .Name ):
748755 urls = params .RinkebyBootnodes
756+ case ctx .GlobalBool (GoerliFlag .Name ):
757+ urls = params .GoerliBootnodes
749758 case cfg .BootstrapNodes != nil :
750759 return // already set, don't apply defaults.
751760 }
@@ -775,6 +784,8 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
775784 }
776785 case ctx .GlobalBool (RinkebyFlag .Name ):
777786 urls = params .RinkebyBootnodes
787+ case ctx .GlobalBool (GoerliFlag .Name ):
788+ urls = params .GoerliBootnodes
778789 case cfg .BootstrapNodesV5 != nil :
779790 return // already set, don't apply defaults.
780791 }
@@ -1080,7 +1091,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
10801091 setGraphQL (ctx , cfg )
10811092 setWS (ctx , cfg )
10821093 setNodeUserIdent (ctx , cfg )
1083-
10841094 setDataDir (ctx , cfg )
10851095
10861096 if ctx .GlobalIsSet (KeyStoreDirFlag .Name ) {
@@ -1104,6 +1114,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
11041114 cfg .DataDir = filepath .Join (node .DefaultDataDir (), "testnet" )
11051115 case ctx .GlobalBool (RinkebyFlag .Name ):
11061116 cfg .DataDir = filepath .Join (node .DefaultDataDir (), "rinkeby" )
1117+ case ctx .GlobalBool (GoerliFlag .Name ):
1118+ cfg .DataDir = filepath .Join (node .DefaultDataDir (), "goerli" )
11071119 }
11081120}
11091121
@@ -1260,7 +1272,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
12601272// SetEthConfig applies eth-related command line flags to the config.
12611273func SetEthConfig (ctx * cli.Context , stack * node.Node , cfg * eth.Config ) {
12621274 // Avoid conflicting network flags
1263- checkExclusive (ctx , DeveloperFlag , TestnetFlag , RinkebyFlag )
1275+ checkExclusive (ctx , DeveloperFlag , TestnetFlag , RinkebyFlag , GoerliFlag )
12641276 checkExclusive (ctx , LightServFlag , SyncModeFlag , "light" )
12651277
12661278 ks := stack .AccountManager ().Backends (keystore .KeyStoreType )[0 ].(* keystore.KeyStore )
@@ -1359,6 +1371,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
13591371 cfg .NetworkId = 4
13601372 }
13611373 cfg .Genesis = core .DefaultRinkebyGenesisBlock ()
1374+ case ctx .GlobalBool (GoerliFlag .Name ):
1375+ if ! ctx .GlobalIsSet (NetworkIdFlag .Name ) {
1376+ cfg .NetworkId = 5
1377+ }
1378+ cfg .Genesis = core .DefaultGoerliGenesisBlock ()
13621379 case ctx .GlobalBool (DeveloperFlag .Name ):
13631380 if ! ctx .GlobalIsSet (NetworkIdFlag .Name ) {
13641381 cfg .NetworkId = 1337
@@ -1516,6 +1533,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
15161533 genesis = core .DefaultTestnetGenesisBlock ()
15171534 case ctx .GlobalBool (RinkebyFlag .Name ):
15181535 genesis = core .DefaultRinkebyGenesisBlock ()
1536+ case ctx .GlobalBool (GoerliFlag .Name ):
1537+ genesis = core .DefaultGoerliGenesisBlock ()
15191538 case ctx .GlobalBool (DeveloperFlag .Name ):
15201539 Fatalf ("Developer chains are ephemeral" )
15211540 }
0 commit comments