create-react-dapp icon indicating copy to clipboard operation
create-react-dapp copied to clipboard

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

Open elie222 opened this issue 7 years ago • 2 comments

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?

elie222 avatar Apr 05 '18 01:04 elie222

@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 avatar Apr 07 '18 13:04 mjhm

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).

mjhm avatar Apr 15 '18 17:04 mjhm