From 220cf29ac2858b48e9b54512235171a25d75982c Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Tue, 9 Jul 2024 10:57:32 +0800 Subject: [PATCH] cmd/utils: support use NetworkId to distinguish chapel when do syncing --- README.md | 2 -- cmd/geth/main.go | 3 --- cmd/utils/flags.go | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 9e38330f44..360ba0d7ba 100644 --- a/README.md +++ b/README.md @@ -149,8 +149,6 @@ unzip testnet.zip #### 3. Download snapshot Download latest chaindata snapshot from [here](https://github.com/bnb-chain/bsc-snapshots). Follow the guide to structure your files. -Note: If you encounter difficulties downloading the chaindata snapshot and prefer to synchronize from the genesis block on the Chapel testnet, remember to include the additional flag `--chapel` when initially launching Geth. - #### 4. Start a full node ```shell ./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0 diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 9763794f7e..8152b99930 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -336,9 +336,6 @@ func prepare(ctx *cli.Context) { 5. Networking is disabled; there is no listen-address, the maximum number of peers is set to 0, and discovery is disabled. `) - - case !ctx.IsSet(utils.NetworkIdFlag.Name): - log.Info("Starting Geth on BSC mainnet...") } // If we're a full node on mainnet without --cache specified, bump default cache allowance if !ctx.IsSet(utils.CacheFlag.Name) && !ctx.IsSet(utils.NetworkIdFlag.Name) { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 8707840692..57b6abc5a2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -2083,7 +2083,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultBSCGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.BSCGenesisHash) - case ctx.Bool(ChapelFlag.Name): + case ctx.Bool(ChapelFlag.Name) || cfg.NetworkId == 97: if !ctx.IsSet(NetworkIdFlag.Name) { cfg.NetworkId = 97 }