From 8f7c4013f94eb3534e03d44b43d2e28fa59db3e0 Mon Sep 17 00:00:00 2001 From: Moses Narrow Date: Sun, 22 Sep 2024 12:52:41 -0500 Subject: [PATCH] update vendor deps --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go | 13 ++++++++++--- .../skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go | 4 ++-- .../github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go | 12 ++++++++++-- vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go | 2 +- .../skycoin/dmsg/pkg/dmsgserver/config.go | 12 ++++++++---- vendor/modules.txt | 2 +- 8 files changed, 35 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 36ae1bda..3c524e3f 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/json-iterator/go v1.1.12 github.com/rs/cors v1.8.2 github.com/sirupsen/logrus v1.9.3 - github.com/skycoin/dmsg v1.3.26-0.20240910062314-dc25f3d9ea6c + github.com/skycoin/dmsg v1.3.26-0.20240922174815-ced25b343ec5 github.com/skycoin/skywire v1.3.26-0.20240922162315-789cef41c9a1 github.com/skycoin/skywire-utilities v1.3.25 github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 diff --git a/go.sum b/go.sum index a634fa6b..9ea6a64f 100644 --- a/go.sum +++ b/go.sum @@ -391,8 +391,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd 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.26-0.20240910062314-dc25f3d9ea6c h1:7miiImujaW74EAD/cqs6tAXzoVRK7K9yk69R8oqKC/g= -github.com/skycoin/dmsg v1.3.26-0.20240910062314-dc25f3d9ea6c/go.mod h1:3pyc9MmDJQYP0spTAWKLMctz4+ZKjMZgXtdMmXpYolw= +github.com/skycoin/dmsg v1.3.26-0.20240922174815-ced25b343ec5 h1:992WLADQdKjZbpJYdw0EYuOaI7mKHQQ57jDFebvUYPs= +github.com/skycoin/dmsg v1.3.26-0.20240922174815-ced25b343ec5/go.mod h1:qfF8cAig3JHLAojmfYEWn8ttV4aHsiitkZeD1TH8Wrg= 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 2718c8c2..ac3e8570 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/const.go @@ -4,13 +4,11 @@ package dmsg import ( "time" - "github.com/skycoin/skywire-utilities/pkg/skyenv" + "github.com/skycoin/skywire" ) // Constants. const ( - DefaultDiscAddr = skyenv.DmsgDiscAddr - DefaultMinSessions = 1 DefaultUpdateInterval = time.Minute @@ -23,3 +21,12 @@ const ( DefaultCommunityDmsgServerType = "community" ) + +// DiscAddr returns the address of the dmsg discovery +func DiscAddr(testenv bool) string { + if testenv { + return skywire.Prod.DmsgDiscovery + + } + return skywire.Test.DmsgDiscovery +} diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go index 20bf02f4..d713115e 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/dmsgcurl.go @@ -22,7 +22,7 @@ import ( "github.com/skycoin/dmsg/pkg/dmsghttp" ) -var json = jsoniter.ConfigFastest +var jsonite = jsoniter.ConfigFastest // DmsgCurl contains the logic for dmsgcurl (curl over dmsg). type DmsgCurl struct { @@ -58,7 +58,7 @@ func (dg *DmsgCurl) String() string { for _, fg := range dg.flagGroups() { m[fg.Name()] = fg } - j, err := json.Marshal(m) + j, err := jsonite.Marshal(m) if err != nil { panic(err) } diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go index 4f07c228..4a5264c6 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgcurl/flags.go @@ -2,10 +2,11 @@ package dmsgcurl import ( + "encoding/json" "flag" + "github.com/skycoin/skywire" "github.com/skycoin/skywire-utilities/pkg/buildinfo" - "github.com/skycoin/skywire-utilities/pkg/skyenv" ) // ExecName contains the execution name. @@ -39,7 +40,14 @@ type dmsgFlags struct { func (f *dmsgFlags) Name() string { return "Dmsg" } func (f *dmsgFlags) Init(fs *flag.FlagSet) { - fs.StringVar(&f.Disc, "dmsg-disc", skyenv.DmsgDiscAddr, "dmsg discovery `URL`") + var envServices skywire.EnvServices + var services skywire.Services + if err := json.Unmarshal([]byte(skywire.ServicesJSON), &envServices); err == nil { + if err := json.Unmarshal(envServices.Prod, &services); err == nil { + f.Disc = services.DmsgDiscovery + } + } + fs.StringVar(&f.Disc, "dmsg-disc", f.Disc, "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/dmsgpty/conf.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go index 1fda2d47..61a1a3c5 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgpty/conf.go @@ -26,7 +26,7 @@ type Config struct { // DefaultConfig is used to populate the config struct with its default values func DefaultConfig() Config { return Config{ - DmsgDisc: dmsg.DefaultDiscAddr, + DmsgDisc: dmsg.DiscAddr(false), DmsgSessions: dmsg.DefaultMinSessions, DmsgPort: DefaultPort, CLINet: DefaultCLINet, diff --git a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go index 27c3fb2e..396c6258 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsgserver/config.go @@ -8,20 +8,24 @@ import ( "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire-utilities/pkg/cipher" - "github.com/skycoin/skywire-utilities/pkg/skyenv" + + "github.com/skycoin/dmsg/pkg/dmsg" ) const ( - 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 = skyenv.TestDmsgDiscAddr ) +var defaultDiscoveryURL = dmsg.DiscAddr(false) + +// DefaultDiscoverURLTest default URL for discovery in test env +var DefaultDiscoverURLTest = dmsg.DiscAddr(true) + // Config is structure of config file type Config struct { Path string `json:"-"` diff --git a/vendor/modules.txt b/vendor/modules.txt index 4fbdb877..f6a4f40f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -457,7 +457,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.26-0.20240910062314-dc25f3d9ea6c +# github.com/skycoin/dmsg v1.3.26-0.20240922174815-ced25b343ec5 ## explicit; go 1.21 github.com/skycoin/dmsg/internal/servermetrics github.com/skycoin/dmsg/pkg/direct