Using instructions from here I have a local private Ethereum blockchain running in a distributed envoirnment as per the diagram below:

|---------| Blockchain Node ( |---------|

|---------| Processor Node ( |---------|

Blockchain Node - geth terminal is running here.

Processor Node - does some calculations and write to the Blockchain Node where geth terminal is running. A web3.py script is running here which sends contract deployment request to the blockchain node.

These two nodes are in the same network, and can ping each other. Also I have tried file transfer with Python and its working perfectly.

My problem is: When I try to connected from the Processor Node to the Blockchain Node through this code unable to connect. Please help where I am making mistake?

w3 = Web3(

account = Account()

acct = account.privateKeyToAccount(private_key_of_Processing_Node) // also tried with private key of Blockchain node EDIT

Error: Could not discover provider while making request: method:eth_chainId

Also I am using following command to connect to geth on the blockchain node

geth --port 3000 --networkid 58343 --datadir=./eth-blockchain --maxpeers=5 --rpc --rpcport 8543 --rpcaddr --rpccorsdomain "*" --rpcapi "eth,net,web3,personal,miner" console 2>>eth.log

  • 1
    You have to connect to the RPC port, from the processor node w3 = Web3(Web3.HTTPProvider("")).
    – Ismael
    Commented Feb 16, 2021 at 15:36

1 Answer 1

w3 = Web3(new Web3.providers.HttpProvider('<rpc port>'))

"rpc port" you set in geth command lines params( --rpcport ) in blockchain node.

  • This command is giving me syntax error. Changed to w3 = Web3(HTTPProvider('')), but same error. I think am making some error in the geth call. Please check my edits
    – Tabz
    Commented Feb 16, 2021 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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