Cardano-db-sync: Track the index of a transaction within a block

Created on 9 May 2020  ·  4Comments  ·  Source: input-output-hk/cardano-db-sync

Hi, the Atala Prism team has started integrating with cardano-db-sync and could not find a way to order transactions within a block. Can we plan on adding a column to track the transaction index?

Or, as a workaround or perhaps definite way, can we just sort by the sequential tx.id?

Thanks!

Most helpful comment

tx.id are generated by Postgres. They are not reliably monotonic.

I agree 100% that the index should be added.

All 4 comments

tx.id are generated by Postgres. They are not reliably monotonic.

I agree 100% that the index should be added.

OK. Let's add this. How urgent is it? What are you actually trying to do - ensure that transactions have been processed in the right order?

~The tx index is part of the tx and it should be recorded in the DB. The fact that it is not is an oversight.
Eg, if one wants to build a transaction, they need to know the exact index in the tx output.~

When I came back to this, I misread/misunderstood the question.

Yes, index of a transaction within a block would be easy to add and should be added.

Thank you, @erikd !

Was this page helpful?
0 / 5 - 0 ratings