mjhm / create-react-dapp

Create React Ethereum dApps with no configuration.
MIT License
109 stars 19 forks source link

Question: why doesn't MetaMask show window show up each time I try and do a tx? #5

Open elie222 opened 6 years ago

elie222 commented 6 years ago

Thanks for this cool project! Looks like it could be really helpful to get started quickly.

I got playing with the project and was wondering why MetaMask doesn't show up when I vote? And is there a way to make MetaMask show up to also simulate what it will be like for users in production?

mjhm commented 6 years ago

@elie222 Thanks for the thoughtful questions. I'm "heads down" on another project right now, but I should be able to get back to this next weekend.

mjhm commented 6 years ago

Short answer: MetaMask will show up when you use the Rinkeby (npm run start_rinkeby) or Main networks. (Let me know if it doesn't.) The basic npm start just uses a local ganache-cli test network via a direct connection.

Longer answer The truffle.js configured out of the box to use direct host:port connections for the first three networks, and the PrivateKey provider for the last two. Then in the browser getWeb3.js resolves this configuration by using the direct host:port if a network connection is specified or falling back to using browser's "currentProvider" (i.e. MetaMask) if the network connection was not specified.

The network is specified by REACT_APP_ETH_NETWORK when the React app started (or built).