Skip to content
Snippets Groups Projects
Commit b1cf5ad3 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Command line hookup for E2E Session Parameters

parent 71be5e93
No related branches found
No related tags found
No related merge requests found
...@@ -229,6 +229,14 @@ func initClient() *api.Client { ...@@ -229,6 +229,14 @@ func initClient() *api.Client {
storeDir := viper.GetString("session") storeDir := viper.GetString("session")
netParams := params.GetDefaultNetwork() netParams := params.GetDefaultNetwork()
netParams.E2EParams.MinKeys = uint16(viper.GetUint("e2eMinKeys"))
netParams.E2EParams.MaxKeys = uint16(viper.GetUint("e2eMaxKeys"))
netParams.E2EParams.NumRekeys = uint16(
viper.GetUint("e2eNumReKeys"))
netParams.E2EParams.TTLParams.TTLScalar = float64(
viper.GetUint("e2eTTLScalar"))
netParams.E2EParams.TTLParams.MinNumKeys = uint16(
viper.GetUint("e2eTTLMinNumKeys"))
netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds") netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds")
//load the client //load the client
...@@ -624,6 +632,31 @@ func init() { ...@@ -624,6 +632,31 @@ func init() {
"Force all rounds to be sent to historical round retrieval") "Force all rounds to be sent to historical round retrieval")
viper.BindPFlag("forceHistoricalRounds", viper.BindPFlag("forceHistoricalRounds",
rootCmd.Flags().Lookup("forceHistoricalRounds")) rootCmd.Flags().Lookup("forceHistoricalRounds"))
// E2E Params
defaultE2EParams := params.GetDefaultE2ESessionParams()
rootCmd.Flags().UintP("e2eMinKeys",
"", uint(defaultE2EParams.MinKeys),
"Minimum number of keys used before requesting rekey")
viper.BindPFlag("MinKeys", rootCmd.Flags().Lookup("e2eMinKeys"))
rootCmd.Flags().UintP("e2eMaxKeys",
"", uint(defaultE2EParams.MaxKeys),
"Max keys used before blocking until a rekey completes")
viper.BindPFlag("e2eMaxKeys", rootCmd.Flags().Lookup("e2eMaxKeys"))
rootCmd.Flags().UintP("e2eNumReKeys",
"", uint(defaultE2EParams.NumRekeys),
"Number of rekeys held in memory at once")
viper.BindPFlag("e2eNumReKeys", rootCmd.Flags().Lookup("e2eNumReKeys"))
rootCmd.Flags().Float64P("e2eTTLScalar",
"", defaultE2EParams.TTLParams.TTLScalar,
"Time to live key retrigger setting")
viper.BindPFlag("e2eTTLScalar", rootCmd.Flags().Lookup("e2eTTLScalar"))
rootCmd.Flags().UintP("e2eTTLMinNumKeys",
"", uint(defaultE2EParams.TTLParams.MinNumKeys),
"Minimum number of keys used in the TTL")
viper.BindPFlag("e2eTTLMinNumKeys",
rootCmd.Flags().Lookup("e2eTTLMinNumKeys"))
} }
// initConfig reads in config file and ENV variables if set. // initConfig reads in config file and ENV variables if set.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment