From 2cf98eb93463b07d11ff4570684217927e945b53 Mon Sep 17 00:00:00 2001 From: Priom Chowdhury Date: Sat, 8 Sep 2018 11:05:48 -0400 Subject: [PATCH] Priom/gorli cli flag (#17) * go modules added; preparing to write aura consensus * adding goerli flag * goerli flag added * adding configs * core/vm: Hide read only flag from Interpreter interface (#17461) (#6) Makes Interface interface a bit more stateless and abstract. Obviously this change is dictated by EVMC design. The EVMC tries to keep the responsibility for EVM features totally inside the VMs, if feasible. This makes VM "stateless" because VM does not need to pass any information between executions, all information is included in parameters of the execute function. * configuring genesis * removing duplicate imports * adding configs for aura api * configuring goerli cli flag * flag function fix * typo fix --- cmd/geth/chaincmd.go | 1 + cmd/geth/usage.go | 1 + cmd/utils/flags.go | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 87548865be61..44a9f5641dde 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -136,6 +136,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`, utils.FakePoWFlag, utils.TestnetFlag, utils.RinkebyFlag, + utils.GoerliFlag, }, Category: "BLOCKCHAIN COMMANDS", Description: ` diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index a674eca4f111..d58f536d07c0 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -74,6 +74,7 @@ var AppHelpFlagGroups = []flagGroup{ utils.NetworkIdFlag, utils.TestnetFlag, utils.RinkebyFlag, + utils.GoerliFlag, utils.SyncModeFlag, utils.GCModeFlag, utils.EthStatsURLFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 14d53a7b3b6d..d871d1a92e05 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -34,6 +34,7 @@ import ( "github.com/ethereum/go-ethereum/common/fdlimit" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/consensus/aura" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" @@ -144,7 +145,7 @@ var ( Name: "dev", Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled", } - GoerliFLag = cli.BoolFlag{ + GoerliFlag = cli.BoolFlag{ Name: "goerli", Usage: "Goerli network: pre-configured proof-of-authority test network", } @@ -684,7 +685,7 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.TestnetBootnodes case ctx.GlobalBool(RinkebyFlag.Name): urls = params.RinkebyBootnodes - case ctx.GlobalBool(GoerliFLag.Name): + case ctx.GlobalBool(GoerliFlag.Name): urls = params.GoerliBootnodes case cfg.BootstrapNodes != nil: return // already set, don't apply defaults. @@ -1350,7 +1351,7 @@ 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): + case ctx.GlobalBool(GoerliFlag.Name): genesis = core.DefaultGoerliGenesisBlock() } return genesis @@ -1368,6 +1369,8 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai var engine consensus.Engine if config.Clique != nil { engine = clique.New(config.Clique, chainDb) + } else if config.Aura != nil { + engine = aura.New(config.Aura, chainDb) } else { engine = ethash.NewFaker() if !ctx.GlobalBool(FakePoWFlag.Name) {