From 724b119283238292d653852ead1aed3a3447897e Mon Sep 17 00:00:00 2001 From: Mohammed Date: Mon, 25 Mar 2024 23:17:13 +0000 Subject: [PATCH] upgrade dsmg to v1.3.20 --- go.mod | 3 +-- go.sum | 4 ++-- .../skycoin/dmsg/pkg/dmsg/client.go | 21 +++++++++++++++---- vendor/modules.txt | 3 +-- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index a72dd4d4..0a5636f8 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.18-0.20240311074627-0ba753f65a88 + github.com/skycoin/dmsg v1.3.20 github.com/skycoin/skywire v1.3.21-0.20240325224529-17f630c7a259 github.com/skycoin/skywire-utilities v1.3.18-0.20240208220612-9f31eda72f33 github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 @@ -158,7 +158,6 @@ require ( // Uncomment it for tests with alternative branches and run `make dep` // replace github.com/skycoin/dmsg => ../dmsg -replace github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 // replace github.com/skycoin/skywire => ../skywire diff --git a/go.sum b/go.sum index a8924dbf..94bf8d87 100644 --- a/go.sum +++ b/go.sum @@ -401,8 +401,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.18-0.20240226072009-86c43e8d4ca4 h1:sWspjJ1xySLaEOV2I1IZz3vyx3Fxs5fnxegR3u0mH3k= -github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4/go.mod h1:INEDx+ECwCGQWw/Kd0QcLmSWMhbeRRcfkxj+xATQGFg= +github.com/skycoin/dmsg v1.3.20 h1:iPC+u05Le3sIGKQB2imfPv1eBJpk3lh71c50MkqMylw= +github.com/skycoin/dmsg v1.3.20/go.mod h1:INEDx+ECwCGQWw/Kd0QcLmSWMhbeRRcfkxj+xATQGFg= 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/client.go b/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go index e6ad91a7..679629a5 100644 --- a/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go +++ b/vendor/github.com/skycoin/dmsg/pkg/dmsg/client.go @@ -41,10 +41,11 @@ func (sc *ClientCallbacks) ensure() { // Config configures a dmsg client entity. type Config struct { - MinSessions int - UpdateInterval time.Duration // Duration between discovery entry updates. - Callbacks *ClientCallbacks - ClientType string + MinSessions int + UpdateInterval time.Duration // Duration between discovery entry updates. + Callbacks *ClientCallbacks + ClientType string + ConnectedServersType string } // Ensure ensures all config values are set. @@ -208,6 +209,18 @@ func (ce *Client) Serve(ctx context.Context) { if isClosed(ce.done) { return } + + // Skip dmsg servers without user specific types: official, community, all + if ce.conf.ConnectedServersType == "official" { + if entry.Server.ServerType != "official" { + continue + } + } else if ce.conf.ConnectedServersType == "community" { + if entry.Server.ServerType != "community" { + continue + } + } + // If MinSessions is set to 0 then we connect to all available servers. // If MinSessions is not 0 AND we have enough sessions, we wait for error or done signal. if ce.conf.MinSessions != 0 && ce.SessionCount() >= ce.conf.MinSessions { diff --git a/vendor/modules.txt b/vendor/modules.txt index dbd48d44..1905ca5a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -464,7 +464,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.18-0.20240311074627-0ba753f65a88 => github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 +# github.com/skycoin/dmsg v1.3.20 ## explicit; go 1.21 github.com/skycoin/dmsg/internal/servermetrics github.com/skycoin/dmsg/pkg/direct @@ -833,4 +833,3 @@ nhooyr.io/websocket/internal/bpool nhooyr.io/websocket/internal/errd nhooyr.io/websocket/internal/wsjs nhooyr.io/websocket/internal/xsync -# github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4