From 9a9a6947e3689381ac066d394d7c555d580ce322 Mon Sep 17 00:00:00 2001 From: ersonp Date: Tue, 7 Sep 2021 17:28:40 +0530 Subject: [PATCH 1/8] Remove char file --- Char | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Char diff --git a/Char b/Char deleted file mode 100644 index e69de29bb2..0000000000 From c8b8af86923542c486b9123abdcafd587f25ac4b Mon Sep 17 00:00:00 2001 From: ersonp Date: Tue, 7 Sep 2021 18:13:59 +0530 Subject: [PATCH 2/8] Change proxy discovery to service discovery --- cmd/skywire-cli/README.md | 6 +++--- pkg/app/appdisc/const.go | 2 +- pkg/app/appdisc/factory.go | 12 ++++++------ pkg/visor/init.go | 10 +++++----- pkg/visor/visorconfig/README.md | 2 +- pkg/visor/visorconfig/v1.go | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/skywire-cli/README.md b/cmd/skywire-cli/README.md index e235fe8b8c..c72601c1fc 100644 --- a/cmd/skywire-cli/README.md +++ b/cmd/skywire-cli/README.md @@ -396,7 +396,7 @@ $ skywire-cli visor gen-config "launcher": { "discovery": { "update_interval": "30s", - "proxy_discovery_addr": "http://service.discovery.skycoin.com" + "service_discovery": "http://service.discovery.skycoin.com" }, "apps": [ { @@ -512,7 +512,7 @@ $ skywire-cli visor gen-config -ip "launcher": { "discovery": { "update_interval": "30s", - "proxy_discovery_addr": "http://service.discovery.skycoin.com" + "service_discovery": "http://service.discovery.skycoin.com" }, "apps": [ { @@ -886,7 +886,7 @@ skywire-cli visor update-config "launcher": { "discovery": { "update_interval": "30s", - "proxy_discovery_addr": "http://service.discovery.skycoin.com" + "service_discovery": "http://service.discovery.skycoin.com" }, "apps": [ { diff --git a/pkg/app/appdisc/const.go b/pkg/app/appdisc/const.go index 35ed12c084..e22e19ebe6 100644 --- a/pkg/app/appdisc/const.go +++ b/pkg/app/appdisc/const.go @@ -1,6 +1,6 @@ package appdisc -// ChangeValue keys. Each key changes a different value for proxyUpdater.ChangeValue +// ChangeValue keys. Each key changes a different value for serviceUpdater.ChangeValue const ( // ConnCountValue represents the number of remote connections to a given proc. ConnCountValue = "conn_count" diff --git a/pkg/app/appdisc/factory.go b/pkg/app/appdisc/factory.go index f54bba784f..18fecd4ac2 100644 --- a/pkg/app/appdisc/factory.go +++ b/pkg/app/appdisc/factory.go @@ -18,7 +18,7 @@ type Factory struct { PK cipher.PubKey SK cipher.SecKey UpdateInterval time.Duration - ProxyDisc string // Address of proxy-discovery + ServiceDisc string // Address of service-discovery } func (f *Factory) setDefaults() { @@ -28,8 +28,8 @@ func (f *Factory) setDefaults() { if f.UpdateInterval == 0 { f.UpdateInterval = skyenv.AppDiscUpdateInterval } - if f.ProxyDisc == "" { - f.ProxyDisc = skyenv.DefaultServiceDiscAddr + if f.ServiceDisc == "" { + f.ServiceDisc = skyenv.DefaultServiceDiscAddr } } @@ -45,7 +45,7 @@ func (f *Factory) VisorUpdater(port uint16) Updater { PK: f.PK, SK: f.SK, Port: port, - DiscAddr: f.ProxyDisc, + DiscAddr: f.ServiceDisc, } return &serviceUpdater{ @@ -63,7 +63,7 @@ func (f *Factory) AppUpdater(conf appcommon.ProcConfig) (Updater, bool) { log := f.Log.WithField("appName", conf.AppName) - // Do not update in proxy discovery if passcode-protected. + // Do not update in service discovery if passcode-protected. if conf.ContainsFlag("passcode") && conf.ArgVal("passcode") != "" { return &emptyUpdater{}, false } @@ -74,7 +74,7 @@ func (f *Factory) AppUpdater(conf appcommon.ProcConfig) (Updater, bool) { PK: f.PK, SK: f.SK, Port: uint16(conf.RoutingPort), - DiscAddr: f.ProxyDisc, + DiscAddr: f.ServiceDisc, } } diff --git a/pkg/visor/init.go b/pkg/visor/init.go index 906b2e6036..e98d3d7243 100644 --- a/pkg/visor/init.go +++ b/pkg/visor/init.go @@ -190,7 +190,7 @@ func initDiscovery(ctx context.Context, v *Visor, log *logging.Logger) error { factory.PK = v.conf.PK factory.SK = v.conf.SK factory.UpdateInterval = time.Duration(conf.Discovery.UpdateInterval) - factory.ProxyDisc = conf.Discovery.ServiceDisc + factory.ServiceDisc = conf.Discovery.ServiceDisc } v.initLock.Lock() v.serviceDisc = factory @@ -652,9 +652,9 @@ func initPublicVisors(ctx context.Context, v *Visor, log *logging.Logger) error if !v.conf.Transport.AutoconnectPublic { return nil } - proxyDisc := v.conf.Launcher.Discovery.ServiceDisc - if proxyDisc == "" { - proxyDisc = skyenv.DefaultServiceDiscAddr + serviceDisc := v.conf.Launcher.Discovery.ServiceDisc + if serviceDisc == "" { + serviceDisc = skyenv.DefaultServiceDiscAddr } // todo: refactor appdisc: split connecting to services in appdisc and @@ -666,7 +666,7 @@ func initPublicVisors(ctx context.Context, v *Visor, log *logging.Logger) error PK: v.conf.PK, SK: v.conf.SK, Port: uint16(0), - DiscAddr: proxyDisc, + DiscAddr: serviceDisc, } connector := servicedisc.MakeConnector(conf, 5, v.tpM, log) go connector.Run(ctx) //nolint:errcheck diff --git a/pkg/visor/visorconfig/README.md b/pkg/visor/visorconfig/README.md index 8e4fbeb298..a7aa361702 100644 --- a/pkg/visor/visorconfig/README.md +++ b/pkg/visor/visorconfig/README.md @@ -43,7 +43,7 @@ # V1AppDisc - `update_interval` (Duration) -- `proxy_discovery_addr` (string) +- `service_discovery` (string) # V1LogStore diff --git a/pkg/visor/visorconfig/v1.go b/pkg/visor/visorconfig/v1.go index 59517e80ce..d77206f310 100644 --- a/pkg/visor/visorconfig/v1.go +++ b/pkg/visor/visorconfig/v1.go @@ -103,7 +103,7 @@ type V1UptimeTracker struct { // V1AppDisc configures Skywire App Discovery Clients. type V1AppDisc struct { UpdateInterval Duration `json:"update_interval,omitempty"` - ServiceDisc string `json:"proxy_discovery_addr"` // TODO: change JSON name + ServiceDisc string `json:"service_discovery"` } // V1Launcher configures the app launcher. From 4c303b642eb0b26dff34dba24725fcb7285d3a51 Mon Sep 17 00:00:00 2001 From: ersonp Date: Tue, 7 Sep 2021 18:43:48 +0530 Subject: [PATCH 3/8] Change V1AppDisc ro V1ServiceDisc --- pkg/app/appdisc/factory.go | 2 +- pkg/skyenv/values.go | 8 ++++---- pkg/visor/visorconfig/config.go | 10 +++++----- pkg/visor/visorconfig/parse.go | 2 +- pkg/visor/visorconfig/v1.go | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/app/appdisc/factory.go b/pkg/app/appdisc/factory.go index 18fecd4ac2..1ab622b7d8 100644 --- a/pkg/app/appdisc/factory.go +++ b/pkg/app/appdisc/factory.go @@ -26,7 +26,7 @@ func (f *Factory) setDefaults() { f.Log = logging.MustGetLogger("appdisc") } if f.UpdateInterval == 0 { - f.UpdateInterval = skyenv.AppDiscUpdateInterval + f.UpdateInterval = skyenv.ServiceDiscUpdateInterval } if f.ServiceDisc == "" { f.ServiceDisc = skyenv.DefaultServiceDiscAddr diff --git a/pkg/skyenv/values.go b/pkg/skyenv/values.go index 394f673788..8bab0c490f 100644 --- a/pkg/skyenv/values.go +++ b/pkg/skyenv/values.go @@ -103,10 +103,10 @@ const ( // Default skywire app server and discovery constants const ( - DefaultAppSrvAddr = "localhost:5505" - AppDiscUpdateInterval = time.Minute - DefaultAppBinPath = DefaultSkywirePath + "/apps" - DefaultLogLevel = "info" + DefaultAppSrvAddr = "localhost:5505" + ServiceDiscUpdateInterval = time.Minute + DefaultAppBinPath = DefaultSkywirePath + "/apps" + DefaultLogLevel = "info" ) // Package defaults diff --git a/pkg/visor/visorconfig/config.go b/pkg/visor/visorconfig/config.go index aa36b54aa5..76410c357e 100644 --- a/pkg/visor/visorconfig/config.go +++ b/pkg/visor/visorconfig/config.go @@ -33,7 +33,7 @@ func MakeBaseConfig(common *Common) *V1 { RouteFinderTimeout: DefaultTimeout, } conf.Launcher = &V1Launcher{ - Discovery: &V1AppDisc{ + Discovery: &V1Disc{ ServiceDisc: skyenv.DefaultServiceDiscAddr, }, Apps: nil, @@ -89,8 +89,8 @@ func defaultConfigFromCommon(cc *Common, hypervisor bool) (*V1, error) { Addr: skyenv.DefaultUptimeTrackerAddr, } - conf.Launcher.Discovery = &V1AppDisc{ - UpdateInterval: Duration(skyenv.AppDiscUpdateInterval), + conf.Launcher.Discovery = &V1Disc{ + UpdateInterval: Duration(skyenv.ServiceDiscUpdateInterval), ServiceDisc: skyenv.DefaultServiceDiscAddr, } @@ -218,8 +218,8 @@ func SetDefaultProductionValues(conf *V1) { conf.UptimeTracker = &V1UptimeTracker{ Addr: skyenv.DefaultUptimeTrackerAddr, } - conf.Launcher.Discovery = &V1AppDisc{ - UpdateInterval: Duration(skyenv.AppDiscUpdateInterval), + conf.Launcher.Discovery = &V1Disc{ + UpdateInterval: Duration(skyenv.ServiceDiscUpdateInterval), ServiceDisc: skyenv.DefaultServiceDiscAddr, } } diff --git a/pkg/visor/visorconfig/parse.go b/pkg/visor/visorconfig/parse.go index 2a51c74e5a..23e731df3f 100644 --- a/pkg/visor/visorconfig/parse.go +++ b/pkg/visor/visorconfig/parse.go @@ -162,7 +162,7 @@ func parseV0(cc *Common, raw []byte) (*V1, error) { func ensureAppDisc(conf *V1) *V1 { if conf.Launcher.Discovery == nil { - conf.Launcher.Discovery = &V1AppDisc{ + conf.Launcher.Discovery = &V1Disc{ ServiceDisc: skyenv.DefaultServiceDiscAddr, } } diff --git a/pkg/visor/visorconfig/v1.go b/pkg/visor/visorconfig/v1.go index d77206f310..d9af2ddc4d 100644 --- a/pkg/visor/visorconfig/v1.go +++ b/pkg/visor/visorconfig/v1.go @@ -100,15 +100,15 @@ type V1UptimeTracker struct { Addr string `json:"addr"` } -// V1AppDisc configures Skywire App Discovery Clients. -type V1AppDisc struct { +// V1Disc configures Skywire App Discovery Clients. +type V1Disc struct { UpdateInterval Duration `json:"update_interval,omitempty"` ServiceDisc string `json:"service_discovery"` } // V1Launcher configures the app launcher. type V1Launcher struct { - Discovery *V1AppDisc `json:"discovery"` + Discovery *V1Disc `json:"discovery"` Apps []launcher.AppConfig `json:"apps"` ServerAddr string `json:"server_addr"` BinPath string `json:"bin_path"` From 61fdaf6956ad12976c74fb34f25898086b7ddab1 Mon Sep 17 00:00:00 2001 From: ersonp Date: Tue, 7 Sep 2021 20:19:09 +0530 Subject: [PATCH 4/8] Change V1Disc to V1ServiceDisc --- pkg/visor/visorconfig/config.go | 6 +++--- pkg/visor/visorconfig/parse.go | 2 +- pkg/visor/visorconfig/v1.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/visor/visorconfig/config.go b/pkg/visor/visorconfig/config.go index 76410c357e..5f35b3a6d9 100644 --- a/pkg/visor/visorconfig/config.go +++ b/pkg/visor/visorconfig/config.go @@ -33,7 +33,7 @@ func MakeBaseConfig(common *Common) *V1 { RouteFinderTimeout: DefaultTimeout, } conf.Launcher = &V1Launcher{ - Discovery: &V1Disc{ + Discovery: &V1ServiceDisc{ ServiceDisc: skyenv.DefaultServiceDiscAddr, }, Apps: nil, @@ -89,7 +89,7 @@ func defaultConfigFromCommon(cc *Common, hypervisor bool) (*V1, error) { Addr: skyenv.DefaultUptimeTrackerAddr, } - conf.Launcher.Discovery = &V1Disc{ + conf.Launcher.Discovery = &V1ServiceDisc{ UpdateInterval: Duration(skyenv.ServiceDiscUpdateInterval), ServiceDisc: skyenv.DefaultServiceDiscAddr, } @@ -218,7 +218,7 @@ func SetDefaultProductionValues(conf *V1) { conf.UptimeTracker = &V1UptimeTracker{ Addr: skyenv.DefaultUptimeTrackerAddr, } - conf.Launcher.Discovery = &V1Disc{ + conf.Launcher.Discovery = &V1ServiceDisc{ UpdateInterval: Duration(skyenv.ServiceDiscUpdateInterval), ServiceDisc: skyenv.DefaultServiceDiscAddr, } diff --git a/pkg/visor/visorconfig/parse.go b/pkg/visor/visorconfig/parse.go index 23e731df3f..786f6e15ff 100644 --- a/pkg/visor/visorconfig/parse.go +++ b/pkg/visor/visorconfig/parse.go @@ -162,7 +162,7 @@ func parseV0(cc *Common, raw []byte) (*V1, error) { func ensureAppDisc(conf *V1) *V1 { if conf.Launcher.Discovery == nil { - conf.Launcher.Discovery = &V1Disc{ + conf.Launcher.Discovery = &V1ServiceDisc{ ServiceDisc: skyenv.DefaultServiceDiscAddr, } } diff --git a/pkg/visor/visorconfig/v1.go b/pkg/visor/visorconfig/v1.go index d9af2ddc4d..026bf542bd 100644 --- a/pkg/visor/visorconfig/v1.go +++ b/pkg/visor/visorconfig/v1.go @@ -100,15 +100,15 @@ type V1UptimeTracker struct { Addr string `json:"addr"` } -// V1Disc configures Skywire App Discovery Clients. -type V1Disc struct { +// V1ServiceDisc configures Skywire App Discovery Clients. +type V1ServiceDisc struct { UpdateInterval Duration `json:"update_interval,omitempty"` ServiceDisc string `json:"service_discovery"` } // V1Launcher configures the app launcher. type V1Launcher struct { - Discovery *V1Disc `json:"discovery"` + Discovery *V1ServiceDisc `json:"discovery"` Apps []launcher.AppConfig `json:"apps"` ServerAddr string `json:"server_addr"` BinPath string `json:"bin_path"` From 4f42ab100769802e9df9ca4cfeda0ee1ba895cd4 Mon Sep 17 00:00:00 2001 From: ersonp Date: Tue, 7 Sep 2021 22:06:59 +0530 Subject: [PATCH 5/8] Update config changes --- pkg/visor/visorconfig/v1.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/visor/visorconfig/v1.go b/pkg/visor/visorconfig/v1.go index 026bf542bd..3d7429ffc4 100644 --- a/pkg/visor/visorconfig/v1.go +++ b/pkg/visor/visorconfig/v1.go @@ -32,6 +32,9 @@ const V101Name = "v1.0.1" // Removed authorization_file field from dmsgpty section // Default urls are changed to newer shortned ones // Added stun_servers field to the config +// Added persistent_transports field to the config +// Changed proxy_discovery_addr field to service_discovery +// Changed V1AppDisc struct to V1ServiceDisc const V110Name = "v1.1.0" // V1Name is the semantic version string for the most recent version of V1. From 8880fef03ab9794a0526835cc85e32ee7d6c3e3e Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 8 Sep 2021 13:03:59 +0530 Subject: [PATCH 6/8] Update changelog --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a82107520d..722e55a6db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.5.0 + +### Changed + +- config updated to `v1.1.0` +- removed public_trusted_visor field from root section +- removed trusted_visors field from transport section +- removed authorization_file field from dmsgpty section +- changed default urls to newer shortned ones +- changed proxy_discovery_addr field to service_discovery +- updated UI +- removed `--public` flag from `skywire-cli visor add-tp` command + +### Added +- added persistent_transports field to the config and UI +- added stun_servers field to the config +- added is_public field to root section +- added public_autoconnect field to transport section +- added transport_setup_nodes field to transport section +- added MinHops field to V1Routing section of config + ## 0.2.1 - 2020.04.07 ### Changed From f9e6c983eda9bce7739e410fbf24266dfffd1d59 Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 8 Sep 2021 13:06:26 +0530 Subject: [PATCH 7/8] Update changelog formatting --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 722e55a6db..aecde19630 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - removed `--public` flag from `skywire-cli visor add-tp` command ### Added + - added persistent_transports field to the config and UI - added stun_servers field to the config - added is_public field to root section From 9702895424a2a05df95e7b212333b5bea6e1338a Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 8 Sep 2021 13:28:59 +0530 Subject: [PATCH 8/8] Chane appdisc to updatedisc --- pkg/app/appserver/proc.go | 14 +++++++------- pkg/app/appserver/proc_manager.go | 8 ++++---- pkg/app/{appdisc => updatedisc}/const.go | 2 +- .../{appdisc => updatedisc}/discovery_updater.go | 2 +- pkg/app/{appdisc => updatedisc}/factory.go | 2 +- pkg/visor/init.go | 6 +++--- pkg/visor/visor.go | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) rename pkg/app/{appdisc => updatedisc}/const.go (94%) rename pkg/app/{appdisc => updatedisc}/discovery_updater.go (98%) rename pkg/app/{appdisc => updatedisc}/factory.go (99%) diff --git a/pkg/app/appserver/proc.go b/pkg/app/appserver/proc.go index 9c28856a12..0196465fb5 100644 --- a/pkg/app/appserver/proc.go +++ b/pkg/app/appserver/proc.go @@ -16,8 +16,8 @@ import ( "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" - "github.com/skycoin/skywire/pkg/app/appdisc" "github.com/skycoin/skywire/pkg/app/appnet" + "github.com/skycoin/skywire/pkg/app/updatedisc" ) var ( @@ -29,7 +29,7 @@ var ( // communication. // TODO(evanlinjin): In the future, we will implement the ability to run multiple instances (procs) of a single app. type Proc struct { - disc appdisc.Updater // app discovery client + disc updatedisc.Updater // app discovery client conf appcommon.ProcConfig log *logging.Logger @@ -57,7 +57,7 @@ type Proc struct { } // NewProc constructs `Proc`. -func NewProc(mLog *logging.MasterLogger, conf appcommon.ProcConfig, disc appdisc.Updater, m ProcManager, +func NewProc(mLog *logging.MasterLogger, conf appcommon.ProcConfig, disc updatedisc.Updater, m ProcManager, appName string) *Proc { if mLog == nil { mLog = logging.NewMasterLogger() @@ -136,8 +136,8 @@ func (p *Proc) awaitConn() bool { connDelta := p.rpcGW.cm.AddDeltaInformer() go func() { for n := range connDelta.Chan() { - if err := p.disc.ChangeValue(appdisc.ConnCountValue, []byte(strconv.Itoa(n))); err != nil { - p.log.WithError(err).WithField("value", appdisc.ConnCountValue). + if err := p.disc.ChangeValue(updatedisc.ConnCountValue, []byte(strconv.Itoa(n))); err != nil { + p.log.WithError(err).WithField("value", updatedisc.ConnCountValue). Error("Failed to change app discovery value.") } } @@ -146,8 +146,8 @@ func (p *Proc) awaitConn() bool { lisDelta := p.rpcGW.lm.AddDeltaInformer() go func() { for n := range lisDelta.Chan() { - if err := p.disc.ChangeValue(appdisc.ListenerCountValue, []byte(strconv.Itoa(n))); err != nil { - p.log.WithError(err).WithField("value", appdisc.ListenerCountValue). + if err := p.disc.ChangeValue(updatedisc.ListenerCountValue, []byte(strconv.Itoa(n))); err != nil { + p.log.WithError(err).WithField("value", updatedisc.ListenerCountValue). Error("Failed to change app discovery value.") } } diff --git a/pkg/app/appserver/proc_manager.go b/pkg/app/appserver/proc_manager.go index 2992fcd60e..3fff6006cd 100644 --- a/pkg/app/appserver/proc_manager.go +++ b/pkg/app/appserver/proc_manager.go @@ -13,8 +13,8 @@ import ( "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" - "github.com/skycoin/skywire/pkg/app/appdisc" "github.com/skycoin/skywire/pkg/app/appevent" + "github.com/skycoin/skywire/pkg/app/updatedisc" ) //go:generate mockery -name ProcManager -case underscore -inpkg @@ -57,7 +57,7 @@ type procManager struct { conns map[string]net.Conn connsWG sync.WaitGroup - discF *appdisc.Factory + discF *updatedisc.Factory procs map[string]*Proc procsByKey map[appcommon.ProcKey]*Proc @@ -69,12 +69,12 @@ type procManager struct { } // NewProcManager constructs `ProcManager`. -func NewProcManager(mLog *logging.MasterLogger, discF *appdisc.Factory, eb *appevent.Broadcaster, addr string) (ProcManager, error) { +func NewProcManager(mLog *logging.MasterLogger, discF *updatedisc.Factory, eb *appevent.Broadcaster, addr string) (ProcManager, error) { if mLog == nil { mLog = logging.NewMasterLogger() } if discF == nil { - discF = new(appdisc.Factory) + discF = new(updatedisc.Factory) } if eb == nil { eb = appevent.NewBroadcaster(mLog.PackageLogger("event_broadcaster"), time.Second) diff --git a/pkg/app/appdisc/const.go b/pkg/app/updatedisc/const.go similarity index 94% rename from pkg/app/appdisc/const.go rename to pkg/app/updatedisc/const.go index e22e19ebe6..ebc3f4d103 100644 --- a/pkg/app/appdisc/const.go +++ b/pkg/app/updatedisc/const.go @@ -1,4 +1,4 @@ -package appdisc +package updatedisc // ChangeValue keys. Each key changes a different value for serviceUpdater.ChangeValue const ( diff --git a/pkg/app/appdisc/discovery_updater.go b/pkg/app/updatedisc/discovery_updater.go similarity index 98% rename from pkg/app/appdisc/discovery_updater.go rename to pkg/app/updatedisc/discovery_updater.go index e6bcff1892..34ff69f59a 100644 --- a/pkg/app/appdisc/discovery_updater.go +++ b/pkg/app/updatedisc/discovery_updater.go @@ -1,4 +1,4 @@ -package appdisc +package updatedisc import ( "context" diff --git a/pkg/app/appdisc/factory.go b/pkg/app/updatedisc/factory.go similarity index 99% rename from pkg/app/appdisc/factory.go rename to pkg/app/updatedisc/factory.go index 1ab622b7d8..da9052aae2 100644 --- a/pkg/app/appdisc/factory.go +++ b/pkg/app/updatedisc/factory.go @@ -1,4 +1,4 @@ -package appdisc +package updatedisc import ( "time" diff --git a/pkg/visor/init.go b/pkg/visor/init.go index e98d3d7243..a4927a6aec 100644 --- a/pkg/visor/init.go +++ b/pkg/visor/init.go @@ -19,10 +19,10 @@ import ( "github.com/skycoin/skywire/internal/utclient" "github.com/skycoin/skywire/internal/vpn" - "github.com/skycoin/skywire/pkg/app/appdisc" "github.com/skycoin/skywire/pkg/app/appevent" "github.com/skycoin/skywire/pkg/app/appserver" "github.com/skycoin/skywire/pkg/app/launcher" + "github.com/skycoin/skywire/pkg/app/updatedisc" "github.com/skycoin/skywire/pkg/dmsgc" "github.com/skycoin/skywire/pkg/routefinder/rfclient" "github.com/skycoin/skywire/pkg/router" @@ -180,7 +180,7 @@ func initAddressResolver(ctx context.Context, v *Visor, log *logging.Logger) err func initDiscovery(ctx context.Context, v *Visor, log *logging.Logger) error { // Prepare app discovery factory. - factory := appdisc.Factory{ + factory := updatedisc.Factory{ Log: v.MasterLogger().PackageLogger("app_discovery"), } @@ -657,7 +657,7 @@ func initPublicVisors(ctx context.Context, v *Visor, log *logging.Logger) error serviceDisc = skyenv.DefaultServiceDiscAddr } - // todo: refactor appdisc: split connecting to services in appdisc and + // todo: refactor updatedisc: split connecting to services in updatedisc and // advertising oneself as a service. Currently, config is tailored to // advertising oneself and requires things like port that are not used // in connecting to services diff --git a/pkg/visor/visor.go b/pkg/visor/visor.go index 43763ae211..45be7f773d 100644 --- a/pkg/visor/visor.go +++ b/pkg/visor/visor.go @@ -12,10 +12,10 @@ import ( "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/internal/utclient" - "github.com/skycoin/skywire/pkg/app/appdisc" "github.com/skycoin/skywire/pkg/app/appevent" "github.com/skycoin/skywire/pkg/app/appserver" "github.com/skycoin/skywire/pkg/app/launcher" + "github.com/skycoin/skywire/pkg/app/updatedisc" "github.com/skycoin/skywire/pkg/restart" "github.com/skycoin/skywire/pkg/routefinder/rfclient" "github.com/skycoin/skywire/pkg/router" @@ -66,7 +66,7 @@ type Visor struct { procM appserver.ProcManager // proc manager appL *launcher.Launcher // app launcher - serviceDisc appdisc.Factory + serviceDisc updatedisc.Factory initLock *sync.Mutex // when module is failed it pushes its error to this channel // used by init and shutdown to show/check for any residual errors