diff --git a/config.json b/config.json index 8550f6286b26a43241749146ee261612b75fe8cb..ce6d80bac4c3e9b556dea40999f7ccf26d466bd0 100644 --- a/config.json +++ b/config.json @@ -8,8 +8,7 @@ "entrynodes":[ "V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626" ], - "port":14626, - "selection":true + "port":14626 }, "database":{ "directory":"mainnetdb" diff --git a/go.mod b/go.mod index ffdc7762521f3a6b4c9fb8115f5d281e8989e81f..90a5f49567aa68a53844daa1063e91a9305837cf 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-zeromq/zmq4 v0.7.0 github.com/golang/protobuf v1.3.2 github.com/gorilla/websocket v1.4.1 - github.com/iotaledger/hive.go v0.0.0-20200109143501-f876e7457f15 + github.com/iotaledger/hive.go v0.0.0-20200110132858-ea86cdb9d91e github.com/iotaledger/iota.go v1.0.0-beta.13 github.com/labstack/echo v3.3.10+incompatible github.com/labstack/gommon v0.3.0 // indirect diff --git a/go.sum b/go.sum index 1a4c5f51d77daa4cb8f4211ffe7a776148581c3f..94b4893cc1e16910233c152a66d0966d0e977c50 100644 --- a/go.sum +++ b/go.sum @@ -83,8 +83,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iotaledger/hive.go v0.0.0-20200109143501-f876e7457f15 h1:3QiXbekFTcuJJFnZUGZ9roLLykCD78Yz2aPZYh1QYLA= -github.com/iotaledger/hive.go v0.0.0-20200109143501-f876e7457f15/go.mod h1:obs07gqna53/Yw1ltzLsQzJBMyA6lGu7Fb/ltjqWMnQ= +github.com/iotaledger/hive.go v0.0.0-20200110132858-ea86cdb9d91e h1:bowQHvFQoUWPgxlF9cQRWDzREswR09HpihMiNX1q+AU= +github.com/iotaledger/hive.go v0.0.0-20200110132858-ea86cdb9d91e/go.mod h1:obs07gqna53/Yw1ltzLsQzJBMyA6lGu7Fb/ltjqWMnQ= github.com/iotaledger/iota.go v1.0.0-beta.9/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= github.com/iotaledger/iota.go v1.0.0-beta.13 h1:6m6JRcKtjTflU2PbjvDA9Tv6NTEJX1PijBDOkH9weQc= github.com/iotaledger/iota.go v1.0.0-beta.13/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= diff --git a/plugins/autopeering/autopeering.go b/plugins/autopeering/autopeering.go index 4d70e09eae26cda600a67d09abaa2b8374b561f8..9f019a64dd5a7db5caf84c21d5b0c408a8d87504 100644 --- a/plugins/autopeering/autopeering.go +++ b/plugins/autopeering/autopeering.go @@ -14,7 +14,9 @@ import ( "github.com/iotaledger/goshimmer/packages/autopeering/transport" "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/autopeering/local" + "github.com/iotaledger/goshimmer/plugins/gossip" "github.com/iotaledger/hive.go/logger" + "github.com/iotaledger/hive.go/node" "github.com/pkg/errors" ) @@ -39,7 +41,8 @@ func configureAP() { MasterPeers: masterPeers, }) - if parameter.NodeConfig.GetBool(CFG_SELECTION) { + // enable peer selection only when gossip is enabled + if !node.IsSkipped(gossip.PLUGIN) { Selection = selection.New(local.GetInstance(), Discovery, selection.Config{ Log: log.Named("sel"), Param: &selection.Parameters{ diff --git a/plugins/autopeering/parameters.go b/plugins/autopeering/parameters.go index 0c2454272e4a8e1a6b120009ae364389275c454e..138b8d56e451c9024fd85c1b4296965337061c4d 100644 --- a/plugins/autopeering/parameters.go +++ b/plugins/autopeering/parameters.go @@ -6,10 +6,8 @@ import ( const ( CFG_ENTRY_NODES = "autopeering.entryNodes" - CFG_SELECTION = "autopeering.selection" ) func init() { flag.StringSlice(CFG_ENTRY_NODES, []string{"V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626"}, "list of trusted entry nodes for auto peering") - flag.Bool(CFG_SELECTION, true, "enable peer selection") }