1

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

The resposne of push_transaction API is not accurate

Can anyone help me with this?

0

You can access it from the command line using:

cleos get transaction TRANSACTION_ID | jq '.block_num'

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

Use EOSJS

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

const result = await api.transact({...})
|improve this answer|||||

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.