I launched my geth with those parameters :

sudo geth --syncmode "light" --cache=2048 --datadir /mnt/ssd/ethereum --pprof.addr --pprof

It's running on a ubuntu server 20 on a raspberry pi 4.

When I try this :

from web3 import Web3, HTTPProvider

w3 = Web3(HTTPProvider(''))
latest_block_num = w3.eth.blockNumber
tx_count = w3.eth.getBlockTransactionCount(latest_block_num)
print("lastest block {} with a tx_count of {}".format(latest_block_num, tx_count))

I get :

'requests.exceptions.ConnectionError: HTTPConnectionPool(host='', port=8545): Max retries exceeded'

are my launch parameters corrects? Firewall is disabled on the ubuntu.




web3 = new Web3(new Web3.providers.WebsocketProvider(''));

you will need to use WebsocketProvider in order to subscribe to an event if you are using version web3.js@1.x

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.