mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
cmd: retire whisper flags (#22421)
This commit is contained in:
parent
cfb72501bf
commit
85ede14a92
5 changed files with 2 additions and 62 deletions
|
|
@ -46,7 +46,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.`,
|
||||||
}
|
}
|
||||||
|
|
@ -88,19 +88,8 @@ type Bootnodes struct {
|
||||||
Testnet []string
|
Testnet []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 XDCConfig struct {
|
type XDCConfig struct {
|
||||||
Eth ethconfig.Config
|
Eth ethconfig.Config
|
||||||
Shh whisperDeprecatedConfig
|
|
||||||
Node node.Config
|
Node node.Config
|
||||||
Ethstats ethstatsConfig
|
Ethstats ethstatsConfig
|
||||||
XDCX XDCx.Config
|
XDCX XDCx.Config
|
||||||
|
|
@ -150,10 +139,6 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
||||||
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")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ctx.GlobalIsSet(utils.StakingEnabledFlag.Name) {
|
if ctx.GlobalIsSet(utils.StakingEnabledFlag.Name) {
|
||||||
cfg.StakeEnable = ctx.GlobalBool(utils.StakingEnabledFlag.Name)
|
cfg.StakeEnable = ctx.GlobalBool(utils.StakingEnabledFlag.Name)
|
||||||
|
|
@ -224,7 +209,6 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
||||||
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
|
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.SetShhConfig(ctx, stack)
|
|
||||||
utils.SetXDCXConfig(ctx, &cfg.XDCX, cfg.Node.DataDir)
|
utils.SetXDCXConfig(ctx, &cfg.XDCX, cfg.Node.DataDir)
|
||||||
return stack, cfg
|
return stack, cfg
|
||||||
}
|
}
|
||||||
|
|
@ -242,15 +226,6 @@ func applyValues(values []string, params *[]string) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkWhisper 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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func makeFullNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
func makeFullNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
||||||
stack, cfg := makeConfigNode(ctx)
|
stack, cfg := makeConfigNode(ctx)
|
||||||
|
|
||||||
|
|
@ -259,7 +234,6 @@ func makeFullNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
||||||
utils.RegisterXDCXService(stack, &cfg.XDCX)
|
utils.RegisterXDCXService(stack, &cfg.XDCX)
|
||||||
utils.RegisterEthService(stack, &cfg.Eth)
|
utils.RegisterEthService(stack, &cfg.Eth)
|
||||||
|
|
||||||
checkWhisper(ctx)
|
|
||||||
// Add the Ethereum Stats daemon if requested.
|
// Add the Ethereum Stats daemon if requested.
|
||||||
if cfg.Ethstats.URL != "" {
|
if cfg.Ethstats.URL != "" {
|
||||||
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
|
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ var (
|
||||||
Action: utils.MigrateFlags(localConsole),
|
Action: utils.MigrateFlags(localConsole),
|
||||||
Name: "console",
|
Name: "console",
|
||||||
Usage: "Start an interactive JavaScript environment",
|
Usage: "Start an interactive JavaScript environment",
|
||||||
Flags: append(append(append(nodeFlags, rpcFlags...), consoleFlags...), whisperFlags...),
|
Flags: append(append(nodeFlags, rpcFlags...), consoleFlags...),
|
||||||
Category: "CONSOLE COMMANDS",
|
Category: "CONSOLE COMMANDS",
|
||||||
Description: `
|
Description: `
|
||||||
The XDC console is an interactive shell for the JavaScript runtime environment
|
The XDC console is an interactive shell for the JavaScript runtime environment
|
||||||
|
|
|
||||||
|
|
@ -160,12 +160,6 @@ var (
|
||||||
utils.IPCPathFlag,
|
utils.IPCPathFlag,
|
||||||
utils.RPCGlobalTxFeeCap,
|
utils.RPCGlobalTxFeeCap,
|
||||||
}
|
}
|
||||||
|
|
||||||
whisperFlags = []cli.Flag{
|
|
||||||
utils.WhisperEnabledFlag,
|
|
||||||
utils.WhisperMaxMessageSizeFlag,
|
|
||||||
utils.WhisperMinPOWFlag,
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -198,7 +192,6 @@ func init() {
|
||||||
app.Flags = append(app.Flags, rpcFlags...)
|
app.Flags = append(app.Flags, rpcFlags...)
|
||||||
app.Flags = append(app.Flags, consoleFlags...)
|
app.Flags = append(app.Flags, consoleFlags...)
|
||||||
app.Flags = append(app.Flags, debug.Flags...)
|
app.Flags = append(app.Flags, debug.Flags...)
|
||||||
app.Flags = append(app.Flags, whisperFlags...)
|
|
||||||
|
|
||||||
app.Before = func(ctx *cli.Context) error {
|
app.Before = func(ctx *cli.Context) error {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
|
|
||||||
|
|
@ -217,10 +217,6 @@ var AppHelpFlagGroups = []flagGroup{
|
||||||
//utils.NoCompactionFlag,
|
//utils.NoCompactionFlag,
|
||||||
}, debug.Flags...),
|
}, debug.Flags...),
|
||||||
},
|
},
|
||||||
//{
|
|
||||||
// Name: "WHISPER (deprecated)",
|
|
||||||
// Flags: whisperFlags,
|
|
||||||
//},
|
|
||||||
{
|
{
|
||||||
Name: "DEPRECATED",
|
Name: "DEPRECATED",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
|
|
|
||||||
|
|
@ -590,20 +590,6 @@ var (
|
||||||
Usage: "Gas price below which gpo will ignore transactions",
|
Usage: "Gas price below which gpo will ignore transactions",
|
||||||
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
|
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
|
||||||
}
|
}
|
||||||
WhisperEnabledFlag = cli.BoolFlag{
|
|
||||||
Name: "shh",
|
|
||||||
Usage: "Enable Whisper",
|
|
||||||
}
|
|
||||||
WhisperMaxMessageSizeFlag = cli.IntFlag{
|
|
||||||
Name: "shh.maxmessagesize",
|
|
||||||
Usage: "Max message size accepted",
|
|
||||||
Value: 1024 * 1024,
|
|
||||||
}
|
|
||||||
WhisperMinPOWFlag = cli.Float64Flag{
|
|
||||||
Name: "shh.pow",
|
|
||||||
Usage: "Minimum POW accepted",
|
|
||||||
Value: 0.2,
|
|
||||||
}
|
|
||||||
XDCXDataDirFlag = DirectoryFlag{
|
XDCXDataDirFlag = DirectoryFlag{
|
||||||
Name: "XDCx.datadir",
|
Name: "XDCx.datadir",
|
||||||
Usage: "Data directory for the XDCX databases",
|
Usage: "Data directory for the XDCX databases",
|
||||||
|
|
@ -1143,15 +1129,6 @@ func checkExclusive(ctx *cli.Context, args ...interface{}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetShhConfig applies shh-related command line flags to the config.
|
|
||||||
func SetShhConfig(ctx *cli.Context, stack *node.Node) {
|
|
||||||
if ctx.GlobalIsSet(WhisperEnabledFlag.Name) ||
|
|
||||||
ctx.GlobalIsSet(WhisperMaxMessageSizeFlag.Name) ||
|
|
||||||
ctx.GlobalIsSet(WhisperMinPOWFlag.Name) {
|
|
||||||
log.Warn("Whisper support has been deprecated and the code has been moved to github.com/ethereum/whisper")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetXDCXConfig(ctx *cli.Context, cfg *XDCx.Config, XDCDataDir string) {
|
func SetXDCXConfig(ctx *cli.Context, cfg *XDCx.Config, XDCDataDir string) {
|
||||||
if ctx.GlobalIsSet(XDCXDataDirFlag.Name) {
|
if ctx.GlobalIsSet(XDCXDataDirFlag.Name) {
|
||||||
cfg.DataDir = ctx.GlobalString(XDCXDataDirFlag.Name)
|
cfg.DataDir = ctx.GlobalString(XDCXDataDirFlag.Name)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue