aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-10-09 23:36:31 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-10-19 15:03:10 +0800
commitaa0538db0b5de2bb2c609d629b65d083649f9171 (patch)
treea1ce77d4fa8d041a78975b6f99067e85eb725ea1 /cmd
parenta9d8dfc8e77330412b1f21e25a69b96d59567e36 (diff)
downloadgo-tangerine-aa0538db0b5de2bb2c609d629b65d083649f9171.tar.gz
go-tangerine-aa0538db0b5de2bb2c609d629b65d083649f9171.tar.zst
go-tangerine-aa0538db0b5de2bb2c609d629b65d083649f9171.zip
eth: clean out light node notions from eth
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go4
-rw-r--r--cmd/utils/flags.go39
2 files changed, 5 insertions, 38 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index ca86fb26f..3e3a3eb03 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -304,8 +304,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.DataDirFlag,
utils.BlockchainVersionFlag,
utils.OlympicFlag,
- utils.EthModeFlag,
- utils.EthVersionFlag,
+ utils.FastSyncFlag,
utils.CacheFlag,
utils.JSpathFlag,
utils.ListenPortFlag,
@@ -361,7 +360,6 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.SetupLogger(ctx)
utils.SetupNetwork(ctx)
utils.SetupVM(ctx)
- utils.SetupEth(ctx)
if ctx.GlobalBool(utils.PProfEanbledFlag.Name) {
utils.StartPProf(ctx)
}
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 792fcb41d..060d80b35 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -28,7 +28,6 @@ import (
"path/filepath"
"runtime"
"strconv"
- "strings"
"github.com/codegangsta/cli"
"github.com/ethereum/ethash"
@@ -149,15 +148,9 @@ var (
Name: "olympic",
Usage: "Use olympic style protocol",
}
- EthModeFlag = cli.StringFlag{
- Name: "mode",
- Value: "archive",
- Usage: "Client mode of operation (archive, full, light)",
- }
- EthVersionFlag = cli.IntFlag{
- Name: "eth",
- Value: 63,
- Usage: "Highest eth protocol to advertise (temporary, dev option)",
+ FastSyncFlag = cli.BoolFlag{
+ Name: "fast",
+ Usage: "Enables fast syncing through state downloads",
}
// miner settings
@@ -431,25 +424,13 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config {
if err != nil {
glog.V(logger.Error).Infoln("WARNING: No etherbase set and no accounts found as default")
}
- // Resolve the mode of opeation from the string flag
- var clientMode eth.Mode
- switch strings.ToLower(ctx.GlobalString(EthModeFlag.Name)) {
- case "archive":
- clientMode = eth.ArchiveMode
- case "full":
- clientMode = eth.FullMode
- case "light":
- clientMode = eth.LightMode
- default:
- glog.Fatalf("Unknown node type requested: %s", ctx.GlobalString(EthModeFlag.Name))
- }
// Assemble the entire eth configuration and return
cfg := &eth.Config{
Name: common.MakeName(clientID, version),
DataDir: MustDataDir(ctx),
GenesisNonce: ctx.GlobalInt(GenesisNonceFlag.Name),
GenesisFile: ctx.GlobalString(GenesisFileFlag.Name),
- Mode: clientMode,
+ FastSync: ctx.GlobalBool(FastSyncFlag.Name),
BlockChainVersion: ctx.GlobalInt(BlockchainVersionFlag.Name),
DatabaseCache: ctx.GlobalInt(CacheFlag.Name),
SkipBcVersionCheck: false,
@@ -550,18 +531,6 @@ func SetupVM(ctx *cli.Context) {
vm.SetJITCacheSize(ctx.GlobalInt(VMJitCacheFlag.Name))
}
-// SetupEth configures the eth packages global settings
-func SetupEth(ctx *cli.Context) {
- version := ctx.GlobalInt(EthVersionFlag.Name)
- for len(eth.ProtocolVersions) > 0 && eth.ProtocolVersions[0] > uint(version) {
- eth.ProtocolVersions = eth.ProtocolVersions[1:]
- eth.ProtocolLengths = eth.ProtocolLengths[1:]
- }
- if len(eth.ProtocolVersions) == 0 {
- Fatalf("No valid eth protocols remaining")
- }
-}
-
// MakeChain creates a chain manager from set command line flags.
func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database) {
datadir := MustDataDir(ctx)