all: remove network rinkeby

This commit is contained in:
Daniel Liu 2025-02-18 21:03:52 +08:00
parent 54b4be1aa2
commit 98cff5d6c2
7 changed files with 3 additions and 72 deletions

View file

@ -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)

View file

@ -120,7 +120,6 @@ var (
utils.MainnetFlag,
utils.TestnetFlag,
utils.DevnetFlag,
//utils.RinkebyFlag,
//utils.VMEnableDebugFlag,
utils.Enable0xPrefixFlag,
utils.EnableXDCPrefixFlag,

View file

@ -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")
}

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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.
//