I have web application and background queue that executes long lasting tasks. Both of them using truffle-privatekey-provider with same private key to sign/send transactions.
Now I ma experiencing issue with nonce mismatch - when background worker makes 5 tasks its nonce increases to 5 from zero. Meanwhile web application doesn't knows about it and trying to use old nonce (1) and failed.
I do not want to calculate nonce before each transaction (moreover - I am using truffle-contract to abstract myself from raw transactions).
Is there any ways to solve it?
eththat contains provider and perform connection initialization. It exports connectedweb3andcontracinstances. When trying to use it from independent apps simultaneously you've got this problem. – Alex G.P. Aug 23 '18 at 15:39contractfrom module and user it in 2 different processes. – Alex G.P. Aug 23 '18 at 15:45