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?
Add a comment
|
1 Answer
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
-
1It's not always 0, but it's always a low number between 0 and 3. Here is an example explorer.harmony.one/tx/…– JayK23Commented Nov 25, 2021 at 11:18
-
2it'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
-