On the playground, in order to get the next tx_id
, you'll have to query StarkEx gateway and call get_first_unused_tx_id
, this is needed since there are many users and they need to sync the next tx_id
. Note that StarkEx won't process two transactions with the same tx_id
and won't process a transaction if the previous sequential tx_id
was not processed yet. On your own private setup, you don't need to query this parameter since you are the only one sending transactions and you manage the tx_id
. You can send the transaction out of order but make sure you fill all the tx_id
slots eventually; StarkEx will process the transactions by the order of their tx_id
, so in case that one tx_id
is missing, StarkEx will stop proccessing and wait for it to be submitted. Moreover, since the gateway can process many transactions in parallel, it is not guaranteed to get the actual next unused tx_id
, for that reason you must not use get_first_unused_tx_id
at all on your own StarkEx setup.