diff --git a/.gitignore b/.gitignore index 217c41d974ce6dbd54b2cab04fdef4b7570615a0..52422ce9cd3e58f2bd5826129ccae669d1eaf759 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ # Logs logs/* testNodes/* +*.log # Project files .idea diff --git a/plugins/autopeering/autopeering.go b/plugins/autopeering/autopeering.go index f980e91c83cc05d234a2c94aef75475262f0cbbc..7dc06d78d699447768f94c1be63c1d69ade05542 100644 --- a/plugins/autopeering/autopeering.go +++ b/plugins/autopeering/autopeering.go @@ -7,7 +7,6 @@ import ( "net" "net/http" "strconv" - "time" "github.com/iotaledger/autopeering-sim/discover" "github.com/iotaledger/autopeering-sim/logger" @@ -23,7 +22,7 @@ import ( ) var ( - debugLevel = "debug" + debugLevel = "info" close = make(chan struct{}, 1) srv *server.Server Discovery *discover.Protocol @@ -33,7 +32,7 @@ var ( const defaultZLC = `{ "level": "info", "development": false, - "outputPaths": ["stdout"], + "outputPaths": ["./autopeering.log"], "errorOutputPaths": ["stderr"], "encoding": "console", "encoderConfig": { @@ -151,12 +150,12 @@ func start() { }() // Only for debug - go func() { - for t := range time.NewTicker(2 * time.Second).C { - _ = t - printReport(zLogger) - } - }() + // go func() { + // for t := range time.NewTicker(2 * time.Second).C { + // _ = t + // printReport(zLogger) + // } + // }() <-close } @@ -176,18 +175,18 @@ func getMyIP() string { } // used only for debugging puropose -func printReport(log *zap.SugaredLogger) { - if Discovery == nil || Selection == nil { - return - } - knownPeers := Discovery.GetVerifiedPeers() - incoming := []*peer.Peer{} - outgoing := []*peer.Peer{} - if Selection != nil { - incoming = Selection.GetIncomingNeighbors() - outgoing = Selection.GetOutgoingNeighbors() - } - log.Info("Known peers:", len(knownPeers)) - log.Info("Chosen:", len(outgoing)) - log.Info("Accepted:", len(incoming)) -} +// func printReport(log *zap.SugaredLogger) { +// if Discovery == nil || Selection == nil { +// return +// } +// knownPeers := Discovery.GetVerifiedPeers() +// incoming := []*peer.Peer{} +// outgoing := []*peer.Peer{} +// if Selection != nil { +// incoming = Selection.GetIncomingNeighbors() +// outgoing = Selection.GetOutgoingNeighbors() +// } +// log.Info("Known peers:", len(knownPeers)) +// log.Info("Chosen:", len(outgoing)) +// log.Info("Accepted:", len(incoming)) +// } diff --git a/plugins/gossip/gossip.go b/plugins/gossip/gossip.go index 48800c448add8271a1b43c01da08d4c0e22e6f4f..64e5b778906cb465eec81bc8c3b6f781470064fd 100644 --- a/plugins/gossip/gossip.go +++ b/plugins/gossip/gossip.go @@ -18,7 +18,7 @@ import ( const defaultZLC = `{ "level": "info", "development": false, - "outputPaths": ["stdout"], + "outputPaths": ["./gossip.log"], "errorOutputPaths": ["stderr"], "encoding": "console", "encoderConfig": { @@ -37,7 +37,7 @@ const defaultZLC = `{ }` var ( - debugLevel = "debug" + debugLevel = "info" zLogger *zap.SugaredLogger mgr *gp.Manager ) diff --git a/runNetwork.sh b/runNetwork.sh index a9e84ee51b9ade925818400bf6899298fbf6bb9a..daa942e47e40f6cfd9427101e1c8c54043e6bac5 100755 --- a/runNetwork.sh +++ b/runNetwork.sh @@ -27,6 +27,6 @@ for i in `seq 1 $1`; do mkdir node_$i/logs cp ../shimmer 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 2TwlC5mtYVrCHNKG8zkFWmEUlL0pJPS1DOOC2U4yjwo=@127.0.0.1:14626 --node.LogLevel 4 --node.disablePlugins statusscreen --analysis.serverAddress 127.0.0.1:188 & cd .. done \ No newline at end of file