React app integration with solidity smart contract in ethereum using web3 library
-
Make sure you have ganache and truffle installed and run these commands from solidity folder
npm run chaintruffle migrate --reset -
In the client/src folder, make sure
dataProvider.jsfile has ganache contract address activated (line 4). -
In client folder, run
npm startto run development server
-
Create
.envfile in the solidity folder, and paste your mnemonics and infura key according to the.env.samplefile provided. You can retrieve your mnemonics from the metamask seed phrase -
Deploy contracts to Rinkeby network, by running
npm run deployfrom the solidity folder. Make sure to have fake rinkeby ether in the first account from the mnemonics -
In the client/src folder, make sure
dataProvider.jsfile has rinkeby contract address activated (line 5). -
In client folder, run
npm startto run development server
- Create account on netlify
- Install
netlify-clion your pcnpm install netlify-cli -g - Run
netlify loginand authorize your pc on browser - Go to repo, client folder, and run
npm run buildand thennetlify deploy --prod --dir=./build