0

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?

New contributor
JayK23 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1

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
  • 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
    2 days ago
  • 1
    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 2 days ago
  • Damn i didn't notice that. Thank you a lot!
    – JayK23
    2 days ago

Your Answer

JayK23 is a new contributor. Be nice, and check out our Code of Conduct.

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.