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
1,498 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,100 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 7, 2018 in Blockchain by Christine
• 15,790 points
5,727 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
2,020 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
1,923 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
+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,610 points
1,414 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,100 points
2,663 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,100 points

edited Aug 10, 2018 by Omkar 2,846 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP