Traceability system based on Ethereum Blockchain
Live at : https://ethertrack.firebaseapp.com/
This project's goal is mainly to present a concrete example of an off-chain (Firebase) and in-chain (contracts) dynamic content management.
Identify, follow and authenticate a product throught its whole life cycle.
You can see the blockchain as a decentralized database composed of nodes that uses peer-to-peer to exchange data. Each transaction issued on the blockchain is validated by severales nodes and added to other blocks of validated transaction. Validated transactions are unalterable and publicly available. Ethereum blockchain allow the creation of "Smart Contract", autonomous programs hosted in the decentralized network. EtherTrack use various types of smart contract to :
- Register companies
- Modify traceability unit state
- Record traceability unit movements
- Ensure traceability unit / owner identity
The nature of the blockchain system address a lot of issues that you must face when you work with traceability, for example :
- Descentralized architecture to ensure data integrity
- Smart-Contract source code can be read and approved by everyone, data can not be tampered with.
- Data format is publicly available, anyone can build an interface and get data from the chain.
Current version features :
- 3 Contracts : EtherTrackNS (Naming Service) EtherTrackWarehouse (Manage traceability Unit) and EtherTrackDatastore (a data store proxy)
- A basic web site designed with Bootstrap 4 to use with Metamask. It can deploy contracts and do basic contracts calls.
- Truffle deploy scripts and refactored contracts.
Clone repository :
git clone https://github.com/SunPaz/EtherTrack
Start Node.js web server :
node Firebase/www/NodeJS/node-server.js
Compile contracts using Truffle :
truffle compile
(optional)
Launch truffle test network :
truffle develop
Migrate contracts to network (in truffle develop console) :
migrate --reset
Launch you browser on http:https://localhost:8081/ and you are done !
- Truffle : Ethereum development framework
- Remix : Solidity IDE
- JQuery : Javascript library
- Solidity : Smart contract language
- Web3.js : Ethereum JavaScript API
- MetaMask : Ethereum chrome extension
- Node.js : Asynchronous event driven JavaScript runtime
- Express : Web framework for Node.js
- Firebase : Google's mobile platform, used to cache user preferences
- JSHint : Used as a JS linter