Write
You can make a "transaction" interacting with a Smart Contract when you **need to update some state ** in the contract.
Import extend from web3py_ext to extend web3 to kaia web3
Import necessary utils
Load an account from private key
Create a Web3 instance with the specified kaia Baobab testnet URL
Also, you can change the provider URL from baobab to allthatnode.
Define an account list as a list type to use middleware
If you want to automatically sign and send when using transact function, use construct_sign_and_send_raw_middleware
Create a contract instance with its address and ABI
Set the contract address that you deployed in the deploy tutorial (Counter contract). You can see the address in your deploy tx receipt
Set the contract abi. You can get the ABI after compiled in remix or solc compiler
Call the view function of the contract and print the result before it is updated
Send a tx to update the contract state. This automatically sign and send the tx that includes the data calling the increment function
Wait the tx receipt from the blockchain and print the receipt after received
Call the view function again to see what number the counter have after the tx