diff --git a/cmd/address-resolver/commands/root.go b/cmd/address-resolver/commands/root.go index 5c54d6c6..03cc55be 100644 --- a/cmd/address-resolver/commands/root.go +++ b/cmd/address-resolver/commands/root.go @@ -49,6 +49,7 @@ var ( testEnvironment bool sk cipher.SecKey dmsgPort uint16 + dmsgServerType string ) func init() { @@ -64,6 +65,7 @@ func init() { RootCmd.Flags().BoolVar(&testEnvironment, "test-environment", false, "distinguished between prod and test environment\033[0m") RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\r") RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + RootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp handler") var helpflag bool RootCmd.SetUsageTemplate(help) RootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for address-resolver") @@ -195,8 +197,9 @@ skywire svc ar --addr ":9093" --redis "redis://localhost:6379" --sk $(tail -n1 a keys = append(keys, pk) dClient := direct.NewClient(direct.GetAllEntries(keys, servers), logger) config := &dmsg.Config{ - MinSessions: 0, // listen on all available servers - UpdateInterval: dmsg.DefaultUpdateInterval, + MinSessions: 0, // listen on all available servers + UpdateInterval: dmsg.DefaultUpdateInterval, + ConnectedServersType: dmsgServerType, } dmsgDC, closeDmsgDC, err := direct.StartDmsg(ctx, logger, pk, sk, dClient, config) diff --git a/cmd/config-bootstrapper/commands/root.go b/cmd/config-bootstrapper/commands/root.go index 658d07b1..cbc9c23b 100644 --- a/cmd/config-bootstrapper/commands/root.go +++ b/cmd/config-bootstrapper/commands/root.go @@ -25,13 +25,14 @@ import ( ) var ( - addr string - tag string - stunPath string - domain string - dmsgDisc string - sk cipher.SecKey - dmsgPort uint16 + addr string + tag string + stunPath string + domain string + dmsgDisc string + sk cipher.SecKey + dmsgPort uint16 + dmsgServerType string ) func init() { @@ -42,6 +43,7 @@ func init() { RootCmd.Flags().StringVar(&dmsgDisc, "dmsg-disc", "http://dmsgd.skywire.skycoin.com", "url of dmsg-discovery\033[0m") RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\r") RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + RootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp handler") } // RootCmd contains the root command @@ -92,8 +94,9 @@ var RootCmd = &cobra.Command{ keys = append(keys, pk) dClient := direct.NewClient(direct.GetAllEntries(keys, servers), logger) config := &dmsg.Config{ - MinSessions: 0, // listen on all available servers - UpdateInterval: dmsg.DefaultUpdateInterval, + MinSessions: 0, // listen on all available servers + UpdateInterval: dmsg.DefaultUpdateInterval, + ConnectedServersType: dmsgServerType, } dmsgDC, closeDmsgDC, err := direct.StartDmsg(ctx, logger, pk, sk, dClient, config) diff --git a/cmd/route-finder/commands/root.go b/cmd/route-finder/commands/root.go index a9d104c6..b717b421 100644 --- a/cmd/route-finder/commands/root.go +++ b/cmd/route-finder/commands/root.go @@ -29,17 +29,18 @@ import ( ) var ( - addr string - metricsAddr string - pgHost string - pgPort string - logLvl string - tag string - testing bool - dmsgDisc string - sk cipher.SecKey - dmsgPort uint16 - pgMaxOpenConn int + addr string + metricsAddr string + pgHost string + pgPort string + logLvl string + tag string + testing bool + dmsgDisc string + sk cipher.SecKey + dmsgPort uint16 + dmsgServerType string + pgMaxOpenConn int ) func init() { @@ -54,6 +55,7 @@ func init() { RootCmd.Flags().StringVar(&dmsgDisc, "dmsg-disc", "http://dmsgd.skywire.skycoin.com", "url of dmsg-discovery\033[0m") RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\r") RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + RootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp handler") } // RootCmd contains the root command @@ -150,8 +152,9 @@ PG_USER="postgres" PG_DATABASE="rf" PG_PASSWORD="" route-finder --addr ":9092" keys = append(keys, pk) dClient := direct.NewClient(direct.GetAllEntries(keys, servers), logger) config := &dmsg.Config{ - MinSessions: 0, // listen on all available servers - UpdateInterval: dmsg.DefaultUpdateInterval, + MinSessions: 0, // listen on all available servers + UpdateInterval: dmsg.DefaultUpdateInterval, + ConnectedServersType: dmsgServerType, } dmsgDC, closeDmsgDC, err := direct.StartDmsg(ctx, logger, pk, sk, dClient, config) diff --git a/cmd/transport-discovery/commands/root.go b/cmd/transport-discovery/commands/root.go index 35ba9ee9..0115d520 100644 --- a/cmd/transport-discovery/commands/root.go +++ b/cmd/transport-discovery/commands/root.go @@ -51,6 +51,7 @@ var ( testEnvironment bool sk cipher.SecKey dmsgPort uint16 + dmsgServerType string pgMaxOpenConn int ) @@ -70,6 +71,7 @@ func init() { RootCmd.Flags().BoolVar(&testEnvironment, "test-environment", false, "distinguished between prod and test environment\033[0m") RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\r") RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + RootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp handler") } // RootCmd contains the root command @@ -204,8 +206,9 @@ PG_USER="postgres" PG_DATABASE="tpd" PG_PASSWORD="" transport-discovery --sk $(t keys = append(keys, pk) dClient := direct.NewClient(direct.GetAllEntries(keys, servers), logger) config := &dmsg.Config{ - MinSessions: 0, // listen on all available servers - UpdateInterval: dmsg.DefaultUpdateInterval, + MinSessions: 0, // listen on all available servers + UpdateInterval: dmsg.DefaultUpdateInterval, + ConnectedServersType: dmsgServerType, } dmsgDC, closeDmsgDC, err := direct.StartDmsg(ctx, logger, pk, sk, dClient, config) diff --git a/cmd/uptime-tracker/commands/root.go b/cmd/uptime-tracker/commands/root.go index 6e3df5e1..ef62d671 100644 --- a/cmd/uptime-tracker/commands/root.go +++ b/cmd/uptime-tracker/commands/root.go @@ -53,6 +53,7 @@ var ( dmsgDisc string sk cipher.SecKey dmsgPort uint16 + dmsgServerType string storeDataCutoff int storeDataPath string ) @@ -76,6 +77,7 @@ func init() { rootCmd.Flags().StringVar(&dmsgDisc, "dmsg-disc", "http://dmsgd.skywire.skycoin.com", "url of dmsg-discovery") rootCmd.Flags().Var(&sk, "sk", "dmsg secret key") rootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + rootCmd.Flags().StringVar(&dmsgServerType, "dmsg-server-type", "", "type of dmsg server on dmsghttp handler") } var rootCmd = &cobra.Command{ @@ -184,8 +186,9 @@ var rootCmd = &cobra.Command{ keys = append(keys, pk) dClient := direct.NewClient(direct.GetAllEntries(keys, servers), logger) config := &dmsg.Config{ - MinSessions: 0, // listen on all available servers - UpdateInterval: dmsg.DefaultUpdateInterval, + MinSessions: 0, // listen on all available servers + UpdateInterval: dmsg.DefaultUpdateInterval, + ConnectedServersType: dmsgServerType, } dmsgDC, closeDmsgDC, err := direct.StartDmsg(ctx, logger, pk, sk, dClient, config)