I'm building a blockchain game and in order to speed things up, I am also building a web application so users will read data from there.

so at first, I was thinking to listen to events and save their data on my DB, but then I read that the order of the events is not guaranteed, then I thought maybe you use the transactionIndex and logIndex sort them and then put the data in the database but then I read that the order can also be changed.

is there a way to get events by the order they were mined on the block? the timeline of the data is very important, I cant have it mixed with older events


You said the order can be changed, I think you may have met a block reorganization aka forked. You can try to save the data after a couple of blocks confirmnation.

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.