diff --git a/cmd/skywire-cli/commands/log/log.go b/cmd/skywire-cli/commands/log/log.go index 6d60cdda76..087898cf6a 100644 --- a/cmd/skywire-cli/commands/log/log.go +++ b/cmd/skywire-cli/commands/log/log.go @@ -30,7 +30,6 @@ import ( func init() { logCmd.Flags().SortFlags = false - logCmd.Flags().StringVarP(&env, "env", "e", "prod", "deployment to get uptimes from") logCmd.Flags().BoolVarP(&logOnly, "log", "l", false, "fetch only transport logs") logCmd.Flags().BoolVarP(&surveyOnly, "survey", "v", false, "fetch only surveys") logCmd.Flags().StringVarP(&fetchFile, "file", "f", "", "fetch only a specific file from all online visors") @@ -44,7 +43,7 @@ func init() { logCmd.Flags().IntVar(&batchSize, "batchSize", 50, "number of visor in each batch") logCmd.Flags().Int64Var(&maxFileSize, "maxfilesize", 1024, "maximum file size allowed to download during collecting logs, in KB") logCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "D", skyenv.DmsgDiscAddr, "dmsg discovery url\n") - logCmd.Flags().StringVarP(&utAddr, "ut", "u", "", "custom uptime tracker url") + logCmd.Flags().StringVarP(&utAddr, "ut", "u", skyenv.UptimeTrackerAddr, "uptime tracker url\n") if os.Getenv("DMSGCURL_SK") != "" { sk.Set(os.Getenv("DMSGCURL_SK")) //nolint } @@ -91,17 +90,10 @@ var logCmd = &cobra.Command{ flag.Parse() // Set the uptime tracker to fetch data from - endpoint := skyenv.UptimeTrackerAddr - if env == "test" { - endpoint = skyenv.TestUptimeTrackerAddr - } - endpoint = endpoint + "/uptimes?v=v2" - if utAddr != "" { - endpoint = utAddr - } + endpoint := utAddr + "/uptimes?v=v2" if fetchFrom != "" { - endpoint = endpoint + "&visors=" + fetchFrom + endpoint = utAddr + "&visors=" + fetchFrom } //Fetch the uptime data over http diff --git a/cmd/skywire-cli/commands/log/root.go b/cmd/skywire-cli/commands/log/root.go index a14471f675..0056d54cfb 100644 --- a/cmd/skywire-cli/commands/log/root.go +++ b/cmd/skywire-cli/commands/log/root.go @@ -7,7 +7,6 @@ import ( var ( pubKey string - env string duration int minv string allVisors bool diff --git a/go.mod b/go.mod index d9521ba1b6..2b5dcf24e6 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/pterm/pterm v0.12.66 github.com/robert-nix/ansihtml v1.0.1 github.com/sirupsen/logrus v1.9.3 - github.com/skycoin/dmsg v1.3.22-0.20240627165206-e8cd649ecc88 + github.com/skycoin/dmsg v1.3.22-0.20240702162730-1c2fcecd4bb6 github.com/skycoin/skycoin v0.27.1 github.com/skycoin/skycoin-service-discovery v0.0.0-20240627171358-7f59a951fa29 github.com/skycoin/skywire-services v0.0.0-20240627171623-87edf49d9025 diff --git a/go.sum b/go.sum index 94df63527c..8722c739e4 100644 --- a/go.sum +++ b/go.sum @@ -682,8 +682,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skycoin/dmsg v1.3.22-0.20240627165206-e8cd649ecc88 h1:ENFkdPTq1Um9uoYXAh3h0WTUpJjDHhVZZevsbbP2fyw= -github.com/skycoin/dmsg v1.3.22-0.20240627165206-e8cd649ecc88/go.mod h1:v56TVWnlz18J4qrVFxjOyjzg153XSuay9Y76AUb35ac= +github.com/skycoin/dmsg v1.3.22-0.20240702162730-1c2fcecd4bb6 h1:q+KeZyHWctCahSUbZ6b+iy1VQNHVKN2YZc7J2R0VIHw= +github.com/skycoin/dmsg v1.3.22-0.20240702162730-1c2fcecd4bb6/go.mod h1:72MC0HFDxKYqMLZ2RWGY/ZDNFq6965SP1PIrKlYqaiQ= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.27.1 h1:HatxsRwVSPaV4qxH6290xPBmkH/HgiuAoY2qC+e8C9I= diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go index 731c2bc8d6..2718c8c2a6 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go @@ -3,11 +3,13 @@ package dmsg import ( "time" + + "github.com/skycoin/skywire-utilities/pkg/skyenv" ) // Constants. const ( - DefaultDiscAddr = "http://dmsgd.skywire.skycoin.com" + DefaultDiscAddr = skyenv.DmsgDiscAddr DefaultMinSessions = 1 diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go index e763a05994..4f07c22820 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go @@ -5,6 +5,7 @@ import ( "flag" "github.com/skycoin/skywire-utilities/pkg/buildinfo" + "github.com/skycoin/skywire-utilities/pkg/skyenv" ) // ExecName contains the execution name. @@ -38,7 +39,7 @@ type dmsgFlags struct { func (f *dmsgFlags) Name() string { return "Dmsg" } func (f *dmsgFlags) Init(fs *flag.FlagSet) { - fs.StringVar(&f.Disc, "dmsg-disc", "http://dmsgd.skywire.skycoin.com", "dmsg discovery `URL`") + fs.StringVar(&f.Disc, "dmsg-disc", skyenv.DmsgDiscAddr, "dmsg discovery `URL`") fs.IntVar(&f.Sessions, "dmsg-sessions", 1, "connect to `NUMBER` of dmsg servers") } diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go index 98b3f98901..27c3fb2e5b 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go @@ -8,17 +8,18 @@ import ( "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire-utilities/pkg/cipher" + "github.com/skycoin/skywire-utilities/pkg/skyenv" ) const ( - defaultDiscoveryURL = "http://dmsgd.skywire.skycoin.com" + defaultDiscoveryURL = skyenv.DmsgDiscAddr defaultPublicAddress = "127.0.0.1:8081" defaultLocalAddress = ":8081" defaultHTTPAddress = ":8082" // DefaultConfigPath default path of config file DefaultConfigPath = "config.json" // DefaultDiscoverURLTest default URL for discovery in test env - DefaultDiscoverURLTest = "http://dmsgd.skywire.dev" + DefaultDiscoverURLTest = skyenv.TestDmsgDiscAddr ) // Config is structure of config file diff --git a/vendor/modules.txt b/vendor/modules.txt index 20782479aa..3abd4790b3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -486,7 +486,7 @@ github.com/rs/cors ## explicit; go 1.13 github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog -# github.com/skycoin/dmsg v1.3.22-0.20240627165206-e8cd649ecc88 +# github.com/skycoin/dmsg v1.3.22-0.20240702162730-1c2fcecd4bb6 ## explicit; go 1.21 github.com/skycoin/dmsg/cmd/dmsg-discovery/commands github.com/skycoin/dmsg/cmd/dmsg-server/commands