from web3 import Web3, IPCProvider
from web3.middleware import geth_poa_middleware

w3 = Web3(Web3.HTTPProvider('http://10.50.254.254:22001'))
w3.middleware_onion.inject(geth_poa_middleware, layer=0)

#print(w3.clientVersion)
#print(w3.eth.get_block('latest'))
#print(w3.isConnected())

abi = [
	{
		"inputs": [],
		"stateMutability": "nonpayable",
		"type": "constructor"
	},
	{
		"inputs": [],
		"name": "chef",
		"outputs": [
			{
				"internalType": "address",
				"name": "",
				"type": "address"
			}
		],
		"stateMutability": "view",
		"type": "function"
	}
]

print(w3.geth.personal.new_account('supersuperpassphrase'))

deployed_contract = w3.eth.contract(address="0x5D86a6e8F1524DbC23f62653CBF17db057a2cB0e", abi=abi)

print(deployed_contract.functions.chef().address)
