我正试图做一笔交易,但失败了。我的钱包里有1000个ETHs。我正在运行一些python脚本来进行事务处理。使用这个链接,我无法做到这一点。这份文件有点过时,我正在使用以下内容
nonce = web3.eth.getTransactionCount(<address>)
tx = {
'nonce':nonce,
'to': <address_2>,
'value': web3.toWei(100,'ether'),
'gas':2000000,
'gasPrice':web3.toWei('50','gwei')
}
web3.eth.send_transaction(tx)我得到以下错误:ValueError: {'message': 'from not found; is required', 'code': -32000, ....
我可以用private_key做同样的事情,但是因为ganache不需要我们签名就可以处理事务。我想知道如何创建交易,将以太从一个钱包发送到另一个钱包。
谢谢
发布于 2023-02-27 18:03:39
加起来就好。例如:
'from': web3.eth.coinbasehttps://ethereum.stackexchange.com/questions/145657
复制相似问题