Which is the accurate method to get the block number to which a transaction is written after executing a transaction?

The response of push_transaction API is not accurate

Can anyone help me with this?

2 Answers 2



the "result" contains several pieces of information including the transaction id and the corresponding block number.

const result = await api.transact({...})
  • block number in the result could be wrong.
    – Muhzin
    Jan 4, 2021 at 11:50

You can access it from the command line using:

cleos get transaction TRANSACTION_ID | jq '.block_num'

  • I need the block number immediately after the transaction is executed to store it in my database.
    – Muhzin
    Feb 5, 2020 at 10:51
  • Can you explain in more detail in your question exactly what you want/need? Feb 5, 2020 at 11:01
  • I doing server-side transaction signing and push the transaction using push_transaction API. I have to store the returned Block number immediately in my DB for further reference. The problem is, the instantly returned block number is not accurate. I need the correct block number to which the transaction is written after pushing it
    – Muhzin
    Feb 6, 2020 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.