Skip to content

Commit a358828

Browse files
committed
fix: flag set
1 parent a7d7d33 commit a358828

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

cmd/p2p/crawl/crawl.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ var CrawlCmd = &cobra.Command{
114114
}
115115

116116
func init() {
117-
CrawlCmd.PersistentFlags().StringVarP(&inputCrawlParams.Bootnodes, "bootnodes", "b", "",
117+
CrawlCmd.Flags().StringVarP(&inputCrawlParams.Bootnodes, "bootnodes", "b", "",
118118
`Comma separated nodes used for bootstrapping. At least one bootnode is
119119
required, so other nodes in the network can discover each other.`)
120-
CrawlCmd.PersistentFlags().StringVarP(&inputCrawlParams.DiscoveryDNS, "discovery-dns", "", "", `Enable EIP-1459, DNS Discovery to recover node list from given ENRTree`)
120+
CrawlCmd.Flags().StringVarP(&inputCrawlParams.DiscoveryDNS, "discovery-dns", "", "", `Enable EIP-1459, DNS Discovery to recover node list from given ENRTree`)
121121
CrawlCmd.MarkFlagsMutuallyExclusive("bootnodes", "discovery-dns")
122-
CrawlCmd.PersistentFlags().StringVarP(&inputCrawlParams.Timeout, "timeout", "t", "30m0s", "Time limit for the crawl")
123-
CrawlCmd.PersistentFlags().IntVarP(&inputCrawlParams.Threads, "parallel", "p", 16, "How many parallel discoveries to attempt")
124-
CrawlCmd.PersistentFlags().Uint64VarP(&inputCrawlParams.NetworkID, "network-id", "n", 0, "Filter discovered nodes by this network id")
125-
CrawlCmd.PersistentFlags().StringVarP(&inputCrawlParams.Database, "database", "d", "", "Node database for updating and storing client information")
126-
CrawlCmd.PersistentFlags().StringVarP(&inputCrawlParams.RevalidationInterval, "revalidation-interval", "r", "10m", "Time before retrying to connect to a failed peer")
127-
CrawlCmd.PersistentFlags().BoolVarP(&inputCrawlParams.OnlyURLs, "only-urls", "u", true, "Only writes the enode URLs to the output")
122+
CrawlCmd.Flags().StringVarP(&inputCrawlParams.Timeout, "timeout", "t", "30m0s", "Time limit for the crawl")
123+
CrawlCmd.Flags().IntVarP(&inputCrawlParams.Threads, "parallel", "p", 16, "How many parallel discoveries to attempt")
124+
CrawlCmd.Flags().Uint64VarP(&inputCrawlParams.NetworkID, "network-id", "n", 0, "Filter discovered nodes by this network id")
125+
CrawlCmd.Flags().StringVarP(&inputCrawlParams.Database, "database", "d", "", "Node database for updating and storing client information")
126+
CrawlCmd.Flags().StringVarP(&inputCrawlParams.RevalidationInterval, "revalidation-interval", "r", "10m", "Time before retrying to connect to a failed peer")
127+
CrawlCmd.Flags().BoolVarP(&inputCrawlParams.OnlyURLs, "only-urls", "u", true, "Only writes the enode URLs to the output")
128128
}

cmd/p2p/nodelist/nodelist.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ var NodeListCmd = &cobra.Command{
5757
}
5858

5959
func init() {
60-
NodeListCmd.PersistentFlags().IntVarP(&inputNodeListParams.Limit, "limit", "l", 100, "Number of unique nodes to return")
61-
NodeListCmd.PersistentFlags().StringVarP(&inputNodeListParams.ProjectID, "project-id", "p", "", "GCP project ID")
60+
NodeListCmd.Flags().IntVarP(&inputNodeListParams.Limit, "limit", "l", 100, "Number of unique nodes to return")
61+
NodeListCmd.Flags().StringVarP(&inputNodeListParams.ProjectID, "project-id", "p", "", "GCP project ID")
6262
}

cmd/p2p/ping/ping.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type (
1818
OutputFile string
1919
NodesFile string
2020
Listen bool
21+
Port uint
22+
Addr bool
2123
KeyFile string
2224
PrivateKey string
2325

@@ -140,11 +142,15 @@ can see other messages the peer sends (e.g. blocks, transactions, etc.).`,
140142
}
141143

142144
func init() {
143-
PingCmd.PersistentFlags().StringVarP(&inputPingParams.OutputFile, "output", "o", "", "Write ping results to output file (default stdout)")
144-
PingCmd.PersistentFlags().IntVarP(&inputPingParams.Threads, "parallel", "p", 16, "How many parallel pings to attempt")
145-
PingCmd.PersistentFlags().BoolVarP(&inputPingParams.Listen, "listen", "l", true,
145+
PingCmd.Flags().StringVarP(&inputPingParams.OutputFile, "output", "o", "", "Write ping results to output file (default stdout)")
146+
PingCmd.Flags().IntVarP(&inputPingParams.Threads, "parallel", "p", 16, "How many parallel pings to attempt")
147+
PingCmd.Flags().BoolVarP(&inputPingParams.Listen, "listen", "l", true,
146148
`Keep the connection open and listen to the peer. This only works if the first
147149
argument is an enode/enr, not a nodes file.`)
150+
PingCmd.Flags().BoolVarP(&inputPingParams.Listen, "listen", "l", true,
151+
`Keep the connection open and listen to the peer. This only works if the first
152+
argument is an enode/enr, not a nodes file.`)
153+
PingCmd.Flags().UintVarP(&inputPingParams.Port, "port", "P", 30303, "The port to listen on")
148154
PingCmd.Flags().StringVarP(&inputPingParams.KeyFile, "key-file", "k", "", "Private key file (cannot be set with --key)")
149155
PingCmd.Flags().StringVar(&inputPingParams.PrivateKey, "key", "", "Hex-encoded private key (cannot be set with --key-file)")
150156
PingCmd.MarkFlagsMutuallyExclusive("key-file", "key")

cmd/p2p/sensor/sensor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ func init() {
501501
if err := SensorCmd.MarkFlagRequired("network-id"); err != nil {
502502
log.Error().Err(err).Msg("Failed to mark network-id as required persistent flag")
503503
}
504-
SensorCmd.PersistentFlags().StringVarP(&inputSensorParams.ProjectID, "project-id", "p", "", "GCP project ID")
505-
SensorCmd.PersistentFlags().StringVarP(&inputSensorParams.DatabaseID, "database-id", "d", "", "Datastore database ID")
504+
SensorCmd.Flags().StringVarP(&inputSensorParams.ProjectID, "project-id", "p", "", "GCP project ID")
505+
SensorCmd.Flags().StringVarP(&inputSensorParams.DatabaseID, "database-id", "d", "", "Datastore database ID")
506506
SensorCmd.Flags().StringVarP(&inputSensorParams.SensorID, "sensor-id", "s", "", "Sensor ID when writing block/tx events")
507507
if err := SensorCmd.MarkFlagRequired("sensor-id"); err != nil {
508508
log.Error().Err(err).Msg("Failed to mark sensor-id as required persistent flag")

0 commit comments

Comments
 (0)