diff --git a/cmd/XDC/consolecmd.go b/cmd/XDC/consolecmd.go index 77627e7df3..fb5b7de77d 100644 --- a/cmd/XDC/consolecmd.go +++ b/cmd/XDC/consolecmd.go @@ -127,8 +127,6 @@ func remoteConsole(ctx *cli.Context) error { path = filepath.Join(path, "testnet") } else if ctx.Bool(utils.DevnetFlag.Name) { path = filepath.Join(path, "devnet") - } else if ctx.Bool(utils.RinkebyFlag.Name) { - path = filepath.Join(path, "rinkeby") } } endpoint = fmt.Sprintf("%s/XDC.ipc", path) diff --git a/cmd/XDC/main.go b/cmd/XDC/main.go index 125887cc37..bd1c10f04c 100644 --- a/cmd/XDC/main.go +++ b/cmd/XDC/main.go @@ -120,7 +120,6 @@ var ( utils.MainnetFlag, utils.TestnetFlag, utils.DevnetFlag, - //utils.RinkebyFlag, //utils.VMEnableDebugFlag, utils.Enable0xPrefixFlag, utils.EnableXDCPrefixFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index bcd6d434a7..c337100f0a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -121,11 +121,6 @@ var ( Usage: "XDC develop network", Category: flags.EthCategory, } - RinkebyFlag = &cli.BoolFlag{ - Name: "rinkeby", - Usage: "Rinkeby network: pre-configured proof-of-authority test network", - Category: flags.EthCategory, - } // Dev mode DeveloperFlag = &cli.BoolFlag{ @@ -833,9 +828,6 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.Bool(DevnetFlag.Name) { return filepath.Join(path, "devnet") } - if ctx.Bool(RinkebyFlag.Name) { - return filepath.Join(path, "rinkeby") - } return path } Fatalf("Cannot determine default data directory, please set manually (--datadir)") @@ -1211,8 +1203,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet") case ctx.Bool(DevnetFlag.Name): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "devnet") - case ctx.Bool(RinkebyFlag.Name): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby") } if ctx.IsSet(KeyStoreDirFlag.Name) { @@ -1404,7 +1394,7 @@ func SetXDCXConfig(ctx *cli.Context, cfg *XDCx.Config, XDCDataDir string) { // SetEthConfig applies eth-related command line flags to the config. func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Avoid conflicting network flags - CheckExclusive(ctx, MainnetFlag, TestnetFlag, DevnetFlag, DeveloperFlag, RinkebyFlag) + CheckExclusive(ctx, MainnetFlag, TestnetFlag, DevnetFlag, DeveloperFlag) CheckExclusive(ctx, FastSyncFlag, LightModeFlag, SyncModeFlag) CheckExclusive(ctx, LightServFlag, LightModeFlag) CheckExclusive(ctx, LightServFlag, SyncModeFlag, "light") @@ -1522,11 +1512,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.NetworkId = 551 } cfg.Genesis = core.DefaultDevnetGenesisBlock() - case ctx.Bool(RinkebyFlag.Name): - if !ctx.IsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 4 - } - cfg.Genesis = core.DefaultRinkebyGenesisBlock() case ctx.Bool(DeveloperFlag.Name): // Create new developer account or reuse existing one var ( @@ -1652,8 +1637,6 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { genesis = core.DefaultTestnetGenesisBlock() case ctx.Bool(DevnetFlag.Name): genesis = core.DefaultDevnetGenesisBlock() - case ctx.Bool(RinkebyFlag.Name): - genesis = core.DefaultRinkebyGenesisBlock() case ctx.Bool(DeveloperFlag.Name): Fatalf("Developer chains are ephemeral") } diff --git a/core/genesis.go b/core/genesis.go index 418d77e8f7..689d7d0979 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "math/big" - "strings" "github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/common/hexutil" @@ -33,7 +32,6 @@ import ( "github.com/XinFinOrg/XDPoSChain/ethdb" "github.com/XinFinOrg/XDPoSChain/log" "github.com/XinFinOrg/XDPoSChain/params" - "github.com/XinFinOrg/XDPoSChain/rlp" ) //go:generate go run github.com/fjl/gencodec -type Genesis -field-override genesisSpecMarshaling -out gen_genesis.go @@ -306,18 +304,6 @@ func DefaultDevnetGenesisBlock() *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(""), - } -} - // DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must // be seeded with the func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis { @@ -346,18 +332,6 @@ func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis { } } -func decodePrealloc(data string) types.GenesisAlloc { - var p []struct{ Addr, Balance *big.Int } - if err := rlp.NewStream(strings.NewReader(data), 0).Decode(&p); err != nil { - panic(err) - } - ga := make(types.GenesisAlloc, len(p)) - for _, account := range p { - ga[common.BigToAddress(account.Addr)] = types.Account{Balance: account.Balance} - } - return ga -} - func DecodeAllocJson(s string) types.GenesisAlloc { alloc := types.GenesisAlloc{} json.Unmarshal([]byte(s), &alloc) diff --git a/eth/handler.go b/eth/handler.go index 7ac5c633f7..0abf711fe2 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -1080,7 +1080,7 @@ func (pm *ProtocolManager) lendingTxBroadcastLoop() { // NodeInfo represents a short summary of the Ethereum sub-protocol metadata // known about the host peer. type NodeInfo struct { - Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4) + Network uint64 `json:"network"` // XDC network ID (50=xinfin, 51=apothem, 551=devnet) Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules diff --git a/les/handler.go b/les/handler.go index bef0fd6467..d988101004 100644 --- a/les/handler.go +++ b/les/handler.go @@ -1184,7 +1184,7 @@ func (pm *ProtocolManager) txStatus(hashes []common.Hash) []txStatus { // NodeInfo represents a short summary of the Ethereum sub-protocol metadata // known about the host peer. type NodeInfo struct { - Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4) + Network uint64 `json:"network"` // XDC network ID (50=xinfin, 51=apothem, 551=devnet) Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules diff --git a/params/config.go b/params/config.go index 971892bc13..67007c7871 100644 --- a/params/config.go +++ b/params/config.go @@ -240,29 +240,6 @@ var ( }, } - // 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: nil, - XDPoS: &XDPoSConfig{ - Period: 15, - Epoch: 900, - V2: &V2{ - SwitchEpoch: 9999999999 / 900, - SwitchBlock: big.NewInt(9999999999), - CurrentConfig: MainnetV2Configs[0], - AllConfigs: MainnetV2Configs, - }, - }, - } - // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Ethash consensus. //