I started running RSK node on Windows and when I tried:
curl -X POST -H "Content-Type:application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:4444
I always get:
{"jsonrpc":"2.0","id":1,"result":"0x0"}
This obviously means that my node is not syncing,
so I checked the logs and found Address already in use
:
Exception in thread "UDPServer" co.rsk.net.discovery.
PeerDiscoveryException: Discovery can't be started.
At co.rsk.net.discovery.UDPServer$1.run(UDPServer.java:65) - caused by: java.net.BindException: Address already in use...
I do not have any other RSK instance running, so I'm not sure why I'm getting this error.
You need to change your peer discovery port (peer.port
)
to use a different one.
This is because RSK Mainnet uses 5050
as default peer discovery port
and Windows usually has smaller port numbers already assigned for other uses.
For example, to start RSKj with a peer discovery port of 50506
,
use the following command:
java \
-D peer.port=50506 \
-cp <PATH-TO-THE-RSKJ-JAR> \
co.rsk.Start \
--regtest
You may also choose to set peer.port=50506
in the relevant config file.
NOTE: This issue does not usually occur on RSK Testnet
because its default peer discovery port is 50505
,
a much larger port number.
This issue usually does not occur on other operating systems
because that RSK Mainnet port number is typically unused.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With