1

I am trying to make a transaction, but failing. I have ganache-cli with 1000 ETHs in each wallet. I am running some python scripts to make transaction. Using this link, I am not able to do so. This document is little outdated, and I am using the following

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)

I get the following error: ValueError: {'message': 'from not found; is required', 'code': -32000, ....

I can do the same thing with private_key but since ganache handles transaction without us signing. I wanted to know how can I create transaction to send Ethers from one wallet to another.

Thank you

1 Answer 1

1

Just add from. Eg.

'from': web3.eth.coinbase
0

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.