Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork committed Apr 30, 2024
1 parent 6c789dc commit 43478ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions disperser/dataapi/operator_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dataapi
import (
"context"
"errors"
"fmt"
"net"
"sort"
"strings"
Expand Down Expand Up @@ -109,6 +110,7 @@ func checkIsOnlineAndProcessOperator(operatorStatus OperatorOnlineStatus, operat
func ValidOperatorIP(socketString string, logger logging.Logger) bool {
host := strings.Split(socketString, ":")[0]
ips, err := net.LookupIP(host)
fmt.Printf(" Check Socket %s\n", socketString)
if err != nil {
logger.Error("Error resolving operator host IP", "host", host, "error", err)
return false
Expand All @@ -118,6 +120,10 @@ func ValidOperatorIP(socketString string, logger logging.Logger) bool {
logger.Error("IP address is nil", "host", host, "ips", ips)
return false
}
fmt.Printf(" IPS %v\n", ips)
fmt.Printf(" IP %v\n", ipAddr)
fmt.Printf(" isPrivate %v\n", ipAddr.IsPrivate())
fmt.Printf(" isUnspecified %v\n", ipAddr.IsUnspecified())
isValid := !ipAddr.IsPrivate() && !ipAddr.IsUnspecified()
logger.Debug("Operator IP validation", "socketString", socketString, "host", host, "ips", ips, "ipAddr", ipAddr, "isValid", isValid)

Expand Down
3 changes: 3 additions & 0 deletions disperser/dataapi/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ func TestPortCheck(t *testing.T) {
assert.Equal(t, false, response.DispersalOnline)
assert.Equal(t, "23.93.76.1:32006", response.RetrievalSocket)
assert.Equal(t, false, response.RetrievalOnline)

mockSubgraphApi.ExpectedCalls = nil
mockSubgraphApi.Calls = nil
}

func TestCheckBatcherHealthExpectServing(t *testing.T) {
Expand Down

0 comments on commit 43478ad

Please sign in to comment.