Skip to content

Commit

Permalink
Fix wrong hardcoded default dmsg discovery (#271)
Browse files Browse the repository at this point in the history
* change hardcoded dmsg discovery to use skywire-utilities/pkg/skyenv.DmsgDiscAddr
  • Loading branch information
0pcom authored Jul 2, 2024
1 parent e8cd649 commit 1c2fcec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import (
"github.com/skycoin/skywire-utilities/pkg/cipher"
"github.com/skycoin/skywire-utilities/pkg/cmdutil"
"github.com/skycoin/skywire-utilities/pkg/logging"
"github.com/skycoin/skywire-utilities/pkg/skyenv"

"github.com/skycoin/dmsg/pkg/disc"
dmsg "github.com/skycoin/dmsg/pkg/dmsg"
)

var (
dir = "." // local dir to serve via http
dmsgDisc = "http://dmsgd.skywire.skycoin.com"
dmsgDisc = skyenv.DmsgDiscAddr
dmsgPort = uint(80)
pk, sk = cipher.GenerateKeyPair()
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ require (

// Uncomment for tests with alternate branches of 'skywire-utilities'
// replace github.com/skycoin/skywire-utilities => ../skywire-utilities
//replace github.com/skycoin/skywire-utilities => github.com/skycoin/skywire-utilities
// replace github.com/skycoin/skywire-utilities => github.com/skycoin/skywire-utilities
4 changes: 3 additions & 1 deletion pkg/dmsg/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion pkg/dmsgcurl/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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")
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/dmsgserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c2fcec

Please sign in to comment.