Transaction Nonce
The nonce is an increasing numeric value which is used to uniquely identify transactions. A nonce can only be used once and until a transaction is mined, it is possible to send multiple versions of a transaction with the same nonce, however, once mined, any subsequent submissions will be rejected.
You can obtain the next available nonce via the cfx_getNextNonce method:
If you want send transaction continuously, the better way is to obtain the next available nonce within the pending transactions in txpool via txpool_nextNonce method:
However, go-conflux-sdk apply function Client.GetNextUsableNonce
for convinent, it will get nonce by txpool_nextNonce
first and if failed then get nonce by cfx_getNextNonce
The nonce can then be used to create your transaction object
Last updated