简体   繁体   中英

Waiting for transaction confirmation using web3.py?

I am sending a transaction using:

sign_txn = web3.eth.account.signTransaction(token_tx, private_key=private_key)
tx_hash = web3.eth.sendRawTransaction(sign_txn.rawTransaction)

and I want to wait for the confirmation of the transaction to continue the work of my script, how can I do this so as not to lose extra time waiting for verification when the transaction is already completed?

I might misunderstand you,

but is web3.eth.get_transaction_receipt() what you are looking for?

https://web3py.readthedocs.io/en/stable/web3.eth.html#web3.eth.Eth.get_transaction_receipt

if not, please clarify what result you are expecting :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM