Skip to content
Snippets Groups Projects
Unverified Commit a3af85f6 authored by Hans Moog's avatar Hans Moog Committed by GitHub
Browse files

Merge branch 'develop' into develop.mergeBinary

parents 46074366 6d1eeb58
Branches
Tags
No related merge requests found
...@@ -3,46 +3,29 @@ module github.com/iotaledger/goshimmer ...@@ -3,46 +3,29 @@ module github.com/iotaledger/goshimmer
go 1.14 go 1.14
require ( require (
github.com/dgraph-io/badger/v2 v2.0.1 github.com/dgraph-io/badger/v2 v2.0.2
github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b // indirect
github.com/gobuffalo/envy v1.8.1 // indirect
github.com/gobuffalo/logger v1.0.3 // indirect
github.com/gobuffalo/packr/v2 v2.7.1 github.com/gobuffalo/packr/v2 v2.7.1
github.com/golang/protobuf v1.3.2 github.com/golang/protobuf v1.3.4
github.com/googollee/go-engine.io v1.4.3-0.20190924125625-798118fc0dd2 github.com/googollee/go-engine.io v1.4.3-0.20190924125625-798118fc0dd2
github.com/googollee/go-socket.io v1.4.3-0.20191204093753-683f8725b6d0 github.com/googollee/go-socket.io v1.4.3-0.20191204093753-683f8725b6d0
github.com/gorilla/websocket v1.4.1 github.com/gorilla/websocket v1.4.1
github.com/iotaledger/hive.go v0.0.0-20200225104639-95ee10a0e675 github.com/iotaledger/hive.go v0.0.0-20200304073310-d71239623d46
github.com/iotaledger/iota.go v1.0.0-beta.14 github.com/iotaledger/iota.go v1.0.0-beta.14
github.com/kr/pretty v0.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
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
github.com/magiconair/properties v1.8.1 github.com/magiconair/properties v1.8.1
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/mr-tron/base58 v1.1.3 github.com/mr-tron/base58 v1.1.3
github.com/oasislabs/ed25519 v0.0.0-20200206134218-2893bee822a3 github.com/oasislabs/ed25519 v0.0.0-20200302143042-29f6767a7c3e
github.com/panjf2000/ants/v2 v2.2.2 github.com/panjf2000/ants/v2 v2.2.2
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.5.2 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.6.1 github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.4.0 github.com/stretchr/testify v1.4.0
github.com/valyala/fasttemplate v1.1.0 // indirect github.com/valyala/fasttemplate v1.1.0 // indirect
go.uber.org/atomic v1.5.1 go.uber.org/atomic v1.6.0
go.uber.org/zap v1.13.0 go.uber.org/zap v1.14.0
golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 // indirect
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7 // indirect
gopkg.in/ini.v1 v1.51.1 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.2.7 // indirect
) )
This diff is collapsed.
...@@ -4,12 +4,12 @@ import ( ...@@ -4,12 +4,12 @@ import (
"net/http" "net/http"
_ "net/http/pprof" _ "net/http/pprof"
"github.com/iotaledger/hive.go/node"
"github.com/iotaledger/goshimmer/pluginmgr/core" "github.com/iotaledger/goshimmer/pluginmgr/core"
"github.com/iotaledger/goshimmer/pluginmgr/research" "github.com/iotaledger/goshimmer/pluginmgr/research"
"github.com/iotaledger/goshimmer/pluginmgr/ui" "github.com/iotaledger/goshimmer/pluginmgr/ui"
"github.com/iotaledger/goshimmer/pluginmgr/webapi" "github.com/iotaledger/goshimmer/pluginmgr/webapi"
"github.com/iotaledger/hive.go/node"
) )
func main() { func main() {
......
...@@ -39,17 +39,19 @@ func configureAP() { ...@@ -39,17 +39,19 @@ func configureAP() {
} }
log.Debugf("Master peers: %v", masterPeers) log.Debugf("Master peers: %v", masterPeers)
Discovery = discover.New(local.GetInstance(), discover.Config{ Discovery = discover.New(local.GetInstance(),
Log: log.Named("disc"), discover.Logger(log.Named("disc")),
MasterPeers: masterPeers, discover.Version(config.Node.GetUint32(CFG_VERSION)),
}) discover.MasterPeers(masterPeers),
)
log.Infof("Protocol Version: %v", discover.VersionNum)
// enable peer selection only when gossip is enabled // enable peer selection only when gossip is enabled
if !node.IsSkipped(gossip.PLUGIN) { if !node.IsSkipped(gossip.PLUGIN) {
Selection = selection.New(local.GetInstance(), Discovery, selection.Config{ Selection = selection.New(local.GetInstance(), Discovery,
Log: log.Named("sel"), selection.Logger(log.Named("sel")),
NeighborValidator: selection.ValidatorFunc(isValidNeighbor), selection.NeighborValidator(selection.ValidatorFunc(isValidNeighbor)),
}) )
} }
} }
......
...@@ -50,10 +50,6 @@ func configureLocal() *peer.Local { ...@@ -50,10 +50,6 @@ func configureLocal() *peer.Local {
services := service.New() services := service.New()
services.Update(service.PeeringKey, "udp", net.JoinHostPort(externalIP.String(), peeringPort)) services.Update(service.PeeringKey, "udp", net.JoinHostPort(externalIP.String(), peeringPort))
// the private key seed of the current local can be returned the following way:
// key, _ := db.LocalPrivateKey()
// fmt.Println(base64.StdEncoding.EncodeToString(ed25519.PrivateKey(key).Seed()))
// set the private key from the seed provided in the config // set the private key from the seed provided in the config
var seed [][]byte var seed [][]byte
if str := config.Node.GetString(CFG_SEED); str != "" { if str := config.Node.GetString(CFG_SEED); str != "" {
...@@ -75,6 +71,10 @@ func configureLocal() *peer.Local { ...@@ -75,6 +71,10 @@ func configureLocal() *peer.Local {
log.Fatalf("Error creating peer DB: %s", err) log.Fatalf("Error creating peer DB: %s", err)
} }
// the private key seed of the current local can be returned the following way:
// key, _ := peerDB.LocalPrivateKey()
// fmt.Println(base64.StdEncoding.EncodeToString(ed25519.PrivateKey(key).Seed()))
local, err := peer.NewLocal(services, peerDB, seed...) local, err := peer.NewLocal(services, peerDB, seed...)
if err != nil { if err != nil {
log.Fatalf("Error creating local: %s", err) log.Fatalf("Error creating local: %s", err)
......
...@@ -6,8 +6,10 @@ import ( ...@@ -6,8 +6,10 @@ import (
const ( const (
CFG_ENTRY_NODES = "autopeering.entryNodes" CFG_ENTRY_NODES = "autopeering.entryNodes"
CFG_VERSION = "autopeering.version"
) )
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.Uint32(CFG_VERSION, 0, "Autopeering Protocol Version")
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment