2

Here is my code:

from web3 import Web3, HTTPProvider, IPCProvider

web3 = Web3(HTTPProvider('http://localhost:8545'))

print(web3.eth.blockNumber)

Below is the error:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10d8951d0>: Failed to establish a new connection: [Errno 61] Connection refused',))

Am I doing something wrong? Thanks all

  • Would you update your question to include the command you used to start your Ethereum node, and the output up through the first couple of logs showing that blocks are syncing? – carver Feb 22 '18 at 17:56
0

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',))

Seems to be ipc is running in different port/ip. Check with g/eth client.

0

All we can tell from the information provided in the question is that there is no server responding at http://localhost:8545.

This could be a variety of problems. Some common problems are:

  • The node was never started
  • The node was started, but it's not on the same computer as Web3.py (ie~ not on localhost)
  • The node is local, and started, but without the arguments needed to start the HTTP server
  • The node is local, started, and serving HTTP, but serving on a port other than 8545

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.