Problem
The RPC server is hardcoded to 127.0.0.1 in main.py:659:
await rpc_server.start(host="127.0.0.1", port=rpc_port)
The Dockerfile correctly passes --host 0.0.0.0 for the P2P
server via CMD, but the RPC server ignores the --host flag
entirely — it is hardcoded in Python code.
This creates a contradiction:
|
Config |
Result |
| P2P server |
--host 0.0.0.0 via CMD |
reachable from outside |
| RPC server |
hardcoded 127.0.0.1 |
connection refused |
| HEALTHCHECK |
hits 127.0.0.1:8545 |
passes inside container |
EXPOSE |
only declares 9000 |
8545 not declared |
Steps to Reproduce
docker run -p 8545:8545 -p 9000:9000 ghcr.io/stabilitynexus/minichain
curl http://localhost:8545
# connection refused
Expected Behaviour
RPC server should be reachable from outside the container
when -p 8545:8545 is passed.
Proposed Fix
Three small changes:
- Add
--rpc-host CLI argument to main.py (default
127.0.0.1 for bare metal safety)
- Use
args.rpc_host instead of hardcoded "127.0.0.1"
on line 659
- Pass
--rpc-host 0.0.0.0 in Dockerfile CMD and add
EXPOSE 8545
Problem
The RPC server is hardcoded to
127.0.0.1inmain.py:659:The Dockerfile correctly passes
--host 0.0.0.0for the P2Pserver via CMD, but the RPC server ignores the
--hostflagentirely — it is hardcoded in Python code.
This creates a contradiction:
--host 0.0.0.0via CMD127.0.0.1127.0.0.1:8545EXPOSE9000Steps to Reproduce
docker run -p 8545:8545 -p 9000:9000 ghcr.io/stabilitynexus/minichain curl http://localhost:8545 # connection refusedExpected Behaviour
RPC server should be reachable from outside the container
when
-p 8545:8545is passed.Proposed Fix
Three small changes:
--rpc-hostCLI argument tomain.py(default127.0.0.1for bare metal safety)args.rpc_hostinstead of hardcoded"127.0.0.1"on line 659
--rpc-host 0.0.0.0in Dockerfile CMD and addEXPOSE 8545