Truffle v5.0.21
node v8.11.3
web3@1.0.0-beta.37
0x80e6C3F217798eF4Ae184c75F9FCB25798e6DCC8
I used one library called Roles which made it easier to manage AccessControl in my DAPP. It made it easy to add and remove roles in each of my AccessControl contracts (FarmerRole.sol, DistributorRole.sol, RetailerRole.sol, and ConsumerRole.sol).
I did not use IPFS to deliver my website for this project. However, I could have added my HTML, CSS, and JS files to IPFS in order to fully decentralize my Supply Chain DAPP.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Please make sure you've already installed ganache-cli, Truffle and enabled MetaMask extension in your browser.
A step by step series of examples that tell you have to get a development env running
Clone this repository:
git clone https://github.com/udacity/nd1309/tree/master/course-5/project-6
Change directory to project-6
folder and install all requisite npm packages (as listed in package.json
):
cd project-6
npm install
Launch Ganache:
ganache-cli -m "spirit supply whale amount human item harsh scare congress discover talent hamster"
In a separate terminal window, Compile smart contracts:
truffle compile
This will create the smart contract artifacts in folder build\contracts
.
Migrate smart contracts to the locally running blockchain, ganache-cli:
truffle migrate
Test smart contracts:
truffle test
All 10 tests should pass.
In a separate terminal window, launch the DApp:
npm run dev