1

In this case, I run a geth node in local env, and A app in docker, How can I connect to geth from docker?

  • what kind of app are you running in docker ? What's the command you use to launch get and which protocole you want to communicate with ? – M. Riggi Nov 29 '18 at 11:03
  • Thx for replying! I run geth locally in this way: geth --identity testNode --rpc --rpcport 8545 --rpccorsdomain * --datadir ethereum_private_testnet --port 30303 --nodiscover --rpcapi personal,db,eth,net,web3 --networkid 100 , and then I run a python app in docker, I use ethjsonrpc lib, like this ``` >>> from ethjsonrpc import EthJsonRpc # to use Parity-specific methods, import ParityEthJsonRpc >>> c = EthJsonRpc('172.24.0.1', 8545) >>> c.net_version() ``` , BTW, I can run it in Mac successfully, but in Linux, it can't work – Junbao Wang Nov 30 '18 at 6:09
0

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

  • Yes, I . specified the rpc interface with --rpcaddr, like: 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", but it doesn't work – Junbao Wang Jan 3 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.