ethereum - 使用 w3.eth.contract() 部署智能合约时出错 : "The method eth_sendTransaction is not supported"

标签 ethereum smartcontracts web3py hyperledger-besu

我正在使用 Web3.py 和经过许可的 Hyperledger Besu 网络。

当尝试使用 w3.eth.contract(...) 方法将智能合约部署到网络中时,出现以下错误:

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

我认为执行 w3.eth.contract(...) 时正在调用 eth_sendTransaction。有没有其他方法可以部署合约而不会出现此问题?

最佳答案

发送前需要对交易进行签名,更多详情:https://web3py.readthedocs.io/en/stable/web3.eth.account.html#sign-a-transaction

关于ethereum - 使用 w3.eth.contract() 部署智能合约时出错 : "The method eth_sendTransaction is not supported",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67477675/

相关文章:

solidity - 尚不支持将 struct memory[] 类型的内存复制到存储

python - 通过python计算uniswap对地址

solidity - ERC721。如何使用 erc721 标准添加与属性(property)相关的附加信息

ethereum - 减少契约(Contract)规模的最简单方法

python - 一次发送多个交易

python - 导入错误 : No module named solcx

design-patterns - Solidity - 从工厂模式到克隆工厂模式

javascript - 安装 npm install --save-dev web3@1.0.0-beta.26 出错?

ethereum - 如何使用 web3j java 签署 erc20 token 交易

go - 如何获取交易的结果和状态