1

I'm using web3py and web3js to send transactions on the Harmony EVM chain using sendRawTransaction, and i noticed that once my transaction is sent, the transactionIndex value will always be between 0 and 3. Why is that? And is there a way to set a specific index for my transactions?

1 Answer 1

2

transactionIndex will be set by miner. each block has many transactions which are ordered to mine. your transaction's index is 0 when the block goes to mine the transaction was first tx in that block. maybe you are using local dev node because in real networks a user cant get his/her tx all the time at first place in a block

3
  • 1
    It's not always 0, but it's always a low number between 0 and 3. Here is an example explorer.harmony.one/tx/…
    – JayK23
    Commented Nov 25, 2021 at 11:18
  • 2
    it's about gas price, miners will mine those txs with higher gas price first, at your block, your gas price was 0.00000405 then you reached 2 index, 0 index had more gas price: 0.0000054 and 4 index has lower than gas price as you : 0.00000002 Commented Nov 25, 2021 at 11:28
  • Damn i didn't notice that. Thank you a lot!
    – JayK23
    Commented Nov 25, 2021 at 11:58

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.