An awesome project to upload images on a website and authenticating them through ethereum smart contracts!
View Demo
·
Report Bug
This project uses React.JS for front end and Ethereum smart contracts for storing the IPFS hash on a blockchain. Below is the entire process from selecting file to uploading it to ipfs and displaying it on the website
- File selection: You can click on the chose file button to select any image you want.
- Capturing file: The server then captures the file and converts it into a buffer.
- Submitting: After file capture, once you click on the submit button, the server uploads the file to IPFS and saves the hash it receives from IPFS API.
- Saving hash on Blockchain: Once the IPFS hash is received, server pushes the hash onto an Ethereum compatible Blockchain.
- Verification: Once the hash is on Blockchain, client then verifies the account connected to the Blockchain and retrieves the hash.
- Update Image: Once client verifies the account holder through Meta Mask, image updates on the client.
This project uses the following software and languages
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.
Here is the list of all the prerequisites you would need to install on your system in order to run this device
- Node.js v10.15.3
https://nodejs.org/en/download/
- npm
https://www.npmjs.com/get-npm
- Truffle
https://www.trufflesuite.com
- Additional build tools are required to be able to run media keys on windows. Run these commands from an
administrative shell to install software dependencies:
Note: You need to install windows build tools version 4.0 or higher
npm install --global --production windows-build-tools
npm install -g node-gyp
-
Add all dependencies using npm
npm install
-
Open Ganache and run a private Blockchain
-
Run Truffle to add smart contract to the Blockchain
truffle migrate --reset
-
Run server to start the React.JS client
npm start
Note: You need to keep running Ganache Blockchain for the app to work. Please go through the deployment below to start using your client.
Run
npm build
You need to connect to Rinkeby or Ropsten test network if you do not want to spend any money on Ethereum smart contracts.
Check out the demo on youtube here - View Demo
- Jay Kumar - Complete Development - jaykch.com
This project is licensed under the MIT License - see the LICENSE.md file for details
- Boilerplate - Boilerplate for React.JS + Ethereum + Truffle project.
- IPFS HTTP Client - Javascript library for communication with IPFS.