2

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 Answers2

1

You are likely to use Infura node or similar.

You need to sign the transaction locally with Web3.py and have your app to manage the private key for you.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
1

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