This Project will walk you through using Truffle and Ganache to deploy the SimpleStorage contract, making calls to it, and sending transactions to change the contract's state..
npm install -g truffle
/** Check version of the truffle */
truffle version
After you installed truffle, now it is the time unbox the relevant template for our project. In this project we will work on React so will unbox a React template.
truffle unbox react
This is the command for unboxing or getting the React project template. More truffle buxes https://trufflesuite.com/boxes/
- Compile:
truffle compile
.This will compile all solidity contracts which are presented in the contracts folder. - Migrate:
truffle migrate
.This command will deploy the contratcs on the testnet which specified intruffle-config.js
- Test Contracts:
truffle test
.Will run all tests in test folder for contracts and will check the contracts are running or not. - Test dapp:
cd client && npm test
- Run Dev Server:
cd client & npm run start
. Start the react dev server. - Build for Production:
cd client & npm run build
In this project we will use a test network for deploying contracts. For setting up ganache in project, firstly we need to install it. I did traing how you can install it via terminal in pervious project. This time I'm goting to train to install ganache from UI. Open https://trufflesuite.com/ganache/ and click on Download