Skip to content

Commit

Permalink
Upgrade urfave/cli to v2 (erigontech#6047)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored and michaelneuder committed Nov 20, 2022
1 parent ebce8ab commit 5ebdc21
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/sentinel/cli/flags/defaultFlags.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ var LightClientDefaultFlags = []cli.Flag{
&LightClientServerPort,
&LightClientServerProtocol,
&LightClientDiscovery,
<<<<<<< HEAD
&ChaindataFlag,
=======
>>>>>>> 878967894 (Upgrade urfave/cli to v2 (#6047))
}
16 changes: 16 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,11 @@ var (
}
)

<<<<<<< HEAD
var MetricFlags = []cli.Flag{&MetricsEnabledFlag, &MetricsHTTPFlag, &MetricsPortFlag}
=======
var MetricFlags = []cli.Flag{&MetricsEnabledFlag, &MetricsEnabledExpensiveFlag, &MetricsHTTPFlag, &MetricsPortFlag}
>>>>>>> 878967894 (Upgrade urfave/cli to v2 (#6047))

// setNodeKey loads a node key from command line flags if provided,
// otherwise it tries to load it from datadir,
Expand Down Expand Up @@ -918,7 +922,11 @@ func setListenAddress(ctx *cli.Context, cfg *p2p.Config) {
cfg.ListenAddr = fmt.Sprintf(":%d", ctx.Int(ListenPortFlag.Name))
}
if ctx.IsSet(P2pProtocolVersionFlag.Name) {
<<<<<<< HEAD
cfg.ProtocolVersion = ctx.UintSlice(P2pProtocolVersionFlag.Name)
=======
cfg.ProtocolVersion = uint(ctx.Int(P2pProtocolVersionFlag.Name))
>>>>>>> 878967894 (Upgrade urfave/cli to v2 (#6047))
}
if ctx.IsSet(SentryAddrFlag.Name) {
cfg.SentryAddr = SplitAndTrim(ctx.String(SentryAddrFlag.Name))
Expand Down Expand Up @@ -1445,13 +1453,21 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.C
if err := uploadRate.UnmarshalText([]byte(uploadRateStr)); err != nil {
panic(err)
}
<<<<<<< HEAD
lvl, _, err := downloadercfg2.Int2LogLevel(ctx.Int(TorrentVerbosityFlag.Name))
=======
lvl, dbg, err := downloadercfg.Int2LogLevel(ctx.Int(TorrentVerbosityFlag.Name))
>>>>>>> 878967894 (Upgrade urfave/cli to v2 (#6047))
if err != nil {
panic(err)
}
log.Info("torrent verbosity", "level", lvl.LogString())
<<<<<<< HEAD
version := "erigon: " + params.VersionWithCommit(params.GitCommit, "")
cfg.Downloader, err = downloadercfg2.New(cfg.Dirs.Snap, version, lvl, downloadRate, uploadRate, ctx.Int(TorrentPortFlag.Name), ctx.Int(TorrentConnsPerFileFlag.Name), ctx.Int(TorrentDownloadSlotsFlag.Name))
=======
cfg.Downloader, err = downloadercfg.New(cfg.Dirs.Snap, lvl, dbg, nodeConfig.P2P.NAT, downloadRate, uploadRate, ctx.Int(TorrentPortFlag.Name), ctx.Int(TorrentConnsPerFileFlag.Name), ctx.Int(TorrentDownloadSlotsFlag.Name))
>>>>>>> 878967894 (Upgrade urfave/cli to v2 (#6047))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion turbo/app/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
)

var importCommand = cli.Command{
Action: MigrateFlags(importChain),
Action: importChain,
Name: "import",
Usage: "Import a blockchain file",
ArgsUsage: "<filename> (<filename 2> ... <filename N>) ",
Expand Down
2 changes: 1 addition & 1 deletion turbo/app/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var initCommand = cli.Command{
Action: MigrateFlags(initGenesis),
Action: initGenesis,
Name: "init",
Usage: "Bootstrap and initialize a new genesis block",
ArgsUsage: "<genesisPath>",
Expand Down
4 changes: 4 additions & 0 deletions turbo/cli/default_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ var DefaultFlags = []cli.Flag{
&utils.GpoPercentileFlag,
&utils.InsecureUnlockAllowedFlag,
&utils.MetricsEnabledFlag,
<<<<<<< HEAD
=======
&utils.MetricsEnabledExpensiveFlag,
>>>>>>> 878967894 (Upgrade urfave/cli to v2 (#6047))
&utils.MetricsHTTPFlag,
&utils.MetricsPortFlag,
&utils.HistoryV3Flag,
Expand Down

0 comments on commit 5ebdc21

Please sign in to comment.