From c479daa9269190ed0289faba75d85b86b0c8bc09 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 26 Apr 2023 09:42:17 -0400 Subject: [PATCH] chore: rename/reorder legacy filter flags --- cmd/waku/flags.go | 38 +++++++++++++++++++------------------- cmd/waku/main.go | 6 +++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmd/waku/flags.go b/cmd/waku/flags.go index 7fc8daf3..f9cf6f81 100644 --- a/cmd/waku/flags.go +++ b/cmd/waku/flags.go @@ -269,18 +269,6 @@ var ( Destination: &options.Filter.Enable, EnvVars: []string{"WAKUNODE2_FILTER"}, }) - FilterLegacyFlag = altsrc.NewBoolFlag(&cli.BoolFlag{ - Name: "use-filter-legacy", - Usage: "Use filter protocol (legacy)", - Destination: &options.Filter.UseV1, - EnvVars: []string{"WAKUNODE2_USE_FILTER_LEGACY"}, - }) - LightClient = altsrc.NewBoolFlag(&cli.BoolFlag{ - Name: "light-client", - Usage: "Don't accept filter subscribers (only for filter-legacy)", - Destination: &options.Filter.DisableFullNode, - EnvVars: []string{"WAKUNODE2_LIGHT_CLIENT"}, - }) FilterNode = cliutils.NewGenericFlagMultiValue(&cli.GenericFlag{ Name: "filternode", Usage: "Multiaddr of a peer that supports filter protocol. Option may be repeated", @@ -289,6 +277,25 @@ var ( }, EnvVars: []string{"WAKUNODE2_FILTERNODE"}, }) + FilterTimeout = altsrc.NewDurationFlag(&cli.DurationFlag{ + Name: "filter-timeout", + Value: 14400 * time.Second, + Usage: "Timeout for filter node in seconds", + Destination: &options.Filter.Timeout, + EnvVars: []string{"WAKUNODE2_FILTER_TIMEOUT"}, + }) + FilterLegacyFlag = altsrc.NewBoolFlag(&cli.BoolFlag{ + Name: "legacy-filter", + Usage: "Use filter protocol (legacy)", + Destination: &options.Filter.UseV1, + EnvVars: []string{"WAKUNODE2_USE_LEGACY_FILTER"}, + }) + FilterLegacyLightClient = altsrc.NewBoolFlag(&cli.BoolFlag{ + Name: "legacy-filter-light-client", + Usage: "Don't accept legacy filter subscribers", + Destination: &options.Filter.DisableFullNode, + EnvVars: []string{"WAKUNODE2_LEGACY_FILTER_LIGHT_CLIENT"}, + }) FilterLegacyNode = cliutils.NewGenericFlagMultiValue(&cli.GenericFlag{ Name: "legacy-filternode", Usage: "Multiaddr of a peer that supports legacy filter protocol. Option may be repeated", @@ -297,13 +304,6 @@ var ( }, EnvVars: []string{"WAKUNODE2_LEGACY_FILTERNODE"}, }) - FilterTimeout = altsrc.NewDurationFlag(&cli.DurationFlag{ - Name: "filter-timeout", - Value: 14400 * time.Second, - Usage: "Timeout for filter node in seconds", - Destination: &options.Filter.Timeout, - EnvVars: []string{"WAKUNODE2_FILTER_TIMEOUT"}, - }) LightPush = altsrc.NewBoolFlag(&cli.BoolFlag{ Name: "lightpush", Usage: "Enable lightpush protocol", diff --git a/cmd/waku/main.go b/cmd/waku/main.go index 389b4e70..b2feb63b 100644 --- a/cmd/waku/main.go +++ b/cmd/waku/main.go @@ -54,11 +54,11 @@ func main() { StoreMessageRetentionCapacity, StoreResumePeer, FilterFlag, - FilterLegacyFlag, - LightClient, FilterNode, - FilterLegacyNode, FilterTimeout, + FilterLegacyFlag, + FilterLegacyNode, + FilterLegacyLightClient, LightPush, LightPushNode, Discv5Discovery,