Error when deploying a smart contract with w3.eth.contract(): "The method eth_sendTransaction is not supported"

5.2k views Asked by At

I'm using Web3.py, and a permissioned Hyperledger Besu network.

When trying to use w3.eth.contract(...) method to deploy a smart contract into the network, I get the following error:

ValueError: {'code': -32604, 'message': 'The method eth_sendTransaction is not supported. Use eth_sendRawTransaction to send a signed transaction to Besu.'}

I suppose that eth_sendTransaction is being called when executing w3.eth.contract(...). Is there any other way of deploying a contract without ending up with this problem?

2

There are 2 answers

0
Khải Hồ Quang On BEST ANSWER

You need to sign the transaction before sending, more detail: https://web3py.readthedocs.io/en/stable/web3.eth.account.html#sign-a-transaction

0
Mikko Ohtamaa On