MolochVentures / moloch-monorepo

33 stars 33 forks source link

React Frontend doesn't load development network contracts. #135

Open Canalytic opened 5 years ago

Canalytic commented 5 years ago

Follow readme.md to

- create subgraph

- run truffle tests to populate graph and update contract address

- run subgraph

- run frontend

Frontend loads successfully but loads mainnet contracts. Then tried to edit the frontend/.env file for local host, ensuring that the:

moloch.address 0xf25186B5081Ff5cE73482AD761DB0eB0d25abfBF simpleToken.address 0x345cA3e014Aaf5dcA488057592ee47305D9B3e10 guildBank.address 0xB9462EF3441346dBc6E49236Edbb0dF207db09B7

NODE_PATH=src REACT_APP_MOLOCH_ADDRESS=0xf25186B5081Ff5cE73482AD761DB0eB0d25abfBF REACT_APP_GUILD_BANK_ADDRESS=0xB9462EF3441346dBc6E49236Edbb0dF207db09B7 REACT_APP_ETH_URL=http://localhost:8545 REACT_APP_TOKEN_ADDRESS=0x345cA3e014Aaf5dcA488057592ee47305D9B3e10 REACT_APP_MEDIANIZER_ADDRESS=0x729D19f657BD0614b4985Cf1D82531c67569197B REACT_APP_GRAPH_NODE_URI=http://127.0.0.1:8000/subgraphs/name/moloch

are populated in the file, but this breaks the frontend

Screen Shot 2019-10-10 at 1 40 53 AM

I think that starting ganache differently might solve the problem but haven't found solution yet. ganache-cli -h 0.0.0.0 -m \"fetch local valve black attend double eye excitplanet primary install allow\" -a 100

Or alternatively if anyone knows how to find the correct REACT_APP_MEDIANIZER_ADDRESS local development.

rhlsthrm commented 5 years ago

Hey @Canalytic, you will have to deploy your own medianizer contract if you want to do this. Alternatively, you could do something like REACT_APP_MEDIANIZER_ADDRESS=0x0 and check in the app if it's set to 0x0 and if so, hardcode it.