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