From 85d795d9314ef80d667c17318342515ea4798dec Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Sat, 20 Oct 2018 17:01:15 +0800 Subject: Remove reference of Rinkeby and Goerli network. We do not need ethereum Rinkeby and Goerli network in our system, remove it. --- cmd/clef/README.md | 2 +- cmd/geth/chaincmd.go | 1 - cmd/geth/consolecmd.go | 2 -- cmd/geth/main.go | 2 -- cmd/geth/usage.go | 2 -- cmd/utils/flags.go | 46 +++------------------------------------ core/genesis.go | 26 +--------------------- core/genesis_alloc.go | 1 - mobile/params.go | 9 -------- params/bootnodes.go | 22 ------------------- params/config.go | 58 -------------------------------------------------- 11 files changed, 5 insertions(+), 166 deletions(-) diff --git a/cmd/clef/README.md b/cmd/clef/README.md index c9461be10..1eba03e51 100644 --- a/cmd/clef/README.md +++ b/cmd/clef/README.md @@ -31,7 +31,7 @@ GLOBAL OPTIONS: --loglevel value log level to emit to the screen (default: 4) --keystore value Directory for the keystore (default: "$HOME/.ethereum/keystore") --configdir value Directory for clef configuration (default: "$HOME/.clef") - --networkid value Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby) (default: 1) + --networkid value Network identifier (integer, 237=Mainnet, 238=Testnet) (default: 237) --lightkdf Reduce key-derivation RAM & CPU usage at some expense of KDF strength --nousb Disables monitoring for and managing USB hardware wallets --rpcaddr value HTTP-RPC server listening interface (default: "localhost") diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 9ef2ffddb..470bb791a 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -135,7 +135,6 @@ The export-preimages command export hash preimages to an RLP encoded stream`, utils.SyncModeFlag, utils.FakePoWFlag, utils.TestnetFlag, - utils.RinkebyFlag, }, Category: "BLOCKCHAIN COMMANDS", Description: ` diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 528ed30e3..339919c8d 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -124,8 +124,6 @@ func remoteConsole(ctx *cli.Context) error { if path != "" { if ctx.GlobalBool(utils.TestnetFlag.Name) { path = filepath.Join(path, "testnet") - } else if ctx.GlobalBool(utils.RinkebyFlag.Name) { - path = filepath.Join(path, "rinkeby") } } endpoint = fmt.Sprintf("%s/geth.ipc", path) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 0ace5b792..956469b9e 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -120,8 +120,6 @@ var ( utils.DeveloperFlag, utils.DeveloperPeriodFlag, utils.TestnetFlag, - utils.RinkebyFlag, - utils.GoerliFlag, utils.VMEnableDebugFlag, utils.NetworkIdFlag, utils.ConstantinopleOverrideFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 0c5642ace..18c9743e0 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -73,8 +73,6 @@ var AppHelpFlagGroups = []flagGroup{ utils.NoUSBFlag, 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 2a1f8c765..cf41f5cdd 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -130,21 +130,13 @@ var ( } NetworkIdFlag = cli.Uint64Flag{ Name: "networkid", - Usage: "Network identifier (integer, 237=Mainnet, 238=Testnet)", + Usage: "Network identifier (integer, 237=Mainnet, 238=Testnet) (default: 237)", Value: eth.DefaultConfig.NetworkId, } TestnetFlag = cli.BoolFlag{ Name: "testnet", Usage: "Ropsten network: pre-configured proof-of-work test network", } - RinkebyFlag = cli.BoolFlag{ - Name: "rinkeby", - Usage: "Rinkeby network: pre-configured proof-of-authority test network", - } - GoerliFlag = cli.BoolFlag{ - Name: "goerli", - Usage: "Görli network: pre-configured proof-of-authority test network", - } ConstantinopleOverrideFlag = cli.Uint64Flag{ Name: "override.constantinople", Usage: "Manually specify constantinople fork-block, overriding the bundled setting", @@ -653,12 +645,6 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.GlobalBool(TestnetFlag.Name) { return filepath.Join(path, "testnet") } - if ctx.GlobalBool(RinkebyFlag.Name) { - return filepath.Join(path, "rinkeby") - } - if ctx.GlobalBool(GoerliFlag.Name) { - return filepath.Join(path, "goerli") - } return path } Fatalf("Cannot determine default data directory, please set manually (--datadir)") @@ -711,10 +697,6 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { } case ctx.GlobalBool(TestnetFlag.Name): urls = params.TestnetBootnodes - case ctx.GlobalBool(RinkebyFlag.Name): - urls = params.RinkebyBootnodes - case ctx.GlobalBool(GoerliFlag.Name): - urls = params.GoerliBootnodes case cfg.BootstrapNodes != nil: return // already set, don't apply defaults. } @@ -740,10 +722,6 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) { } else { urls = strings.Split(ctx.GlobalString(BootnodesFlag.Name), ",") } - case ctx.GlobalBool(RinkebyFlag.Name): - urls = params.RinkebyBootnodes - case ctx.GlobalBool(GoerliFlag.Name): - urls = params.GoerliBootnodes case cfg.BootstrapNodesV5 != nil: return // already set, don't apply defaults. } @@ -1018,10 +996,6 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = "" // unless explicitly requested, use memory databases case ctx.GlobalBool(TestnetFlag.Name): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet") - case ctx.GlobalBool(RinkebyFlag.Name): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby") - case ctx.GlobalBool(GoerliFlag.Name): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli") } } @@ -1178,7 +1152,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) { // SetDexConfig applies eth-related command line flags to the config. func SetDexConfig(ctx *cli.Context, stack *node.Node, cfg *dex.Config) { // Avoid conflicting network flags - checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag, GoerliFlag) + checkExclusive(ctx, DeveloperFlag, TestnetFlag) checkExclusive(ctx, LightServFlag, SyncModeFlag, "light") ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) @@ -1236,19 +1210,9 @@ func SetDexConfig(ctx *cli.Context, stack *node.Node, cfg *dex.Config) { switch { case ctx.GlobalBool(TestnetFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 3 + cfg.NetworkId = 238 } cfg.Genesis = core.DefaultTestnetGenesisBlock() - case ctx.GlobalBool(RinkebyFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 4 - } - cfg.Genesis = core.DefaultRinkebyGenesisBlock() - case ctx.GlobalBool(GoerliFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 5 - } - cfg.Genesis = core.DefaultGoerliGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 1337 @@ -1402,10 +1366,6 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { switch { case ctx.GlobalBool(TestnetFlag.Name): genesis = core.DefaultTestnetGenesisBlock() - case ctx.GlobalBool(RinkebyFlag.Name): - genesis = core.DefaultRinkebyGenesisBlock() - case ctx.GlobalBool(GoerliFlag.Name): - genesis = core.DefaultGoerliGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): Fatalf("Developer chains are ephemeral") } diff --git a/core/genesis.go b/core/genesis.go index b73ad10f9..cdc5531f2 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -375,30 +375,6 @@ func DefaultTestnetGenesisBlock() *Genesis { } } -// DefaultRinkebyGenesisBlock returns the Rinkeby network genesis block. -func DefaultRinkebyGenesisBlock() *Genesis { - return &Genesis{ - Config: params.RinkebyChainConfig, - Timestamp: 1492009146, - ExtraData: hexutil.MustDecode("0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - GasLimit: 4700000, - Difficulty: big.NewInt(1), - Alloc: decodePrealloc(rinkebyAllocData), - } -} - -// DefaultGoerliGenesisBlock returns the Görli network genesis block. -func DefaultGoerliGenesisBlock() *Genesis { - return &Genesis{ - Config: params.GoerliChainConfig, - Timestamp: 1548854791, - ExtraData: hexutil.MustDecode("0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - GasLimit: 10485760, - Difficulty: big.NewInt(1), - Alloc: decodePrealloc(goerliAllocData), - } -} - // DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must // be seeded with the func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis { @@ -421,7 +397,7 @@ func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis { common.BytesToAddress([]byte{6}): {Balance: big.NewInt(1)}, // ECAdd common.BytesToAddress([]byte{7}): {Balance: big.NewInt(1)}, // ECScalarMul common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing - faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))}, + faucet: {Balance: new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(9))}, }, } } diff --git a/core/genesis_alloc.go b/core/genesis_alloc.go index f75b62f5a..48636c72f 100644 --- a/core/genesis_alloc.go +++ b/core/genesis_alloc.go @@ -24,4 +24,3 @@ package core const mainnetAllocData = "\xf9\x02\x18\xf8o\x946\x1eIX\xbd\x8bM\x03\\h\xc4s\x19>w\xfd\xabj\xea\x9d\xf8X\x8965\u026d\xc5\u07a0\x00\x00\x89\x1b\x1a\xe4\xd6\xe2\xefP\x00\x00\x80\xb8A\x04\f/\a\xcf\"\x96n\xba\xa1\x9d\xd8}\xe1\x1d\x04\xf9\xa6\x06\xe8>u\xa5)Utv\nZM\xd8(\a\xe7\xd9\xf2\x8f\x86\xcd8\x98q\u0753\x1aG|\xacd\xe23\xa6\xf0\x98\u0572W\x87\x1d\x81c\xdc\x1b\xdd\xcf\xee\x94Wei-Ning Sonic Bojie\u0600\x80\x94Wei-Ning Sonic Bojie\x80\xf8o\x94\xb6\xa2\xe2p\xb5O\x19\xb4\x00-e5\xa7\x1c\xfd\xd1\xca\x1f_\xc1\xf8X\x8965\u026d\xc5\u07a0\x00\x00\x89\x1b\x1a\xe4\xd6\xe2\xefP\x00\x00\x80\xb8A\x04c\xf7\x8d9\x8fk\x04)R\x06*&\xf3U\x1aN)J\x11\bK\x10\x06\xc8\xd67d7\xb7$\x88\xd8\xf3\xafk\x84\x991\xc06$\xad-X\x19\x00\xe9\xad_<\xfe\xee\xd0@\u01d9\xe50\x8c\xd8\x01(S\xfb\xf8o\x94\xb6\xbb\xbe9\x0311\xe4(\u0563TXV\xa5\x96\xca\xcbx\x10\xf8X\x8965\u026d\xc5\u07a0\x00\x00\x89\x1b\x1a\xe4\xd6\xe2\xefP\x00\x00\x80\xb8A\x04\xa1\x11\x8c\x8f\x1c.)=\xe5(\xe5\xb4Z\xc5\xe6Qg\xafL\xb4\xd1\b\x87\x92J\x9f\x83\x92\x87\xd0`\xda&AN\x97\x1c\xabu\x01>V\r\xfe\u01c9{\x19\x83\xea\xa61\xae/\x16\xea@bRS\x10\xed\xd8\xea\xf8o\x94\xbcq\xc0\xf2\xae\xcaF\xfa\x00\x01\xe7e\x96P)\xb1j\x06\x04\x9e\xf8X\x8965\u026d\xc5\u07a0\x00\x00\x89\x1b\x1a\xe4\xd6\xe2\xefP\x00\x00\x80\xb8A\x04\xa1*\x01_'\u064eS\x05I\x8d#\xae\xac\xde(\x1eH\xaa\xd9\x18\xae\x87\xd7\xf6\x17\x84\xabC\x82\x89S\u06d9\xbf\x1fDBb\x94\xcb\xc2\x1e2\xcf:\x99\x12/,\xe8\xa3[\xa7\x18\xa7\xc8\x14\xee\u01fa\xe9\xa3\xea\u453f\x8cH\xa6 \xba\xccF\x90\u007f\x9b\x89s-%\xe4z-|\xf7\u038a\x15-\x02\xc7\xe1J\xf6\x80\x00\x00\x80\x80\x80" const testnetAllocData = mainnetAllocData -const rinkebyAllocData = mainnetAllocData diff --git a/mobile/params.go b/mobile/params.go index bfcbf67af..f9b94b130 100644 --- a/mobile/params.go +++ b/mobile/params.go @@ -41,15 +41,6 @@ func TestnetGenesis() string { return string(enc) } -// RinkebyGenesis returns the JSON spec to use for the Rinkeby test network -func RinkebyGenesis() string { - enc, err := json.Marshal(core.DefaultRinkebyGenesisBlock()) - if err != nil { - panic(err) - } - return string(enc) -} - // FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated // by the foundation running the V5 discovery protocol. func FoundationBootnodes() *Enodes { diff --git a/params/bootnodes.go b/params/bootnodes.go index 379e97381..3c6ec8555 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -28,28 +28,6 @@ var TestnetBootnodes = []string{ "enode://0478aa13c91aa0db8e93b668313b7eb0532fbdb24f64772375373b14dbe326c238ad09ab4469f6442c9a9753f1275aeec2e531912c14a958ed1feb4ae7e227ef@127.0.0.1:30301", } -// RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Rinkeby test network. -var RinkebyBootnodes = []string{ - "enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303", // IE - "enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303", // INFURA - "enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA -} - -// GoerliBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Görli test network. -var GoerliBootnodes = []string{ - // Upstrem bootnodes - "enode://011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a@51.141.78.53:30303", - "enode://176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b@13.93.54.137:30303", - "enode://46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291@94.237.54.114:30313", - "enode://c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2@52.64.155.147:30303", - "enode://f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263@213.186.16.82:30303", - - // Ethereum Foundation bootnode - "enode://573b6607cd59f241e30e4c4943fd50e99e2b6f42f9bd5ca111659d309c06741247f4f1e93843ad3e8c8c18b6e2d94c161b7ef67479b3938780a97134b618b5ce@52.56.136.200:30303", -} - // DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the // experimental RLPx v5 topic-discovery network. var DiscoveryV5Bootnodes = []string{ diff --git a/params/config.go b/params/config.go index b998c93c1..3e9db27f2 100644 --- a/params/config.go +++ b/params/config.go @@ -28,8 +28,6 @@ import ( var ( MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") TestnetGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") - RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") - GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of @@ -37,8 +35,6 @@ var ( var TrustedCheckpoints = map[common.Hash]*TrustedCheckpoint{ MainnetGenesisHash: MainnetTrustedCheckpoint, TestnetGenesisHash: TestnetTrustedCheckpoint, - RinkebyGenesisHash: RinkebyTrustedCheckpoint, - GoerliGenesisHash: GoerliTrustedCheckpoint, } var ( @@ -119,60 +115,6 @@ var ( BloomRoot: common.HexToHash("0x5ac25c84bd18a9cbe878d4609a80220f57f85037a112644532412ba0d498a31b"), } - // RinkebyChainConfig contains the chain parameters to run a node on the Rinkeby test network. - RinkebyChainConfig = &ChainConfig{ - ChainID: big.NewInt(4), - HomesteadBlock: big.NewInt(1), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(2), - EIP155Block: big.NewInt(3), - EIP158Block: big.NewInt(3), - ByzantiumBlock: big.NewInt(1035301), - ConstantinopleBlock: big.NewInt(3660663), - PetersburgBlock: big.NewInt(4321234), - Clique: &CliqueConfig{ - Period: 15, - Epoch: 30000, - }, - } - - // RinkebyTrustedCheckpoint contains the light client trusted checkpoint for the Rinkeby test network. - RinkebyTrustedCheckpoint = &TrustedCheckpoint{ - Name: "rinkeby", - SectionIndex: 125, - SectionHead: common.HexToHash("0x8a738386f6bb34add15846f8f49c4c519a2f32519096e792b9f43bcb407c831c"), - CHTRoot: common.HexToHash("0xa1e5720a9bad4dce794f129e4ac6744398197b652868011486a6f89c8ec84a75"), - BloomRoot: common.HexToHash("0xa3048fe8b7e30f77f11bc755a88478363d7d3e71c2bdfe4e8ab9e269cd804ba2"), - } - - // GoerliChainConfig contains the chain parameters to run a node on the Görli test network. - GoerliChainConfig = &ChainConfig{ - ChainID: big.NewInt(5), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - Clique: &CliqueConfig{ - Period: 15, - Epoch: 30000, - }, - } - - // GoerliTrustedCheckpoint contains the light client trusted checkpoint for the Görli test network. - GoerliTrustedCheckpoint = &TrustedCheckpoint{ - Name: "goerli", - SectionIndex: 9, - SectionHead: common.HexToHash("0x8e223d827391eee53b07cb8ee057dbfa11c93e0b45352188c783affd7840a921"), - CHTRoot: common.HexToHash("0xe0a817ac69b36c1e437c5b0cff9e764853f5115702b5f66d451b665d6afb7e78"), - BloomRoot: common.HexToHash("0x50d672aeb655b723284969c7c1201fb6ca003c23ed144bcb9f2d1b30e2971c1b"), - } - // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Ethash consensus. // -- cgit v1.2.3