A decentralized marketplace built on the Ethereum blockchain. Developed using the Truffle framework and uses IPFS via Infura for storing large data. This project is part of my final year project 2018/19 at University of Sussex.
Author: 164577
Visit the docs site: https://ks510.github.io/trade-now-docs
Can also be run locally by cloning this project, installing all package dependencies
using npm install
and running these commands from the project root directory:
cd docs/website
npm start
The documentation site was created using OpenZeppelin's solidity-docgen using the NatSpec format and docusaurus to generate static web pages. The site is hosted on Github Pages.
- npm
- MetaMask (chrome extension)
- Truffle
- Solidity
- IPFS via Infura
- IPFS API
- React.js
- React Bootstrap v0.32.4
- web3.js
trade-now/
client/
public/
src/
components/
containers/
contracts/
...
contracts/
docs/
migrations/
test/
...
truffle.config.js
Brief summary of contents in key directories:
client/
the frontend client application (React project and assets)client/src/
all React source code and assets for UIclient/src/components
custom components reused in the React appclient/src/containers
high level components representing web pagesclient/src/contracts
compiled contract ABI files (.json)contracts/
the smart contracts' source codedocs/
documentation files and docusaurus project for generating docs sitemigration/
deployment scripts for migrating smart contracts to blockchaintest/
tests for smart contracts (Solidity and JavaScript tests)truffle-config.js
Truffle project configuration file, specifies to use local test blockchain (via Ganache)
These instructions are intended for Mac OS users. Other operating systems may need to run different commands.
- Clone this project using
git clone https://github.com/ks510/trade-now
- Go to the cloned directory and run
npm install
to download and install all package dependencies - Install and start up Ganache (GUI) to start the local development blockchain and copy the RPC Server URL e.g.
http://127.0.0.1:7574
. Ganache will also create 10 test accounts with 100 ETH for you to use (balances and keys are shown in Ganache window) - Install MetaMask chrome extension change network to connect to custom RPC and paste the URL copied from Ganache
- Import test account(s) from Ganache (using the private keys) to MetaMask via 'Add Account'
Run truffle migrate --reset
in the project root to deploy the smart contracts to the development blockchain
- Make sure Ganache window is running (note: new test accounts are created every time Ganache is closed and opened)
- In the project, go to
client/
directory and runnpm run start
to start the React app. This will open the client app in the a browser served atlocalhost:3000
. Make sure you are using Chrome with MetaMask installed and setup. - Since the dapp is running on a local test blockchain via Ganache, the marketplace will initially be empty.