FAIR TRADE COCONUTS
Supplychain Blockchain Dapp for Udacity Nanodegree program
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
This program requires node.js and npm program environment
Please make sure you've already installed Tools and used the versions listed
- node (v8.12.0)
- npm (6.4.1)
- Ganache CLI v6.4.3 (ganache-core: 2.5.5)
- Truffle v4.1.15 (core: 4.1.15)
- Solidity - ^0.4.24 (solc-js)
- MetaMask version extension for browser (6.4.1)
- web3 (1.0.0-beta.54)
A step by step series of examples that tell you have to get a development env running
mkdir workspace
cd workspace
git clone https://github.com/osamabari/Supply-Chain-Solution-Project-Architect.git
Change to folder Supply-Chain-Solution-Project-Architect
and install all requisite npm packages (as listed in package.json
):
cd Architect-a-Blockchain-Supply-Chain-Solution
npm install
ganache-cli -m "volume sense walk more oak rocket success treat rug boat pool soup"
Your terminal should look similar below:
truffle compile
Your terminal should look similar below:
This will create the smart contract artifacts in folder build\contracts
.
truffle test
All 11 tests should pass.
truffle migrate
Your terminal should look similar below:
npm run dev
Your terminal should look similar below:
Now test the DApp with UI: Open http://localhost:3000 to use DApp User Interface.
the folowing ganache-cli accounts should be imported into MetaMask:
ganache-cli accounts used here...
Contract Owner: accounts[0] 0xfcf83e33d565a45411c7824d65084b435d5341b8
Farmer: accounts[1] 0xdc94ac22ec9eeddcf0fa46c0a2459b175864189c
Distributor: accounts[2] 0xbc0a52baff25eebc2c2a3d6ccb05db5e41f7da6e
Retailer: accounts[3] 0x59f48202795499a875c4d8eec510538d5365f1ce
Consumer: accounts[4] 0x335ca1a755db8bb13ddd6a6bb285eb91b3ec7b63
Add all actors into Contract:
- Add Farmer
- Add Distributor
- Add Retailer
- Add Consumer
- Harvest
- Process
- Pack
- For Sale
Activate Distributor Actions in following order:
- Buy
Activate Farmer Actions in following order:
- Ship
Activate Retailer Actions in following order:
- Receive
Activate Consumer Actions in following order:
- Purchase
- Ethereum - Ethereum is a decentralized platform that runs smart contracts to make the web faster, safer, and more open.
- Truffle Framework - Truffle is the most popular development framework for Ethereum with a mission to make your life a whole lot easier.
- Solidity
- Ganache-cli
- Truffle
- IPFS
- HTML
- JavaScript
- Node