I deployed a private network via geth and posted a smart contract there. Accounts are set in the genesis block
I'm creating a python function in which I want to call a smart contract function
import web3
import json
class Estate():
with open("abi.txt", 'r') as file:
abi = json.load(file)
contract_address = "0x4FD52ce1140d67b8c721AB7967eeca44FE56c883"
contract_address = web3.Web3.toChecksumAddress(contract_address)
w3 = web3.Web3(web3.HTTPProvider('http://127.0.0.1:8545'))
con = w3.eth.contract(address=contract_address, abi=abi)
def create_estate(self, address, info, square):
address = web3.Web3.toChecksumAddress(address)
print(self.con.functions.create_estate(address, info, square).transact())
#self.w3.eth.waitForTransactionReceipt(tx)
c = Estate()
c.create_estate("0xE64021f5387Dc5FA859e0641437a45542D511e7E","street", 200)
I am getting the following error:
web3.exceptions.ExtraDataLengthError: The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer to http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details. The full extraData is: HexBytes('0xda83010a0d846765746888676f312e31372e328777696e646f7773000000000053ea481c4aca3824d51d3c8103abe60179d3f1c4ec68a0c87d5533e8e0580e14433b6cf8a285b519add550d59e70e60619721861b2d855cb7a175978610bb65500')