Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork committed Apr 23, 2024
1 parent 8e62612 commit d9cc1b3
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 76 deletions.
36 changes: 18 additions & 18 deletions api/grpc/scanner/scanner.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 41 additions & 41 deletions api/grpc/scanner/scanner_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/proto/scanner/scanner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ message PortCheckResponse {
string msg = 4;
}

service ReachabilityService {
service Reachability {
rpc PortCheck (PortCheckRequest) returns (PortCheckResponse) {}
rpc HostPortCheck (PortCheckRequest) returns (PortCheckResponse) {}
rpc HostPortCheck (HostPortCheckRequest) returns (PortCheckResponse) {}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.21.1
require (
github.com/Layr-Labs/eigenda/api v0.0.0
github.com/Layr-Labs/eigensdk-go v0.1.6-0.20240409054704-47c41ef999a9
github.com/Ullaakut/nmap/v3 v3.0.3
github.com/Ullaakut/nmap v2.0.2+incompatible
github.com/aws/aws-sdk-go-v2 v1.26.0
github.com/aws/aws-sdk-go-v2/credentials v1.17.9
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.13.12
Expand Down
4 changes: 1 addition & 3 deletions scanner/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ func ScannerMain(ctx *cli.Context) error {
return err
}

//ratelimiter := ratelimit.NewRateLimiter(globalParams, bucketStore, logger)

// Creates the GRPC server.
server := grpc.NewServer(config, scanner, logger) //, ratelimiter)
server := grpc.NewServer(config, scanner, logger)
if err := server.Start(); err != nil {
log.Fatalf("Failed to start server: %v", err)
}
Expand Down
14 changes: 4 additions & 10 deletions scanner/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

pb "github.com/Layr-Labs/eigenda/api/grpc/scanner"
"github.com/Layr-Labs/eigenda/common"
"github.com/Layr-Labs/eigenda/scanner"
"github.com/Layr-Labs/eigensdk-go/logging"
"github.com/Ullaakut/nmap"
Expand All @@ -27,17 +26,14 @@ type Server struct {
scanner *scanner.Scanner
config *scanner.Config
logger logging.Logger

ratelimiter common.RateLimiter
}

// NewServer func
func NewServer(config *scanner.Config, scanner *scanner.Scanner, logger logging.Logger) *Server {
return &Server{
config: config,
logger: logger,
scanner: scanner,
ratelimiter: nil,
config: config,
logger: logger,
scanner: scanner,
}
}

Expand All @@ -50,8 +46,6 @@ func (s *Server) Start() error {
log.Fatalf("failed to start tcp listener: %v", err)
}

s.logger.Info("registering service")
//opt := grpc.MaxRecvMsgSize(128)
gs := grpc.NewServer()
reflection.Register(gs)
pb.RegisterReachabilityServer(gs, s)
Expand Down Expand Up @@ -107,7 +101,7 @@ func (s *Server) PortCheck(ctx context.Context, in *pb.PortCheckRequest) (*pb.Po
}

port := host.Ports[0]
fmt.Printf("\tPort %d %s\n", port.ID, port.State)
s.logger.Info("Port Check", ip, port.ID, port.State)
fmt.Printf("Host scanned in %.2f seconds\n", result.Stats.Finished.Elapsed)
return &pb.PortCheckResponse{Status: port.State.String(), Msg: "", Port: in.Port, Host: ip}, nil
}
Expand Down
1 change: 0 additions & 1 deletion scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/prometheus/client_golang/prometheus"

//"github.com/Layr-Labs/eigenda/api/grpc/scanner"
"github.com/Layr-Labs/eigensdk-go/logging"
"github.com/Layr-Labs/eigensdk-go/metrics"
)
Expand Down

0 comments on commit d9cc1b3

Please sign in to comment.