Currently I'm implementing an interface to the Hyperledger Fabric using Jupyter and fabric-sdk-py. I want to submit a transaction and/or evaluate tranactions using Button ipywidget (simple example is):
def _check_id(b):
x = await contract.evaluate_transaction('queryUnprotectedEntry', [_id_info.value], user)
_check_id_button.on_click(_check_id)
Of course this doesn't work since await is called outside of an async function. If I use async def _check_id(b) I get problems because _check_id' was never awaited.
If I use asyncio.run or asyncio.get_event_loop().run_until_complete, it doesn't work as well with This event loop is already running
What would be the way for a button to execute an async function using on_click?