From d4e955cce768113425de951e8b00b18d21698c3e Mon Sep 17 00:00:00 2001 From: Mohammed Date: Mon, 9 Sep 2024 12:17:27 +0000 Subject: [PATCH 1/5] add --dmsg-server-type flag to ar --- cmd/address-resolver/commands/root.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) From 08a943bf2ed66da146bf95c0be792443934e3723 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Mon, 9 Sep 2024 12:18:58 +0000 Subject: [PATCH 2/5] add --dmsg-server-type flag to conf --- cmd/config-bootstrapper/commands/root.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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) From 50aa633a32af71ea9469a887a3558c576abbafc2 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Mon, 9 Sep 2024 12:20:34 +0000 Subject: [PATCH 3/5] add --dmsg-server-type flag to rf --- cmd/route-finder/commands/root.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) 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) From e101467735e0a76302728d285f4fda7933b2fa55 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Mon, 9 Sep 2024 12:21:31 +0000 Subject: [PATCH 4/5] add --dmsg-server-type flag to tpd --- cmd/transport-discovery/commands/root.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) From b91b4d33a39314018eb8baa244b3bec681eefd21 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Mon, 9 Sep 2024 12:22:27 +0000 Subject: [PATCH 5/5] add --dmsg-server-type flag to ut --- cmd/uptime-tracker/commands/root.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)