How do I develop a supply chain DApp on Blockchain?

0 votes

I wish to develop an application which allows a food supply chain to be stored using the Ethereum Blockchain. Here, I want to store assets from a farm that would be viewable by the consumer. They would be able to retrieve the info about a specific product from the blockchain. What I am confused about is- whether a separate smart contract is required for each asset, or if one smart contract can be used to store information about several different assets. Please help me with this concept. 

May 30, 2018 in Blockchain by Christine
• 15,790 points
203 views

1 answer to this question.

0 votes

Either of the ways is acceptable but multiple smart contracts are always preferable. If you are using a single smart contract, you can have a data structure to map the ID of the item to its current position in the supply chain . You can have a simple mapping from an integer for this. This approach gets complicated if you want to track all previous locations of a particular item. Also, any error in the contract would render the entire program unusable and since everything on a blockchain is immutable, it would ALWAYS be there. 

The best approach would be maintain separate smart contract for each item.In each contract you can have a mapping from timestamp/string to a struct to store details of the item. Moreover, you'd need to alter only a particular contract in case of any discrepancies.

answered May 30, 2018 by Perry
• 17,020 points

Related Questions In Blockchain

+3 votes
4 answers

How do I add a new node on a Hyperledger network?

You can do this by generating the crypto ...READ MORE

answered Apr 6, 2018 in Blockchain by Christine
• 15,790 points
1,559 views
0 votes
1 answer

How can i create a simple P2P network on a blockchain?

To develop your own cryptocurrency, you need ...READ MORE

answered Apr 20, 2018 in Blockchain by Christine
• 15,790 points
118 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
140 views
0 votes
1 answer
+3 votes
2 answers

How to run ethereumjs using Node.JS

You need to install testrpc globally on ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,620 points
136 views
0 votes
1 answer

How do I withdraw the balance from a contract on Ethereum test blockchain?

Your need to improvise your code a ...READ MORE

answered Aug 3, 2018 in Blockchain by Perry
• 17,020 points
69 views
0 votes
1 answer

How can I deploy a HelloWorld contract on my testrpc network?

The problem lies in the command: truffle migrate Your truffle migrate command ...READ MORE

answered Apr 27, 2018 in Blockchain by Perry
• 17,020 points

edited Aug 10, 2018 by Omkar 465 views