trufflesuite / ganache-cli-archive

Fast Ethereum RPC client for testing and development. See https://github.com/trufflesuite/ganache for current development.
https://www.trufflesuite.com/ganache
MIT License
3.36k stars 695 forks source link

Specified port silently ignored when using --fork option #766

Closed ItsNickBarry closed 3 years ago

ItsNickBarry commented 4 years ago

Expected Behavior

The default port of 8545 should be used even if the --fork option is used to connect to a remote URL with a port of 8545.

If the --port option is explicitly set, an error should be raised if the port cannot be used.

Current Behavior

When using the --fork option with a remote URL with a port of 8545, ganache runs on port 8546, even if --port 8545 is specified explicitly.

Steps to Reproduce

This command reproduces the problem:

yarn run ganache-cli --fork http://example.com:8545 --port 8545

This command does not:

yarn run ganache-cli --fork http://example.com:8546 --port 8545

Context

It appears that ganache is treating the remote port as unavailable locally, and silently using a different default port, even if that default port is specified explicitly. The only indication that a different port is being used is the output "Listening on 127.0.0.1:8546", which is easy to ignore since it is not an error message.

Your Environment

ItsNickBarry commented 3 years ago

Duplicate of #722. Fixed by #723.