Skip to content

Use the supernode ip for gateway#121

Closed
mateeullahmalik wants to merge 1 commit intomasterfrom
fixGatewayPortBinding
Closed

Use the supernode ip for gateway#121
mateeullahmalik wants to merge 1 commit intomasterfrom
fixGatewayPortBinding

Conversation

@mateeullahmalik
Copy link
Collaborator

No description provided.

@a-ok123 a-ok123 requested review from a-ok123 and Copilot August 14, 2025 01:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the HTTP gateway server to bind to a specific IP address instead of listening on all interfaces. The change allows the gateway to use the supernode's configured IP address for more precise network control.

  • Added IP address parameter to the gateway server configuration
  • Modified server binding to use the specific IP address with the port
  • Updated logging to include the bound IP address for better observability

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
supernode/node/supernode/gateway/server.go Added ipAddress field to Server struct and modified NewServer to accept IP address parameter, updated server binding logic
supernode/cmd/start.go Updated gateway server initialization to pass the supernode's configured IP address

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


// NewServer creates a new HTTP gateway server that directly calls the service
func NewServer(port int, supernodeServer pb.SupernodeServiceServer) (*Server, error) {
func NewServer(ipAddress string, port int, supernodeServer pb.SupernodeServiceServer) (*Server, error) {
Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ipAddress parameter lacks input validation. Consider validating that the provided IP address is valid using net.ParseIP() to prevent runtime errors when starting the server.

Copilot uses AI. Check for mistakes.
@mateeullahmalik mateeullahmalik deleted the fixGatewayPortBinding branch August 21, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants