https://trufflesuite.com/docs/truffle/
PREREQUISITE
- Solidity
- Remix IDE - Online - https://remix.ethereum.org/
- Infura for Ropsten credentials - Mainnet
- Ganache
- Meta Mask
- NodeJS & React
INSTALLATION
npm install -g truffle truffle compile truffle migrate --reset
truffle-config.js [in root folder, not in frontend folder]
- UnComment ropsten object
- Add ropsten URL [https://infura.io/dashboard/]
- Use wss link [wss://mainnet.infura.io/ws/v3/xxxxxxxxxxxxxx]
Use below command to migrate ROPSTEN
truffle migrate --ropsten
METAMASK
- Copy secret words from the Meta Mask extension.
- Save in ".secret" file.
VERIFY TRANSACTION
- First migrate the application and verify the transaction.
- We can verify the transaction from https://ropsten.etherscan.io/ using address.
TRUFFLE FRONTEND USING REACTJS
Create new folder and run the below command
truffle unbox react
it creates few folders and files with separate "truffle-conig.js" file. (Client, Migrations, Test, Truffle-Config.js)
START REACT APP
Go to the client folder and run below command
npm start
Access web app from http://localhost:3000
https://i.ibb.co/HG1cWKn/Screenshot-4.jpg
ADD GANACHE ACCOUNT TO METAMASK PLUGIN
- Click MetaMask extension in chrome browser.
- Click import account
- Now go to GANACHE app and select Private Key of any account.
- Paste the copied key in the metamask extension.
- Check Account List in metamask, Click on connect
- Refresh the React App - http://localhost:3000
- MetaMask extension will ask for transaction confirmation.
- After confirmation, Success Toast Message will be shown in browser.
Check Below Images for Reference
https://i.ibb.co/fXYrphX/Screenshot-1.jpg