Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to listen on 0.0.0.0 #12

Merged
merged 4 commits into from
May 7, 2024
Merged

Conversation

gjermundgaraba
Copy link
Contributor

@gjermundgaraba gjermundgaraba commented May 7, 2024

I wanted to run mock-da with interchaintest as a sidecar, but quickly (not quickly enough) found out that the process only listens on localhost. So I had to make a little adjustment to support listening on 0.0.0.0 so that it would be accessible between containers.

If you want this change, here it is :) I updated the readme as well to document the change.

Summary by CodeRabbit

  • New Features
    • Introduced a new -listen-all flag for mock-da to enable listening on all network interfaces, allowing access from other machines.

Copy link

coderabbitai bot commented May 7, 2024

Walkthrough

The update introduces a new -listen-all flag for the mock-da command, enhancing network accessibility. This change involves adjusting address configuration and port definitions to broaden the service's reach.

Changes

File Path Change Summary
README.md Introduced -listen-all flag for broader network accessibility.
cmd/mock-da/main.go Updated constant from MockDAAddress to MockDAPort, added listenAll flag, and adjusted address logic.
.golangci.yml Removed deadcode, structcheck, and varcheck linters; excluded exclude-use-default issue.

🐰✨
A tiny flag unfurls, a leap so bold,
Across the networks, far and wide it's told.
From localhost bounds, we now break free,
Listen on all, for all to see!
Hoppity hop, on every port we stride,
With every packet, our joy won't hide! 🌍🚀
🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@RollkitBot RollkitBot requested review from S1nus, tuxcanfly and tzdybal May 7, 2024 20:49
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Out of diff range and nitpick comments (1)
README.md (1)

22-22: Consider adding a comma after "flag" for improved readability: "You can also run mock-da with a -listen-all flag, which will make the process listen on 0.0.0.0 so that it can be accessed from other machines."

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 592d9dd and ef2ce72.
Files selected for processing (2)
  • README.md (1 hunks)
  • cmd/mock-da/main.go (1 hunks)
Additional Context Used
LanguageTool (2)
README.md (2)

Near line 22: Possible missing comma found.
Context: ...n also run mock-da with a -listen-all flag which will make the process listen on 0...


Near line 83: Unpaired symbol: ‘]’ seems to be missing
Context: ... "id": "1" } ``` ## References [1] [go-da][go-da] [2] [xh][xh] [go-da]: ht...

Additional comments not posted (3)
cmd/mock-da/main.go (3)

18-19: The change from MockDAAddress to MockDAPort is clear and aligns well with the PR's objectives to enhance network configuration flexibility.


22-22: The introduction of the listenAll flag with a default value of false is a thoughtful approach to maintain backward compatibility while offering new functionality.


29-33: The logic to determine the server's listening IP based on the listenAll flag is implemented correctly and effectively.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ef2ce72 and a40e5d2.
Files selected for processing (1)
  • cmd/mock-da/main.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/mock-da/main.go

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between a40e5d2 and 4959eff.
Files selected for processing (1)
  • .golangci.yml (2 hunks)
Files skipped from review due to trivial changes (1)
  • .golangci.yml

@tuxcanfly
Copy link
Collaborator

Thanks @gjermundgaraba for the contribution! Updated to use BoolVar for consistency.

@tuxcanfly tuxcanfly merged commit 55fe3c2 into rollkit:main May 7, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants