Giter Club home page Giter Club logo

agrochain's Introduction

AgroChain

This repository contains the code for an Agricultural Supply Chain Dapp With Micro-Finance functionality, coded using Truffle and Solidity. The backend blockchain is a private Ethereum network setup using Geth(go-ethereum) and the interactions are made possible by Web3 javascript library.

What problems are we solving?

An Agricultural Supply Chain tracks a farm product from the farmer to the consumer. Farmers in developing countries are heavily dependent on bank loans. Due to this heavy debt , farmers can't maintain a steady production of agriculture. Micro-finance can help these farmers out of debt.

Agro-market

In the recent past, we have read many incidents regarding the farmer suicides due to debts and poor yield from farming. For a country like India, with the rise in population, dependency over the land for building houses and industrial areas is increasing rapidly. The fertile land for farming is dwindling and more yields have to be produced to satisfy the need of the country. Even though the demand increase, the farmers are suffering from some major issues like :

i. Raising the initial investment for setting up the field due to high bank interest rates.

ii. Fetch reasonable prices for their produce due to the intervention of middlemen in market.

iii. Analyzing market trends and customer needs. Currently the farmer and customer are completely separated in the market by the middlemen.

iv. Inefficient supply chain and issues in storage and transportation, leading to deterioration of crops.

Similarly, the customers are also worried about the high price of commodities as well as the quality of produce. They are forced to purchase whatever is available in the market at the price set by the seller. The ill practices of Black marketing, hoarding, adulteration, etc., carried out by the middle man further increases the prices for the farm products. Even though the demand for organic products is increasing, there is lack of mechanism for tracing the stages of organic cultivation and ensure authenticity. The biggest challenge in the agro-markets is the ‘disconnect’ between the farmers and the consumers.

Our solution to the problem:

Agrochain, is a blockchain based transparent market place where the farmers and consumers could implement a co-operative farming method. Here, the farmers can list the potential crops and the expected yield on his farm on the distributed public ledger. The consumers can view the details and check for the farmer credibility based on the previous cultivation and supply. This creates a transparent and tamper-proof digital market platform for farm products. Thus an agreement (consensus) can be formed between farmer and consumer, such that the consumer can fund individual crops or a field and can acquire or the yield from the farm or the profit percentage of its market value. There will be a rating mechanism to build the credibility of farmer and consumer based on the previous experiences in the agromarket.

The important advantages are:

  1. The farmer does not have to wait for bank loan or other lending mechanisms to raise the initial investment. The consumers could provide the fund with zero interest.

  2. The consumers could get quality products at cheaper rates as they are funding the crops/fields right from the time of cultivation.

  3. No need to have huge farmlands. Even the small scale farmers and household farmers can also sell their products and yield better profit.

  4. An efficient supply chain can be ensured with point to point update over the immutable chains. Customers could choose specific farmers for specific products.

  5. The farmers can build consumer loyalty based on the quality of product and type of farming, which could eventually yield him better profits.

  6. Even the low income group consumers can fund the crops based on their needs and can escape from the market fluctuations of the product prices.

  7. Organic farming and quality measurement can be assured with frequent quality checking by the concerned authorities. The immutable ledger ensures transparency and reduces the chances of fraud.

  8. Smart contracts can provide a better agreement between the farmers and consumers in case of discrepancies arising with regard to natural calamities, climate changes or other crop loss situations

Eventually, the Agrochain will build a decentralized agro-market where the farmers can easily raise fund for cultivation along with the customers in his hand for buying his produce. On the other hand the customers can ensure quality products at lesser price with an early investment on the crops. Both the customers and farmers could yield profit and build a loyal environment for future cooperation. The best farmer will get the maximum profit on the produce and the best investor (consumer) can ensure good quality food for his home.

Alt text

The above figure shows the registration form for the farmer in the supply chain application. The entered details are stored directly onto the blockchain. The underlying technology uses Truffle for the deployment and go-ethereum(geth) as the backend blockchain. We use the Web3 Javascript provider API to interact with the blockchain.

Alt text

The next page is for quality testing, here we can get the farmer details by Farmer Id. These details are stored as a structure using solidity code onto the blockchain. The Farmer details are retrieved using a special data structure called mapping by Farmer Id.

Alt text This is the Quality Testing page. Here we can see the block details where the farmer’s details are stored onto blockchain. The ‘Approve Details’ will approve the details of the farmer.

Alt text

Approve Details button click will redirect to this Product details page. This is also part of the quality testing where we enter the lot number, grade, price, test date and expiry date. These details are also stored in the blockchain as a structure.

Alt text

This is the customer page where the customer can check the customer details and status of the quality testing of his agriculture produce. The customer has to enter the farmer id and Lot number to see the details. These customer details are retrieved from the blockchain.

Alt text

The micro-finance form enables any user to fund a farmer. The funding is done by providing the farmers public id, the lot number of the product and the amount.

System Architecture

Alt text

About Us

We are a group of researchers based at Indian Institute Of Information Technology and Management - Kerala

Website/Contact : http://agrochain.in/

agrochain's People

Contributors

nikhilvc1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agrochain's Issues

Live Demo

Is there a live demo hosted on some site?

jscript get() call does not retrieve data

Team,
I am new to the blockchain world, so this could well be a newbie issue, with that said, I really would like to see this work. I am using the Ganache/Truffle framework. The default for Ganache is port 7545 rather than 8545. I've changed the port value in all of the other *.js objects to reference port #7545. I also followed the "Important_Instructions" text file, thus changing the connection address to the default one published after the migrations. I do see the Network ID appear when the localhost:3000 web page appears. Please advise on what else I should be looking for.

Micro-finance balance updates when transaction has not been executed

Bug Report

Description

When suing fund farmer funationality, the balance is immediately updated when the transaction is sent, but not yet executed

Reproduce Steps

  1. send transaction to fund farmer
  2. don't mine blocks and let the transaction stays in pool
  3. the balance is already updated when transaction is not yet executed

Expected Behaviour

The balance should only update when transaction is executed

bignumber error

Uncaught BigNumber Error: new BigNumber() not a base 16 number:
at raise (http://localhost:3000/app.js:40822:25)
at http://localhost:3000/app.js:40810:33
at new BigNumber (http://localhost:3000/app.js:39857:28)
at SolidityTypeDynamicBytes.formatOutputDynamicBytes [as _outputFormatter] (http://localhost:3000/app.js:34336:19)
at http://localhost:3000/app.js:34877:25
at SolidityTypeDynamicBytes.SolidityType.decode (http://localhost:3000/app.js:34878:11)
at http://localhost:3000/app.js:34061:29
at Array.map ()
at SolidityCoder.decodeParams (http://localhost:3000/app.js:34060:26)
at SolidityFunction.unpackOutput (http://localhost:3000/app.js:37228:24)
at Object.callback (http://localhost:3000/app.js:37256:30)
at http://localhost:3000/app.js:38208:25
at http://localhost:3000/app.js:39267:9
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:110497
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:9124
at o (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:27347)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:11957
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:9124
at u (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:12233)
at a (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:12155)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:11957
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:109544

How to run that dapp?

Thanks for your kind sharing of this repo, I am just fresh to dapps development. I have configurated Truffle and Ethereum on my PC, now I want to learn how to develop a dapp, could you please tell me how to run your AgroChain dapp on my local computer?
and I have a environment like this:
OS: Ubuntu 16.04
node --version: v8.9.3
npm --version: 5.6.0
truffle version: Truffle v4.0.4 (core: 4.0.4)
Solidity v0.4.18 (solc-js)

Transaction status shows success when it is revoked by chain reorganization

Bug Report

Description

When submitting farmer details, the scenario that the transaction is revoked due to chain reorganization is not considered.
When the transaction is executed but then revoked, status of the transaction still shows success while the transaction is still is transaction pool.

Reproduce Steps

  1. send transaction to submit farmer details
  2. When the transaction is executed, UI shows transaction succeeds
  3. Let blockchain reorganize by importing a side chain
  4. The transaction is revoked and returns to transaction pool.
  5. The transaction still shows success in UI.

Expected Behaviour

If the transactions revoked by chain reorganization, it should reveal on UI.

Food Certification Process

HI...Im doing Project about Food Certification Process Using BlockChain...Im a fresher...can u share me Where i can start to find the traceability of from consumer to farmer??
then what way i want to make the Attributes of Stakeholders????pls suggest me...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.