aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index d319055b1..ab7eaf023 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -93,6 +93,11 @@ var (
Usage: "Blockchain version (integer)",
Value: core.BlockChainVersion,
}
+ GenesisNonceFlag = cli.IntFlag{
+ Name: "genesisnonce",
+ Usage: "Sets the genesis nonce",
+ Value: 42,
+ }
IdentityFlag = cli.StringFlag{
Name: "identity",
Usage: "Custom node name",
@@ -294,6 +299,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
Name: common.MakeName(clientID, version),
DataDir: ctx.GlobalString(DataDirFlag.Name),
ProtocolVersion: ctx.GlobalInt(ProtocolVersionFlag.Name),
+ GenesisNonce: ctx.GlobalInt(GenesisNonceFlag.Name),
BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name),
SkipBcVersionCheck: false,
NetworkId: ctx.GlobalInt(NetworkIdFlag.Name),
@@ -344,9 +350,13 @@ func MakeChain(ctx *cli.Context) (chain *core.ChainManager, blockDB, stateDB, ex
eventMux := new(event.TypeMux)
pow := ethash.New()
- chain = core.NewChainManager(blockDB, stateDB, pow, eventMux)
- txpool := core.NewTxPool(eventMux, chain.State, chain.GasLimit)
- proc := core.NewBlockProcessor(stateDB, extraDB, pow, txpool, chain, eventMux)
+ genesis := core.GenesisBlock(uint64(ctx.GlobalInt(GenesisNonceFlag.Name)), blockDB)
+ chain, err = core.NewChainManager(genesis, blockDB, stateDB, pow, eventMux)
+ if err != nil {
+ Fatalf("Could not start chainmanager: %v", err)
+ }
+
+ proc := core.NewBlockProcessor(stateDB, extraDB, pow, chain, eventMux)
chain.SetProcessor(proc)
return chain, blockDB, stateDB, extraDB
}