Website: https://github.com/jpdstan/greenbackd
This is a simple web application that demonstrates consumer facing interface that interacts with [our smart contract]((https://kovan.etherscan.io/address/0x4c437ff76d4c19c0000ae49c80e2ed79f765096f) deployed in the Kovan test network. The smart contract is programmed using the Solidity language. The interface is programmed using React JavaScript library. To interact with the smart contract we use the Truffle framework. The modules used in the project are bundled using webpack.
In a typical scenario, a customer scans their purchase (through a QR code) using the camera of their device after making some purchase from a partner company. Three things happen at this point:
- The customer gets credited with a compensation at the company's discretion (for example, a 10% coupon code). This credit is stored in the application.
- The company gets credited with the amount of CO2 savings associated with the purchase. This credit is stored on the blockchain (more specifically, in a hash table of companies and their balance CO2 credits in the smart contract deployed through
greenbackd.sol). - The transaction gets added to the blockchain (in our application, we have chosen to use the Kovan test network).
- Install Metamask and start running on Kovan test network (that's where our test contract is deployed)
cdtogreenbackd/and runnpm installto install npm dependenciesnpm run buildto compile contracts and package static files- This should create
/build/contracts/*.soland/dist/build.js
- This should create
serveto host files locally (install if you don't have it)- Navigate to
localhost:5000/dist/index.htmlto visualize the interface (the port number might be different; however,serveshould print out the correct one for your machine).
- https://medium.com/@merunasgrincalaitis/the-ultimate-end-to-end-tutorial-to-create-and-deploy-a-fully-descentralized-dapp-in-ethereum-18f0cf6d7e0e
- https://github.com/merlox/casino-ethereum/blob/master/src/js/index.js
- https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2
