1

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?

1

Use EOSJS

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

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

You can access it from the command line using:

cleos get transaction TRANSACTION_ID | jq '.block_num'

3
  • I need the block number immediately after the transaction is executed to store it in my database.
    – Muhzin
    Feb 5 '20 at 10:51
  • Can you explain in more detail in your question exactly what you want/need? Feb 5 '20 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 '20 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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