cmd/geth/main.go — Version Comparison¶
| v1.16.8 | v1.17.3 | |
|---|---|---|
| Branch | etc/v1.16.8-full-node |
etc/v1.17.3-full-node |
| Delta | +30 -4 | +22 -4 |
ETC delta on v1.16.8 (+30 -4)
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 109b36836..ed7a41f0f 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/console/prompt"
+ "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/internal/debug"
@@ -46,7 +47,7 @@ import (
)
const (
- clientIdentifier = "geth" // Client identifier to advertise over the network
+ clientIdentifier = "Getc" // Client identifier to advertise over the network
)
var (
@@ -121,6 +122,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,
@@ -156,6 +162,8 @@ var (
utils.BeaconGenesisTimeFlag,
utils.BeaconCheckpointFlag,
utils.BeaconCheckpointFileFlag,
+ utils.MESSForceEnableFlag,
+ utils.MESSForceDisableFlag,
}, utils.NetworkFlags, utils.DatabaseFlags)
rpcFlags = []cli.Flag{
@@ -238,6 +246,8 @@ func init() {
attachCommand,
javascriptCommand,
// See misccmd.go:
+ makecacheCommand,
+ makedagCommand,
versionCommand,
versionCheckCommand,
licenseCommand,
@@ -303,6 +313,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...")
}
@@ -312,6 +328,8 @@ func prepare(ctx *cli.Context) {
if !ctx.IsSet(utils.HoleskyFlag.Name) &&
!ctx.IsSet(utils.SepoliaFlag.Name) &&
!ctx.IsSet(utils.HoodiFlag.Name) &&
+ !ctx.IsSet(utils.ClassicFlag.Name) &&
+ !ctx.IsSet(utils.MordorFlag.Name) &&
!ctx.IsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.Int(utils.CacheFlag.Name), "updated", 4096)
@@ -329,17 +347,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)
@@ -388,6 +406,14 @@ func startNode(ctx *cli.Context, stack *node.Node, isConsole bool) {
}
}()
+ // Start mining if requested
+ if ctx.Bool(utils.MiningEnabledFlag.Name) && ethBackend != nil {
+ threads := ctx.Int(utils.MinerThreadsFlag.Name)
+ if err := ethBackend.StartMining(threads); err != nil {
+ utils.Fatalf("Failed to start mining: %v", err)
+ }
+ }
+
// Spawn a standalone goroutine for status synchronization monitoring,
// close the node when synchronization is complete if user required.
if ctx.Bool(utils.ExitWhenSyncedFlag.Name) {
ETC delta on v1.17.3 (+22 -4)
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)
}