chore: rename/reorder legacy filter flags

This commit is contained in:
Richard Ramos 2023-04-26 09:42:17 -04:00
parent 7f276d572f
commit c479daa926
No known key found for this signature in database
GPG Key ID: 1CE87DB518195760
2 changed files with 22 additions and 22 deletions

View File

@ -269,18 +269,6 @@ var (
Destination: &options.Filter.Enable, Destination: &options.Filter.Enable,
EnvVars: []string{"WAKUNODE2_FILTER"}, 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{ FilterNode = cliutils.NewGenericFlagMultiValue(&cli.GenericFlag{
Name: "filternode", Name: "filternode",
Usage: "Multiaddr of a peer that supports filter protocol. Option may be repeated", Usage: "Multiaddr of a peer that supports filter protocol. Option may be repeated",
@ -289,6 +277,25 @@ var (
}, },
EnvVars: []string{"WAKUNODE2_FILTERNODE"}, 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{ FilterLegacyNode = cliutils.NewGenericFlagMultiValue(&cli.GenericFlag{
Name: "legacy-filternode", Name: "legacy-filternode",
Usage: "Multiaddr of a peer that supports legacy filter protocol. Option may be repeated", Usage: "Multiaddr of a peer that supports legacy filter protocol. Option may be repeated",
@ -297,13 +304,6 @@ var (
}, },
EnvVars: []string{"WAKUNODE2_LEGACY_FILTERNODE"}, 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{ LightPush = altsrc.NewBoolFlag(&cli.BoolFlag{
Name: "lightpush", Name: "lightpush",
Usage: "Enable lightpush protocol", Usage: "Enable lightpush protocol",

View File

@ -54,11 +54,11 @@ func main() {
StoreMessageRetentionCapacity, StoreMessageRetentionCapacity,
StoreResumePeer, StoreResumePeer,
FilterFlag, FilterFlag,
FilterLegacyFlag,
LightClient,
FilterNode, FilterNode,
FilterLegacyNode,
FilterTimeout, FilterTimeout,
FilterLegacyFlag,
FilterLegacyNode,
FilterLegacyLightClient,
LightPush, LightPush,
LightPushNode, LightPushNode,
Discv5Discovery, Discv5Discovery,