diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-10 20:29:40 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-10 23:37:41 +0800 |
commit | a32c51effda8682b292d04863aae7811f78abf7e (patch) | |
tree | d721822cc10c929d5a2def0865c366e085ef99be /cmd/utils/flags.go | |
parent | 5a810758dbe75dce9537d464ac0e5b5385b0e78f (diff) | |
download | dexon-a32c51effda8682b292d04863aae7811f78abf7e.tar.gz dexon-a32c51effda8682b292d04863aae7811f78abf7e.tar.zst dexon-a32c51effda8682b292d04863aae7811f78abf7e.zip |
cmd, core, eth, common: genesis preparation
Implemented the --genesis flag thru which we can set a custom genesis
block, including the official Ethereum genesis block.
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r-- | cmd/utils/flags.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 903c97e71..73bdb935a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -114,6 +114,10 @@ var ( Usage: "Sets the genesis nonce", Value: 42, } + GenesisFileFlag = cli.StringFlag{ + Name: "genesis", + Usage: "Inserts/Overwrites the genesis block (json format)", + } IdentityFlag = cli.StringFlag{ Name: "identity", Usage: "Custom node name", @@ -378,6 +382,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { Name: common.MakeName(clientID, version), DataDir: ctx.GlobalString(DataDirFlag.Name), GenesisNonce: ctx.GlobalInt(GenesisNonceFlag.Name), + GenesisFile: ctx.GlobalString(GenesisFileFlag.Name), BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name), SkipBcVersionCheck: false, NetworkId: ctx.GlobalInt(NetworkIdFlag.Name), @@ -434,8 +439,8 @@ func MakeChain(ctx *cli.Context) (chain *core.ChainManager, blockDB, stateDB, ex eventMux := new(event.TypeMux) pow := ethash.New() - genesis := core.GenesisBlock(uint64(ctx.GlobalInt(GenesisNonceFlag.Name)), blockDB) - chain, err = core.NewChainManager(genesis, blockDB, stateDB, extraDB, pow, eventMux) + //genesis := core.GenesisBlock(uint64(ctx.GlobalInt(GenesisNonceFlag.Name)), blockDB) + chain, err = core.NewChainManager(blockDB, stateDB, extraDB, pow, eventMux) if err != nil { Fatalf("Could not start chainmanager: %v", err) } |