|
@@ -30,7 +30,6 @@ import (
|
|
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
|
|
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
|
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
|
|
"github.com/ethereum/go-ethereum/internal/ethapi"
|
|
"github.com/ethereum/go-ethereum/internal/ethapi"
|
|
|
- "github.com/ethereum/go-ethereum/log"
|
|
|
|
|
"github.com/ethereum/go-ethereum/metrics"
|
|
"github.com/ethereum/go-ethereum/metrics"
|
|
|
"github.com/ethereum/go-ethereum/node"
|
|
"github.com/ethereum/go-ethereum/node"
|
|
|
"github.com/ethereum/go-ethereum/params"
|
|
"github.com/ethereum/go-ethereum/params"
|
|
@@ -43,7 +42,7 @@ var (
|
|
|
Name: "dumpconfig",
|
|
Name: "dumpconfig",
|
|
|
Usage: "Show configuration values",
|
|
Usage: "Show configuration values",
|
|
|
ArgsUsage: "",
|
|
ArgsUsage: "",
|
|
|
- Flags: append(append(nodeFlags, rpcFlags...), whisperFlags...),
|
|
|
|
|
|
|
+ Flags: append(nodeFlags, rpcFlags...),
|
|
|
Category: "MISCELLANEOUS COMMANDS",
|
|
Category: "MISCELLANEOUS COMMANDS",
|
|
|
Description: `The dumpconfig command shows configuration values.`,
|
|
Description: `The dumpconfig command shows configuration values.`,
|
|
|
}
|
|
}
|
|
@@ -75,19 +74,8 @@ type ethstatsConfig struct {
|
|
|
URL string `toml:",omitempty"`
|
|
URL string `toml:",omitempty"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// whisper has been deprecated, but clients out there might still have [Shh]
|
|
|
|
|
-// in their config, which will crash. Cut them some slack by keeping the
|
|
|
|
|
-// config, and displaying a message that those config switches are ineffectual.
|
|
|
|
|
-// To be removed circa Q1 2021 -- @gballet.
|
|
|
|
|
-type whisperDeprecatedConfig struct {
|
|
|
|
|
- MaxMessageSize uint32 `toml:",omitempty"`
|
|
|
|
|
- MinimumAcceptedPOW float64 `toml:",omitempty"`
|
|
|
|
|
- RestrictConnectionBetweenLightClients bool `toml:",omitempty"`
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
type gethConfig struct {
|
|
type gethConfig struct {
|
|
|
Eth ethconfig.Config
|
|
Eth ethconfig.Config
|
|
|
- Shh whisperDeprecatedConfig
|
|
|
|
|
Node node.Config
|
|
Node node.Config
|
|
|
Ethstats ethstatsConfig
|
|
Ethstats ethstatsConfig
|
|
|
Metrics metrics.Config
|
|
Metrics metrics.Config
|
|
@@ -132,11 +120,8 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
|
|
if err := loadConfig(file, &cfg); err != nil {
|
|
if err := loadConfig(file, &cfg); err != nil {
|
|
|
utils.Fatalf("%v", err)
|
|
utils.Fatalf("%v", err)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if cfg.Shh != (whisperDeprecatedConfig{}) {
|
|
|
|
|
- log.Warn("Deprecated whisper config detected. Whisper has been moved to github.com/ethereum/whisper")
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// Apply flags.
|
|
// Apply flags.
|
|
|
utils.SetNodeConfig(ctx, &cfg.Node)
|
|
utils.SetNodeConfig(ctx, &cfg.Node)
|
|
|
stack, err := node.New(&cfg.Node)
|
|
stack, err := node.New(&cfg.Node)
|
|
@@ -147,22 +132,11 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
|
|
if ctx.GlobalIsSet(utils.EthStatsURLFlag.Name) {
|
|
if ctx.GlobalIsSet(utils.EthStatsURLFlag.Name) {
|
|
|
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
|
|
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
|
|
|
}
|
|
}
|
|
|
- utils.SetShhConfig(ctx, stack)
|
|
|
|
|
-
|
|
|
|
|
applyMetricConfig(ctx, &cfg)
|
|
applyMetricConfig(ctx, &cfg)
|
|
|
|
|
|
|
|
return stack, cfg
|
|
return stack, cfg
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// enableWhisper returns true in case one of the whisper flags is set.
|
|
|
|
|
-func checkWhisper(ctx *cli.Context) {
|
|
|
|
|
- for _, flag := range whisperFlags {
|
|
|
|
|
- if ctx.GlobalIsSet(flag.GetName()) {
|
|
|
|
|
- log.Warn("deprecated whisper flag detected. Whisper has been moved to github.com/ethereum/whisper")
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// makeFullNode loads geth configuration and creates the Ethereum backend.
|
|
// makeFullNode loads geth configuration and creates the Ethereum backend.
|
|
|
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
|
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
|
|
stack, cfg := makeConfigNode(ctx)
|
|
stack, cfg := makeConfigNode(ctx)
|
|
@@ -171,7 +145,6 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
|
|
}
|
|
}
|
|
|
backend := utils.RegisterEthService(stack, &cfg.Eth)
|
|
backend := utils.RegisterEthService(stack, &cfg.Eth)
|
|
|
|
|
|
|
|
- checkWhisper(ctx)
|
|
|
|
|
// Configure GraphQL if requested
|
|
// Configure GraphQL if requested
|
|
|
if ctx.GlobalIsSet(utils.GraphQLEnabledFlag.Name) {
|
|
if ctx.GlobalIsSet(utils.GraphQLEnabledFlag.Name) {
|
|
|
utils.RegisterGraphQLService(stack, backend, cfg.Node)
|
|
utils.RegisterGraphQLService(stack, backend, cfg.Node)
|