You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like hh node checks for port collisions on 127.0.01 IPv4 interface and will fail to start if a conflict is detected. However, it does not check for potential collisions on IPv6 interfaces, allowing it to start without a warning even when another process is already bound to the same port on IPv6.
Here you can see an example with an anvil chain node running on docker and a hardhat node running alongside, both listening to port 8545 but bound to different interfaces:
Now this might not be considered a bug but it's very inconvenient and confusing, specially considering that hardhat node only binds to 127.0.0.1 meaning any requests made to localhost will actually be handled by the anvil node.
Here is example output for the same RPC request using different interfaces (anvil node is configured to use chainId=0x539 and hardhat node uses chainId=0x7a69):
Version of Hardhat
2.22.18
What happened?
It looks like
hh node
checks for port collisions on127.0.01
IPv4 interface and will fail to start if a conflict is detected. However, it does not check for potential collisions on IPv6 interfaces, allowing it to start without a warning even when another process is already bound to the same port on IPv6.Here you can see an example with an
anvil
chain node running on docker and ahardhat
node running alongside, both listening to port 8545 but bound to different interfaces:Now this might not be considered a bug but it's very inconvenient and confusing, specially considering that
hardhat
node only binds to127.0.0.1
meaning any requests made tolocalhost
will actually be handled by theanvil
node.Here is example output for the same RPC request using different interfaces (
anvil
node is configured to usechainId=0x539
andhardhat
node useschainId=0x7a69
):A bit more info that might be useful:
Minimal reproduction steps
To reproduce:
docker-compose.yml
configurationhh node
on any hardhat projectSearch terms
hardhat,node,port,collision,docker,ipv4,ipv6
The text was updated successfully, but these errors were encountered: