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

cmd/juno: add --instance flag #1905

Closed
wants to merge 2 commits into from
Closed

cmd/juno: add --instance flag #1905

wants to merge 2 commits into from

Conversation

weiihann
Copy link
Contributor

@weiihann weiihann commented Jun 13, 2024

Description

This PR adds a new flag called --instance to initialize port numbers automatically based on the instance count. This flag affects the following ports:

  • http-port
  • grpc-port
  • metrics-port
  • pprof-port
  • ws-port

Example

Each instance count will increment the default value of the respective ports by 10. For example:

The default value of each port is as follows:

  • grpc-port = 6064
  • http-port = 6060
  • metrics-port = 9090
  • pprof-port = 6062
  • ws-port = 6061

Command: ./juno --instance 2
Then the ports would have the following numbers:

  • grpc-port = 6074
  • http-port = 6070
  • metrics-port = 9100
  • pprof-port = 6072
  • ws-port = 6071

Rationale

This feature is useful for initializing multiple instances of Juno nodes, without having to care for the port conflict issues.

@weiihann weiihann force-pushed the weiihann/instance-flag branch from 93a0c19 to 63f83b2 Compare June 13, 2024 06:53
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.40%. Comparing base (4e6dcd7) to head (3bb40da).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1905      +/-   ##
==========================================
- Coverage   75.43%   75.40%   -0.04%     
==========================================
  Files          97       97              
  Lines        8342     8355      +13     
==========================================
+ Hits         6293     6300       +7     
- Misses       1519     1523       +4     
- Partials      530      532       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Initialize port numbers automatically with `--instance` to avoid port conflicts
@weiihann weiihann force-pushed the weiihann/instance-flag branch from 63f83b2 to 495d420 Compare June 13, 2024 08:14
@weiihann
Copy link
Contributor Author

Closing this, additional flags are harder to maintain.

@weiihann weiihann closed this Jun 14, 2024
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.

1 participant