Skip to content
Snippets Groups Projects
Commit 6798c3be authored by capossele's avatar capossele
Browse files

:construction: WIP

parent 3797ffc8
No related branches found
No related tags found
No related merge requests found
package recordedevents package recordedevents
import ( import (
"strconv"
"sync" "sync"
"github.com/iotaledger/goshimmer/plugins/analysis/server" "github.com/iotaledger/goshimmer/plugins/analysis/server"
...@@ -17,7 +16,6 @@ var lock sync.Mutex ...@@ -17,7 +16,6 @@ var lock sync.Mutex
func Configure(plugin *node.Plugin) { func Configure(plugin *node.Plugin) {
server.Events.AddNode.Attach(events.NewClosure(func(nodeId string) { server.Events.AddNode.Attach(events.NewClosure(func(nodeId string) {
plugin.LogInfo("AddNode: " + nodeId + " sizeof " + strconv.Itoa(len(nodeId)))
if _, exists := nodes[nodeId]; !exists { if _, exists := nodes[nodeId]; !exists {
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
...@@ -29,7 +27,6 @@ func Configure(plugin *node.Plugin) { ...@@ -29,7 +27,6 @@ func Configure(plugin *node.Plugin) {
})) }))
server.Events.RemoveNode.Attach(events.NewClosure(func(nodeId string) { server.Events.RemoveNode.Attach(events.NewClosure(func(nodeId string) {
plugin.LogInfo("RemoveNode: " + nodeId)
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
...@@ -37,7 +34,6 @@ func Configure(plugin *node.Plugin) { ...@@ -37,7 +34,6 @@ func Configure(plugin *node.Plugin) {
})) }))
server.Events.NodeOnline.Attach(events.NewClosure(func(nodeId string) { server.Events.NodeOnline.Attach(events.NewClosure(func(nodeId string) {
plugin.LogInfo("NodeOnline: " + nodeId)
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
...@@ -45,7 +41,6 @@ func Configure(plugin *node.Plugin) { ...@@ -45,7 +41,6 @@ func Configure(plugin *node.Plugin) {
})) }))
server.Events.NodeOffline.Attach(events.NewClosure(func(nodeId string) { server.Events.NodeOffline.Attach(events.NewClosure(func(nodeId string) {
plugin.LogInfo("NodeOffline: " + nodeId)
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
...@@ -53,7 +48,6 @@ func Configure(plugin *node.Plugin) { ...@@ -53,7 +48,6 @@ func Configure(plugin *node.Plugin) {
})) }))
server.Events.ConnectNodes.Attach(events.NewClosure(func(sourceId string, targetId string) { server.Events.ConnectNodes.Attach(events.NewClosure(func(sourceId string, targetId string) {
plugin.LogInfo("ConnectNodes: " + sourceId + " - " + targetId)
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
...@@ -67,7 +61,6 @@ func Configure(plugin *node.Plugin) { ...@@ -67,7 +61,6 @@ func Configure(plugin *node.Plugin) {
})) }))
server.Events.DisconnectNodes.Attach(events.NewClosure(func(sourceId string, targetId string) { server.Events.DisconnectNodes.Attach(events.NewClosure(func(sourceId string, targetId string) {
plugin.LogInfo("DisconnectNodes: " + sourceId + " - " + targetId)
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
......
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"net" "net"
"net/http" "net/http"
"strconv" "strconv"
...@@ -16,7 +15,6 @@ import ( ...@@ -16,7 +15,6 @@ import (
"github.com/iotaledger/autopeering-sim/selection" "github.com/iotaledger/autopeering-sim/selection"
"github.com/iotaledger/autopeering-sim/server" "github.com/iotaledger/autopeering-sim/server"
"github.com/iotaledger/autopeering-sim/transport" "github.com/iotaledger/autopeering-sim/transport"
"github.com/iotaledger/goshimmer/packages/node"
"github.com/iotaledger/goshimmer/plugins/autopeering/local" "github.com/iotaledger/goshimmer/plugins/autopeering/local"
"github.com/iotaledger/goshimmer/plugins/gossip" "github.com/iotaledger/goshimmer/plugins/gossip"
"github.com/iotaledger/hive.go/parameter" "github.com/iotaledger/hive.go/parameter"
...@@ -24,7 +22,6 @@ import ( ...@@ -24,7 +22,6 @@ import (
) )
var ( var (
PLUGIN = node.NewPlugin("Auto Peering", node.Enabled, configure, run)
debugLevel = "info" debugLevel = "info"
close = make(chan struct{}, 1) close = make(chan struct{}, 1)
srv *server.Server srv *server.Server
...@@ -85,7 +82,7 @@ func start() { ...@@ -85,7 +82,7 @@ func start() {
masterPeers := []*peer.Peer{} masterPeers := []*peer.Peer{}
master, err := parseEntryNodes() master, err := parseEntryNodes()
if err != nil { if err != nil {
log.Printf("Ignoring entry nodes: %v\n", err) log.Fatalf("Ignoring entry nodes: %v\n", err)
} else if master != nil { } else if master != nil {
masterPeers = master masterPeers = master
} }
......
...@@ -27,6 +27,6 @@ for i in `seq 1 $1`; do ...@@ -27,6 +27,6 @@ for i in `seq 1 $1`; do
mkdir node_$i/logs mkdir node_$i/logs
cp ../shimmer node_$i/ cp ../shimmer node_$i/
cd node_$i cd node_$i
./shimmer --autopeering.port $PEERING_PORT --gossip.port $GOSSIP_PORT --autopeering.address 127.0.0.1 --autopeering.entryNodes 6rtO4nW2nzbSqZ8nrf0VFOn+fuyluf6ltJTkKpUc3LM=@127.0.0.1:14626 --node.logLevel 4 --node.disablePlugins statusscreen --analysis.serverAddress 127.0.0.1:188 & ./shimmer --autopeering.port $PEERING_PORT --gossip.port $GOSSIP_PORT --autopeering.address 127.0.0.1 --autopeering.entryNodes 6rtO4nW2nzbSqZ8nrf0VFOn+fuyluf6ltJTkKpUc3LM=@127.0.0.1:14626 --node.LogLevel 4 --node.disablePlugins statusscreen --analysis.serverAddress 127.0.0.1:188 &
cd .. cd ..
done done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment