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 cli argument --rpc-allow-fallback-to-random-port #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fairax
Copy link

@fairax fairax commented Nov 22, 2022

Currently when Substrate node is starting it binds to configured JSON-RPC HTTP port and WS port. If this port is already in use then it binds to a random port instead. Sometimes this behavior creates problems. For example during development if a developer for some reason forgets to stop an old version of a node and starts a new version then all tests will run against the old version. Such an issue could be hard to diagnose.
This PR fixes the issue by making this behavior configurable and adding cli argument --rpc-allow-fallback-to-random-port. By default if the argument isn't used or if --rpc-allow-fallback-to-random-port=true is added then node behaves as before. But if --rpc-allow-fallback-to-random-port=false is added then a node will panic instead of binding to random port with Address is already in use error.

@fairax fairax self-assigned this Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant