Skip to content
Snippets Groups Projects
Unverified Commit ef5ab377 authored by Wolfgang Welz's avatar Wolfgang Welz Committed by GitHub
Browse files

Fix: Allow starting a node with gossip disabled (#97)

* fix: remove selection flag and use gossip plugin

* Upgrade hive.go
parent e7e4f19e
Branches
Tags
No related merge requests found
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
"entrynodes":[ "entrynodes":[
"V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626" "V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626"
], ],
"port":14626, "port":14626
"selection":true
}, },
"database":{ "database":{
"directory":"mainnetdb" "directory":"mainnetdb"
......
...@@ -11,7 +11,7 @@ require ( ...@@ -11,7 +11,7 @@ require (
github.com/go-zeromq/zmq4 v0.7.0 github.com/go-zeromq/zmq4 v0.7.0
github.com/golang/protobuf v1.3.2 github.com/golang/protobuf v1.3.2
github.com/gorilla/websocket v1.4.1 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/iotaledger/iota.go v1.0.0-beta.13
github.com/labstack/echo v3.3.10+incompatible github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0 // indirect github.com/labstack/gommon v0.3.0 // indirect
......
...@@ -83,8 +83,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T ...@@ -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 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 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/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-20200110132858-ea86cdb9d91e h1:bowQHvFQoUWPgxlF9cQRWDzREswR09HpihMiNX1q+AU=
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/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.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 h1:6m6JRcKtjTflU2PbjvDA9Tv6NTEJX1PijBDOkH9weQc=
github.com/iotaledger/iota.go v1.0.0-beta.13/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= github.com/iotaledger/iota.go v1.0.0-beta.13/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8=
......
...@@ -14,7 +14,9 @@ import ( ...@@ -14,7 +14,9 @@ import (
"github.com/iotaledger/goshimmer/packages/autopeering/transport" "github.com/iotaledger/goshimmer/packages/autopeering/transport"
"github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/packages/parameter"
"github.com/iotaledger/goshimmer/plugins/autopeering/local" "github.com/iotaledger/goshimmer/plugins/autopeering/local"
"github.com/iotaledger/goshimmer/plugins/gossip"
"github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/logger"
"github.com/iotaledger/hive.go/node"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
...@@ -39,7 +41,8 @@ func configureAP() { ...@@ -39,7 +41,8 @@ func configureAP() {
MasterPeers: masterPeers, 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{ Selection = selection.New(local.GetInstance(), Discovery, selection.Config{
Log: log.Named("sel"), Log: log.Named("sel"),
Param: &selection.Parameters{ Param: &selection.Parameters{
......
...@@ -6,10 +6,8 @@ import ( ...@@ -6,10 +6,8 @@ import (
const ( const (
CFG_ENTRY_NODES = "autopeering.entryNodes" CFG_ENTRY_NODES = "autopeering.entryNodes"
CFG_SELECTION = "autopeering.selection"
) )
func init() { 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.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")
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment