Skip to content
Snippets Groups Projects
Commit 36285a67 authored by Hans Moog's avatar Hans Moog
Browse files

Refactor: refactored autopeering module

parent 9bd059c3
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ package response ...@@ -2,7 +2,7 @@ package response
import ( import (
"github.com/iotaledger/goshimmer/plugins/autopeering/protocol/constants" "github.com/iotaledger/goshimmer/plugins/autopeering/protocol/constants"
"github.com/iotaledger/goshimmer/plugins/autopeering/protocol/peer" "github.com/iotaledger/goshimmer/plugins/autopeering/types/peer"
) )
const ( const (
......
...@@ -3,7 +3,7 @@ package response ...@@ -3,7 +3,7 @@ package response
import ( import (
"bytes" "bytes"
"github.com/iotaledger/goshimmer/packages/identity" "github.com/iotaledger/goshimmer/packages/identity"
"github.com/iotaledger/goshimmer/plugins/autopeering/protocol/peer" "github.com/iotaledger/goshimmer/plugins/autopeering/types/peer"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
......
package neighbormanager package neighbormanager
import ( import (
"github.com/iotaledger/goshimmer/plugins/autopeering/peermanager/types" "github.com/iotaledger/goshimmer/plugins/autopeering/types/peerregister"
) )
var ACCEPTED_NEIGHBORS = make(types.PeerRegister) var ACCEPTED_NEIGHBORS = make(peerregister.PeerRegister)
package neighbormanager package neighbormanager
import ( import (
"github.com/iotaledger/goshimmer/plugins/autopeering/peermanager/types" "github.com/iotaledger/goshimmer/plugins/autopeering/types/peerregister"
) )
var CHOSEN_NEIGHBORS = make(types.PeerRegister) var CHOSEN_NEIGHBORS = make(peerregister.PeerRegister)
...@@ -4,7 +4,8 @@ import ( ...@@ -4,7 +4,8 @@ import (
"fmt" "fmt"
"github.com/gdamore/tcell" "github.com/gdamore/tcell"
"github.com/iotaledger/goshimmer/packages/accountability" "github.com/iotaledger/goshimmer/packages/accountability"
"github.com/iotaledger/goshimmer/plugins/autopeering/peermanager" "github.com/iotaledger/goshimmer/plugins/autopeering/instances/knownpeers"
"github.com/iotaledger/goshimmer/plugins/autopeering/instances/neighborhood"
"github.com/iotaledger/goshimmer/plugins/gossip/neighbormanager" "github.com/iotaledger/goshimmer/plugins/gossip/neighbormanager"
"github.com/rivo/tview" "github.com/rivo/tview"
"math" "math"
...@@ -67,7 +68,7 @@ func (headerBar *UIHeaderBar) Update() { ...@@ -67,7 +68,7 @@ func (headerBar *UIHeaderBar) Update() {
fmt.Fprintln(headerBar.InfoContainer) fmt.Fprintln(headerBar.InfoContainer)
fmt.Fprintf(headerBar.InfoContainer, "[::b]Neighbors: [::d]%40v ", strconv.Itoa(len(neighbormanager.CHOSEN_NEIGHBORS)) + " chosen / " + strconv.Itoa(len(neighbormanager.ACCEPTED_NEIGHBORS)) + " accepted") fmt.Fprintf(headerBar.InfoContainer, "[::b]Neighbors: [::d]%40v ", strconv.Itoa(len(neighbormanager.CHOSEN_NEIGHBORS)) + " chosen / " + strconv.Itoa(len(neighbormanager.ACCEPTED_NEIGHBORS)) + " accepted")
fmt.Fprintln(headerBar.InfoContainer) fmt.Fprintln(headerBar.InfoContainer)
fmt.Fprintf(headerBar.InfoContainer, "[::b]Known Peers: [::d]%40v ", strconv.Itoa(len(peermanager.KNOWN_PEERS)) + " total / " + strconv.Itoa(len(peermanager.NEIGHBORHOOD)) + " neighborhood") fmt.Fprintf(headerBar.InfoContainer, "[::b]Known Peers: [::d]%40v ", strconv.Itoa(len(knownpeers.INSTANCE)) + " total / " + strconv.Itoa(len(neighborhood.INSTANCE)) + " neighborhood")
fmt.Fprintln(headerBar.InfoContainer) fmt.Fprintln(headerBar.InfoContainer)
fmt.Fprintf(headerBar.InfoContainer, "[::b]Uptime: [::d]"); fmt.Fprintf(headerBar.InfoContainer, "[::b]Uptime: [::d]");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment