This project aimed for Transportation of Sensitive Goods (eg. wine) and payment by the distributor to producer if product is recieved.
• Implemented a Blockchain Proof of Work for the transportation of Wine through a decentralized Ethereum network and used IoT sensors to track the temperature and luminosity data for maintenance of the quality of Wine. • Payment was done through a blockchain based extension called Metamask. • The projects main focus was to develop a more secure and transparent supply chain management system. • A smart contract was created which would check every time if quality of the product which is been transported is maintained. • If it is not maintained then there will be deduction in the cost of product according to the conditions set in the smart contract. • The second phase of this project aimed for Transportation of Sensitive Goods (eg. wine) and payment by the distributor to producer if product is recieved. We also quality checked the products using IoT sensors like Temperature and Luminosity.
Steps for running the project: Requirements: compiler version: 0.5.8, Javascript vm provider
-
Deploy the Driver contract then you can see the transaction has been created and the functions will be seen on the left side of the screen.
-
Then at starting we have to add the producer by clicking the dropdown of the addproducer() and then the same goes on for adddistributor() function and addproduct function.
-
But for the add product function we have declared the products with two product ids. i.e. prodID=1 for Redwine and prodID= 2 for white wine , which will be seen under the transaction block created in the console after clicking transact.
-
Now as we are simulating the IoT sensor data by creating the random data. So,at first we are going to generate the random data of temperature, luminosity and acceleration by transacting the respective functions naming randomtemperature(), randomaccelerometer, randomluminosity().
-
Then to check how much price the distributor has to pay the producer, it will be generated by the function named checkprice.
-
Checkprice functions transaction block will show us the output.
-
Now, here comes the main logic part. So, as you can see it is a very tedious job to fill all the functions everytime in Remix , we have came up with a solution that we have created one Driver function which calls all the functions of the transport.sol and Payment.sol. So, in order to run this we have to deploy the driver contract and main thing the deployment of the driver contract hould be made “AT ADDRESS” and the address should be any one of the address from the address being provided in remix. Because, we have used the logic that transaction between different producers and distributors will be done only when the producer address is same as the contract address. So, deploy the Driver contract AT any of the ADDRESS.
-
Then after deployment we can see that Drive function is visible on the left window of the remix. We can enter the respective entries and we can see that the program runs perfectly and the payment is also made and one thing to be noticed before transacting the drive function we have to enter the amount which has been generated from checkprice function on the value column provided on the left top side of remix because in remix without entering the value no value will be sent.