I have opened an instance of ganache at localhost port 9545 where I can connect with web3.py. However when I am trying to perform a transact using the below code:
w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:9545'))
ExampleContract = w3.eth.contract(abi=abi, bytecode=bytecode)
tx_hash = ExampleContract.constructor().transact()
I am getting the following error:
ValueError: {'message': 'from not found; is required', 'code': -32000, 'data'
This is straight from the documentation here
Any ideas?
ExampleContract.deploy({'from': web3.eth.accounts[0], 'gasPrice': web3.eth.gasPrice, 'gas': web3.eth.getBlock('latest').gasLimit})
transact({'from': web3.eth.accounts[0], 'gasPrice': web3.eth.gasPrice, 'gas': web3.eth.getBlock('latest').gasLimit})
in your own code.