aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-10 20:29:40 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-10 23:37:41 +0800
commita32c51effda8682b292d04863aae7811f78abf7e (patch)
treed721822cc10c929d5a2def0865c366e085ef99be /cmd/utils/flags.go
parent5a810758dbe75dce9537d464ac0e5b5385b0e78f (diff)
downloaddexon-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.go9
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)
}