Skip to content

cmd/geth/main.go

Type MOD
Upstream Lines 387
Changed +22 -4

Add ETC-specific flags and MESS flag registration

diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 850e26d16..dac3544d0 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -26,6 +26,7 @@ import (
    "github.com/ethereum/go-ethereum/accounts"
    "github.com/ethereum/go-ethereum/cmd/utils"
    "github.com/ethereum/go-ethereum/console/prompt"
+   "github.com/ethereum/go-ethereum/eth"
    "github.com/ethereum/go-ethereum/ethclient"
    "github.com/ethereum/go-ethereum/internal/debug"
    "github.com/ethereum/go-ethereum/internal/flags"
@@ -42,7 +43,8 @@ import (
 )

 const (
-   clientIdentifier = "geth" // Client identifier to advertise over the network
+   clientIdentifier   = "getc" // Client identifier to advertise over the network
+   databaseIdentifier = "geth" // On-disk datadir/instance dir name; kept as "geth" for compatibility with go-ethereum and core-geth datadirs
 )

 var (
@@ -121,6 +123,11 @@ var (
        utils.MinerRecommitIntervalFlag,
        utils.MinerPendingFeeRecipientFlag,
        utils.MinerNewPayloadTimeoutFlag, // deprecated
+       utils.MinerThreadsFlag,
+       utils.MinerNotifyFlag,
+       utils.MinerNotifyFullFlag,
+       utils.MinerNoVerifyFlag,
+       utils.FakePoWFlag,
        utils.NATFlag,
        utils.NoDiscoverFlag,
        utils.DiscoveryV4Flag,
@@ -157,6 +164,8 @@ var (
        utils.BeaconCheckpointFlag,
        utils.BeaconCheckpointFileFlag,
        utils.LogSlowBlockFlag,
+       utils.MESSForceEnableFlag,
+       utils.MESSForceDisableFlag,
    }, utils.NetworkFlags, utils.DatabaseFlags)

    rpcFlags = []cli.Flag{
@@ -248,6 +257,8 @@ func init() {
        attachCommand,
        javascriptCommand,
        // See misccmd.go:
+       makecacheCommand,
+       makedagCommand,
        versionCommand,
        licenseCommand,
        // See config.go
@@ -312,6 +323,12 @@ func prepare(ctx *cli.Context) {
    case ctx.IsSet(utils.HoodiFlag.Name):
        log.Info("Starting Geth on Hoodi testnet...")

+   case ctx.IsSet(utils.ClassicFlag.Name):
+       log.Info("Starting Geth on Ethereum Classic mainnet...")
+
+   case ctx.IsSet(utils.MordorFlag.Name):
+       log.Info("Starting Geth on Mordor testnet (ETC)...")
+
    case !ctx.IsSet(utils.NetworkIdFlag.Name):
        log.Info("Starting Geth on Ethereum mainnet...")
    }
@@ -326,17 +343,17 @@ func geth(ctx *cli.Context) error {
    }

    prepare(ctx)
-   stack := makeFullNode(ctx)
+   stack, ethBackend := makeFullNode(ctx)
    defer stack.Close()

-   startNode(ctx, stack, false)
+   startNode(ctx, stack, ethBackend, false)
    stack.Wait()
    return nil
 }

 // startNode boots up the system node and all registered protocols, after which
 // it starts the RPC/IPC interfaces and the miner.
-func startNode(ctx *cli.Context, stack *node.Node, isConsole bool) {
+func startNode(ctx *cli.Context, stack *node.Node, ethBackend *eth.Ethereum, isConsole bool) {
    // Start up the node itself
    utils.StartNode(ctx, stack, isConsole)

@@ -384,4 +401,5 @@ func startNode(ctx *cli.Context, stack *node.Node, isConsole bool) {
            }
        }
    }()
+   startPoWFeatures(ctx, stack, ethBackend)
 }

← Back to CLI, Config & Genesis