From efcd42dea244cd6c588d17bffaa69bb148c31865 Mon Sep 17 00:00:00 2001 From: josh <josh@elixxir.io> Date: Mon, 5 Apr 2021 14:44:05 -0700 Subject: [PATCH] Make fast polling a configurable option --- README.md | 2 ++ cmd/root.go | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 98a8c6b0b..b5d507f47 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,8 @@ Flags: base64 representations) (default "0") --forceHistoricalRounds Force all rounds to be sent to historical round retrieval + --fastPolling bool Enables polling for filtered network updates. + Defaults to true if not set -h, --help help for client -l, --log string Path to the log output path (- is stdout) (default "-") diff --git a/cmd/root.go b/cmd/root.go index 95dc23912..391333e2d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -309,6 +309,7 @@ func createClient() *api.Client { netParams.E2EParams.NumRekeys = uint16( viper.GetUint("e2eNumReKeys")) netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds") + netParams.FastPolling = viper.GetBool("fastPolling") client, err := api.OpenClient(storeDir, []byte(pass), netParams) if err != nil { @@ -329,6 +330,7 @@ func initClient() *api.Client { netParams.E2EParams.NumRekeys = uint16( viper.GetUint("e2eNumReKeys")) netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds") + netParams.FastPolling = viper.GetBool("fastPolling") //load the client client, err := api.Login(storeDir, []byte(pass), netParams) @@ -722,6 +724,12 @@ func init() { viper.BindPFlag("forceHistoricalRounds", rootCmd.Flags().Lookup("forceHistoricalRounds")) + // Network params + rootCmd.Flags().BoolP("fastPolling", "", true, + "Enables polling for filtered network updates") + viper.BindPFlag("fastPolling", + rootCmd.Flags().Lookup("fastPolling")) + // E2E Params defaultE2EParams := params.GetDefaultE2ESessionParams() rootCmd.Flags().UintP("e2eMinKeys", -- GitLab