When using Testrpc, the error appears that tx has an invalid nonce value.

Asked 1 years ago, Updated 1 years ago, 130 views

I am studying truffles recently and am working on the following documentary: http://truffleframework.com/tutorials/pet-shop

Whenever I try to cause a transaction, the error below appears.

Error: Error: the tx doesn't have the correct nonce. account has nonce of: 14 tx has nonce of: 0

To solve this error, I searched a lot online and read a lot of articles, but I couldn't get an answer to this error.

From what I've looked up so far, I can't find the previous transaction hash value when a new transaction occurs, so I think it's an error.

Source: https://stackoverflow.com/questions/45585735/testrpc-the-tx-doesnt-have-the-correct-nonce This question is authorized to change the same condition (Available under the https://creativecommons.org/licenses/by-sa/3.0/deed.ko ) license.

node.js ethereum truffle metamask

2022-09-22 18:56

2 Answers

Try reconnecting to the TestRPC network from Metamask.

I had the same problem, but when I reconnected with a new TestRPC node, it was solved by accident.


2022-09-22 18:56

The Metamask 3.14.1 version allows account initialization. Click Setting and click the Reset Account button. If you press this button, all previous transactions will disappear. The average user won't be able to use this feature. This feature is mainly used by developers who want to initialize the network and use the account as it is, to make the network ID of the meta mask cleanly initialized. Note: Thank you, https://stackoverflow.com/users/443016/tim-wu[Tim Wu]2)

Correction to past writing: The answer above is correct. However, if you are using Truffle4 and Truffle Develop together, you will need to uninstall Metamask and reinstall it every time you run Truffle Develop.

There are three errors listed in the feather hub: https://github.com/trufflesuite/truffle/issues/681, https://github.com/trufflesuite/ganache/issues/112, https://github.com/MetaMask/metamask-extension/issues/1999

In summary, you will need to continue reinstalling while developers fix errors.


2022-09-22 18:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.