MetaMask : An Ethereum Wallet in your Browser
To connect your web3 js to the locally hosted truffle development we need metmask. You can download its Chrome Extension At MetaMask Chrome Extension.
Other Browser Users can find MetaMask Extension/AddOn On their respective browser stores.
After installing click on add new network and set your new network to localhost:3000 And also Add the account key to the first account that is account[0] with the respective secret key.
Note: Every time you start from fresh always remember to reset your metmask acount as your localhost starts from zero but the metmask always stores some cached data therefore it will thow error as the nonce would not match.
- Go to the blockchain folder by entering
cd blockchain - Enter
truffle complileto compile the contracts - Enter
truffle develop. It will start the development server. - Enter
migrate --resetto migrate the contracts. - After you have entered the
truffle compilecommand in 2nd step, a build/contracts folder will be generated inside the blockchain folder. Go to the project.json in the build folder and copy theabisarray. - Now Go to client/Abis.js and paste the array in
Projectabisvariable and save it.
To run the frontend go to the client folder cd client and type npm start
This will start a new development server at localhost:3000
- Add
.envfile- Add PORT ,MONGODB_URl
- Enter npm install in cmd to download all dependencies
nodemon/node index.jsto start the server
Any Doubts regarding Project can be addressed to me Any type of collabration and suggestions are also Welcomed 😁