diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 3cb9a96411c6fa016bd0fa87cdb41530c6150c6e..918d643078021380bd47a3bfeaafc8cbd42d3909 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1204,6 +1204,10 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Override any default configs for hard coded networks. chain := ctx.GlobalString(ChainFlag.Name) switch chain { + case "": + if cfg.NetworkID == 1 { + SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) + } case params.MainnetChainName: if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkID = 1 @@ -1268,9 +1272,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.Miner.GasPrice = big.NewInt(1) } default: - if cfg.NetworkID == 1 { - SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) - } + Fatalf("Chain name is not recognized: %s", chain) } } diff --git a/core/allocs/turbomine.json b/core/allocs/turbomine.json index c3cadf9136ac1153bfaca6c0e3330d9e9b4ae8f4..96e08ea54d38c680940b4cd371b3f118f5dff4fb 100644 --- a/core/allocs/turbomine.json +++ b/core/allocs/turbomine.json @@ -766,9 +766,6 @@ }, "0x00000000000000000000000000000000000000ff": { "balance": "0x0" - }, - "0x874b54a8bd152966d63f706bae1ffeb0411921e5": { - "balance": "0xc9f2c9cd04674edea40000000" } } \ No newline at end of file diff --git a/core/genesis.go b/core/genesis.go index c3c7e5bf5c0fdec51b511ba53e82c9aa0ceccca0..5520798190c5e478a6949d58dace4dc4ab5db59e 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -171,16 +171,19 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override return nil, common.Hash{}, storedErr } if overwrite || (stored == common.Hash{}) { + custom := true if genesis == nil { log.Info("Writing default main-net genesis block") genesis = DefaultGenesisBlock() - } else { - log.Info("Writing custom genesis block") + custom = false } block, _, err1 := genesis.Commit(db, history) if err1 != nil { return genesis.Config, common.Hash{}, err1 } + if custom { + log.Info("Writing custom genesis block", "hash", block.Hash().String()) + } return genesis.Config, block.Hash(), nil } // Check whether the genesis block is already written. @@ -251,6 +254,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { return params.GoerliChainConfig case ghash == params.YoloV3GenesisHash: return params.YoloV3ChainConfig + case ghash == params.TurboMineGenesisHash: + return params.TurboMineChainConfig default: return params.AllEthashProtocolChanges } @@ -486,10 +491,10 @@ func DefaultYoloV3GenesisBlock() *Genesis { func DefaultTurboMineGenesisBlock() *Genesis { return &Genesis{ - Config: params.RopstenChainConfig, + Config: params.TurboMineChainConfig, Nonce: 66, ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"), - GasLimit: 100000000, + GasLimit: 1000000000, Difficulty: big.NewInt(1048576), Alloc: readPrealloc("allocs/turbomine.json"), } diff --git a/params/config.go b/params/config.go index 61629fc94c72e997cf7fca70e5ba272487de8f84..1149b05d80512f470fb968c534649d9ee5748a28 100644 --- a/params/config.go +++ b/params/config.go @@ -37,11 +37,12 @@ const ( // Genesis hashes to enforce below configs on. var ( - MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") - RopstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") - RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") - GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") - YoloV3GenesisHash = common.HexToHash("0x374f07cc7fa7c251fc5f36849f574b43db43600526410349efdca2bcea14101a") + MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") + RopstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") + RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") + GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") + YoloV3GenesisHash = common.HexToHash("0x374f07cc7fa7c251fc5f36849f574b43db43600526410349efdca2bcea14101a") + TurboMineGenesisHash = common.HexToHash("0xfecd5c85712e36f30f09ba3a42386b42c46b5ba5395a4246b952e655f9aa0f58") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of diff --git a/turbo/node/node.go b/turbo/node/node.go index 1733a0e44624058b436e56b97f5bb76ee99119ac..778ffb231b6fb32ee6af958f78f57f34f6838cfd 100644 --- a/turbo/node/node.go +++ b/turbo/node/node.go @@ -139,10 +139,12 @@ func prepare(ctx *cli.Context) { case params.DevChainName: log.Info("Starting Turbo-Geth in ephemeral dev mode...") - default: + case "", params.MainnetChainName: if !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) { log.Info("Starting Turbo-Geth on Ethereum mainnet...") } + default: + log.Info("Starting Turbo-Geth on", "devnet", chain) } // If we're a full node on mainnet without --cache specified, bump default cache allowance if !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {