cmd/geth: explicitly rename testnet to ropsten

This commit is contained in:
q9f 2020-04-01 17:00:44 +02:00
parent 61ad875821
commit 287608ffee
No known key found for this signature in database
GPG key ID: E79CDFA171DC2DF9
4 changed files with 9 additions and 2 deletions

View file

@ -148,7 +148,9 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.SyncModeFlag,
utils.FakePoWFlag,
utils.TestnetFlag,
utils.RopstenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
@ -195,6 +197,7 @@ Use "ethereum dump 0" to dump the genesis block.`,
utils.AncientFlag,
utils.CacheFlag,
utils.TestnetFlag,
utils.RopstenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.SyncModeFlag,

View file

@ -123,10 +123,12 @@ func remoteConsole(ctx *cli.Context) error {
path = ctx.GlobalString(utils.DataDirFlag.Name)
}
if path != "" {
if ctx.GlobalBool(utils.TestnetFlag.Name) {
if ctx.GlobalBool(utils.RopstenFlag.Name) {
path = filepath.Join(path, "testnet")
} else if ctx.GlobalBool(utils.RinkebyFlag.Name) {
path = filepath.Join(path, "rinkeby")
} else if ctx.GlobalBool(utils.TestnetFlag.Name) || ctx.GlobalBool(utils.GoerliFlag.Name) {
path = filepath.Join(path, "goerli")
}
}
endpoint = fmt.Sprintf("%s/geth.ipc", path)

View file

@ -139,6 +139,7 @@ var (
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.TestnetFlag,
utils.RopstenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.VMEnableDebugFlag,
@ -261,7 +262,7 @@ func prepare(ctx *cli.Context) {
// If we're a full node on mainnet without --cache specified, bump default cache allowance
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.GlobalIsSet(utils.TestnetFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
if !ctx.GlobalIsSet(utils.TestnetFlag.Name) && !ctx.GlobalIsSet(utils.RopstenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))

View file

@ -73,6 +73,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.SmartCardDaemonPathFlag,
utils.NetworkIdFlag,
utils.TestnetFlag,
utils.RopstenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.SyncModeFlag,