Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In this case, I run a geth node in local env, and A app in docker, How can I connect to geth from docker?
Default rpc address for geth is set to localhost. You can see which ip and port is used on linux with a tool like netstat, default should be 127.0.0.1 .
You can specify the server listening interface with this command --rpcaddr
geth --identity "testNode" --rpc --rpcaddr "0.0.0.0" --rpcport "8545" --rpccorsdomain "*" --datadir $datadir --port "30303" --nodiscover --rpcapi "personal,db,eth,net,web3,admin,txpool,miner" --networkid 100 --mine --etherbase "0xf6de496ec5601d74937ddd77af09c8cd4ba41ab5"
Required, but never shown