truffle-box / react-box

Truffle, Webpack and React boilerplate.
https://truffle-box.github.io/
MIT License
736 stars 251 forks source link

stored default value is 0 not 5 as expected #33

Closed varvarasd closed 5 years ago

varvarasd commented 6 years ago

Please note I've made no modifications. I've only followed the first 5 points in your Installation guide trufflebox

Squall949 commented 6 years ago

In my case, I found out it was caused by the chrome extension of MetaMask, which resulted in getting wrong network_id.

After I disabled the extension, the page works as expected.

Updated: We can set up Metamask with Truffle Develop (truffle 4 above) for local test. http://truffleframework.com/docs/advanced/truffle-with-metamask

ToJen commented 6 years ago

Note that the app tries to connect to MetaMask and if it does not find a connection, it will create a connection to 127.0.0.1:9545 (line 24 of src/utils/getWeb3.js). So your truffle.js should look like this:

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: {
    development: {
        host: "localhost",
        port: 9545,
        network_id: "*",
        gas: 4700000
    }
  }
};

Then when you run TestRPC it should be run as testrpc -p 9545.

Hope that helps!

matthhong commented 6 years ago

Also, you should have gotten a 12-word mnemonic after you run truffle develop.

First, set up your MetaMask network as in the link @Squall949 posted, then click Logout.

Then, log back in with that 12-word mnemonic, and use whatever password you want. Now, you should be able to confirm the transaction with that test account.

This way you won't have to disable MetaMask. It'll work and you'll see 5.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if no there is no reply to further comments.

no-name-max commented 5 years ago

Tried everything above, uninstalled and reinstalled everything and 0 still doesn't change to 5

picozzimichele commented 3 years ago

Maybe this has already been closed however: