From 43478ade8cb69f50aadc08e71224108d1e7cc257 Mon Sep 17 00:00:00 2001 From: Patrick Schork Date: Tue, 30 Apr 2024 01:28:56 -0700 Subject: [PATCH] Debug --- disperser/dataapi/operator_handlers.go | 6 ++++++ disperser/dataapi/server_test.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/disperser/dataapi/operator_handlers.go b/disperser/dataapi/operator_handlers.go index 8e9e85084a..4fcb965a3a 100644 --- a/disperser/dataapi/operator_handlers.go +++ b/disperser/dataapi/operator_handlers.go @@ -3,6 +3,7 @@ package dataapi import ( "context" "errors" + "fmt" "net" "sort" "strings" @@ -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 @@ -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) diff --git a/disperser/dataapi/server_test.go b/disperser/dataapi/server_test.go index a0c0972c95..ac0cc573bc 100644 --- a/disperser/dataapi/server_test.go +++ b/disperser/dataapi/server_test.go @@ -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) {