diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 848a5d811a..ecc8f0c60e 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -628,6 +628,9 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.GlobalBool(RinkebyFlag.Name) { return filepath.Join(path, "rinkeby") } + if ctx.GlobalBool(GoerliFlag.Name) { + return filepath.Join(path, "goerli") + } return path } Fatalf("Cannot determine default data directory, please set manually (--datadir)") @@ -682,6 +685,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.TestnetBootnodes case ctx.GlobalBool(RinkebyFlag.Name): urls = params.RinkebyBootnodes + case ctx.GlobalBool(GoerliFLag.Name): + urls = params.GoerliBootnodes case cfg.BootstrapNodes != nil: return // already set, don't apply defaults. } @@ -1346,6 +1351,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { genesis = core.DefaultRinkebyGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): Fatalf("Developer chains are ephemeral") + case ctx.GlobalBool(GoerliFLag.Name): + genesis = core.DefaultGoerliGenesisBlock() } return genesis } diff --git a/core/genesis.go b/core/genesis.go index 9190e2ba22..4dc58f57a7 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -333,6 +333,19 @@ func DefaultRinkebyGenesisBlock() *Genesis { } } +// TODO: @priom: Define the correct values of each field +// DefaultGoerliGenesisBlock returns the Goerli network genesis block +func DefaultGoerliGenesisBlock() *Genesis { + return &Genesis { + Config: params.GoerliChainConfig, + Timestamp: , + ExtraData: hexutil.MustDecode(""), + GasLimit: , + Difficulty: big.NewInt(), + Alloc: decodePrealloc(goerliAllocData), + } +} + // DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must // be seeded with the func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis { diff --git a/params/bootnodes.go b/params/bootnodes.go index c7190ae670..b36ff2f83c 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -47,6 +47,11 @@ var RinkebyBootnodes = []string{ "enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA } +// Goerli testnet BootNodes +var GoerliBootnodes = []string { + "", +} + // DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the // experimental RLPx v5 topic-discovery network. var DiscoveryV5Bootnodes = []string{ diff --git a/params/config.go b/params/config.go index 629720550a..f02dfacfce 100644 --- a/params/config.go +++ b/params/config.go @@ -79,6 +79,22 @@ var ( }, } + // GoerliChainConfig contains chain parameters for Goerli Testnet node + GoerliChainConfig = &ChainConfig{ + ChainID: big.NewInt(4), + HomesteadBlock: big.NewInt(1), + DAOForkBlock: nil, + DAOForkSupport: true, + EIP150Block: big.NewInt(2), + EIP150Hash: common.HexToHash(""), + EIP155Block: big.NewInt(3), + EIP158Block: big.NewInt(3), + ByzantiumBlock: big.NewInt(), + ConstantinopleBlock: nil, + + + } + // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Ethash consensus. // @@ -123,6 +139,7 @@ type ChainConfig struct { // Various consensus engines Ethash *EthashConfig `json:"ethash,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"` + Aura *AuraConfig } // EthashConfig is the consensus engine configs for proof-of-work based sealing.