Skip to content

Commit

Permalink
cmd/geth, cmd/utils, metadium/scripts: renamed --testnet to --meta-te…
Browse files Browse the repository at this point in the history
…snet
  • Loading branch information
sadoci committed Nov 8, 2021
1 parent 5d95d03 commit a4f0f8f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ var (
utils.NodeKeyHexFlag,
utils.DNSDiscoveryFlag,
utils.MainnetFlag,
utils.MetaTestnetFlag,
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.RopstenFlag,
Expand Down Expand Up @@ -299,6 +300,9 @@ func main() {
func prepare(ctx *cli.Context) {
// If we're running a known preset, log it for convenience.
switch {
case ctx.GlobalIsSet(utils.MetaTestnetFlag.Name):
log.Info("Starting Geth on Metadium testnet...")

case ctx.GlobalIsSet(utils.RopstenFlag.Name):
log.Info("Starting Geth on Ropsten testnet...")

Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.SmartCardDaemonPathFlag,
utils.NetworkIdFlag,
utils.MainnetFlag,
utils.MetaTestnetFlag,
utils.GoerliFlag,
utils.RinkebyFlag,
utils.RopstenFlag,
Expand Down
14 changes: 8 additions & 6 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Explicitly set network id (integer, 11=Metadium, 12=MetadiumTestnet)(For testnets: use --ropsten, --rinkeby, --goerli instead)",
Usage: "Explicitly set network id (integer, 11=Metadium, 12=MetadiumTestnet)(For testnets: use --meta-testnet --ropsten, --rinkeby, --goerli instead)",
Value: ethconfig.Defaults.NetworkId,
}
MainnetFlag = cli.BoolFlag{
Name: "mainnet",
Usage: "Ethereum mainnet",
}
TestnetFlag = cli.BoolFlag{
Name: "testnet",
MetaTestnetFlag = cli.BoolFlag{
Name: "meta-testnet",
Usage: "Metadium test network: pre-configured metadium test network",
}
GoerliFlag = cli.BoolFlag{
Expand Down Expand Up @@ -900,7 +900,7 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
switch {
case ctx.GlobalIsSet(BootnodesFlag.Name):
urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
case ctx.GlobalBool(TestnetFlag.Name):
case ctx.GlobalBool(MetaTestnetFlag.Name):
urls = params.MetadiumTestnetBootnodes
case ctx.GlobalBool(RopstenFlag.Name):
urls = params.RopstenBootnodes
Expand Down Expand Up @@ -1536,7 +1536,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
// 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, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag)
CheckExclusive(ctx, MainnetFlag, MetaTestnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag)
CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1671,7 +1671,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
cfg.Genesis = core.DefaultGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.MetadiumMainnetGenesisHash)
case ctx.GlobalBool(TestnetFlag.Name):
case ctx.GlobalBool(MetaTestnetFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 12
}
Expand Down Expand Up @@ -1948,6 +1948,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
switch {
case ctx.GlobalBool(MainnetFlag.Name):
genesis = core.DefaultGenesisBlock()
case ctx.GlobalBool(MetaTestnetFlag.Name):
genesis = core.DefaultTestnetGenesisBlock()
case ctx.GlobalBool(RopstenFlag.Name):
genesis = core.DefaultRopstenGenesisBlock()
case ctx.GlobalBool(RinkebyFlag.Name):
Expand Down
2 changes: 1 addition & 1 deletion metadium/scripts/gmet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function start ()
[ "$PORT" = "" ] || RPCOPT="${RPCOPT} --rpcport ${PORT}"
[ "$NONCE_LIMIT" = "" ] || NONCE_LIMIT="--noncelimit $NONCE_LIMIT"
[ "$BOOT_NODES" = "" ] || BOOT_NODES="--bootnodes $BOOT_NODES"
[ "$TESTNET" = "1" ] && TESTNET=--testnet
[ "$TESTNET" = "1" ] && TESTNET=--meta-testnet
if [ "$DISCOVER" = "0" ]; then
DISCOVER=--nodiscover
else
Expand Down

0 comments on commit a4f0f8f

Please sign in to comment.