daostack / arc.js_legacy

This repository is deprecated
GNU General Public License v3.0
28 stars 14 forks source link

make optional the network id in the ganache command #309

Closed dkent600 closed 6 years ago

dkent600 commented 6 years ago

The ganache command currently hardcodes the network id. This enables us to hardcode the address of the GEN token that is created at migration time. However, when running against MetaMask, this causes problems. MM caches a nonce value for every network id. The cached nonce value gets out-of-sync with ganache when restarting ganache, causing transactions to fail.

This also happens with ganacheDb, where having a constant network Id is unavoidable.

Thus we need to make optional the hardcoded network id in the ganache command. Turning it off causes the GEN token to be created at an unpredictable address, but it at least allows one to use MM against ganache.

Be sure to publically document this in arc.js and Vanille.

tibetsprague commented 6 years ago

All you have to do is Reset your account in MetaMask, so I dont think this is something to worry about

dkent600 commented 6 years ago

@tibetsprague Does resetting cause imported accounts to go away?

tibetsprague commented 6 years ago

no, it resets the transactions and nonce for the current account you have selected

dkent600 commented 6 years ago

ok, it works, thanks @tibetsprague! Steps:

  1. In the MetaMask home window, click the properties icon in the upper right.
  2. Select "Settings" in the dropdown menu
  3. Scroll to the bottom and select "Reset Account"