Complete Supply Chain App Development Ethereum Blockchain Test Network Ropsten

Complete Supply Chain App Development on Ethereum Blockchain Test Network (Ropsten)

Blockchain

Complete Supply Chain App Development Ethereum Blockchain Test Network Ropsten

Complete Supply Chain – Trade Finance Blockchain development on ethereum test network (ropsten)

How do you know that the coffee that you brought is actually fair trade? How do you know which one is real? How do you know that a t-shirt has not been made in a sweatshop and a simple tag added at the end? You simply don’t.

In order for you to be certain – you would need a record of all transactions and event of the life of an item, that would be possible with Blockchain and what’s the Blockchain? That’s a fancy word; Blockchain is related to Bitcoin – the cryptocurrency. Initially it was made for financial transactions but it is now revolutionizing the business world especially supply chain, it’s just like Google sheet with regular transaction there is a middleman like the bank that registers this transaction – a centralized system like Microsoft Word but the Bitcoin transactions are between user to user so when there’s a transaction the information is recorded in a shared ledger or block and these blocks are linked together to form a block like a shared Google Doc.

Transaction accuracy is driven by the fact that consensus creates truth and a blockchain database every participant or node maintains a copy of the shared ledger. Each transaction on the blockchain is recorded in computer code showing that who the parties are, transaction details and timestamp with each containing their unique math based encrypted signature. This digital signature is key as it allows each block of information to be securely connected to all the rest. It’s this system of fully transparency and connectedness that lends the blockchain its trust and credibility. This connection provides an audit trail of every transaction that’s ever occurred in a system, so if there were an unauthorized change each node is notified and we can see where it took place they then will agree to recognize the change as valid or rejected. Again transparency and consensus combine to make the blockchain system virtually tamper proof.

Today you’re data will be stored publicly or pseudo anonymously in a shared database. Now with Blockchain you can track the chronological history of the organic cotton shirt that you bought, you cannot tamper or cheat because everyone using the system is watching you.

So here is how you can create your own supply chain network to track your products on each node.

Use Case

  • This system will track the movement of smart phones from PORT-A to PORT-C, below are the conditions
    • At PORT-A basic information about smart phone is added
    • You are not allowed to send locked mobile phones from PORT-A to PORT-B
    • QMobiles are not allowed to move from PORT-B to PORT-C

Pre requisites:

Meta Mask Settings:

Click on the Meta mask icon from the extension area of chrome browser and following the steps below.

  • Create an account on Meta mask and choose a password:
  • Create your account
  • Now set your network to ROPSTEN Test Network

Smart Contract

Blockchain software code representing an arrangement or a contract that the computer can make and execute automatically under conditions set in advance and not just a single agreement but bundles of contracts linked to each other all operating autonomously and automatically. Smart contracts will build under solidity language (.sol) and we use Remix IDE to create for supply chain.

Open Remix IDE on chrome browser with meta mask installed and add following solidity code into it.

Now click on create and make sure that Environment is set to “Injected Web3” like showing in the image below.

When create is clicked Meta mask will automatically opens and let you confirm the transaction click on submit to confirm.

Now go to https://ropsten.etherscan.io and add your account number inside the top right search textbox, you will see all transaction details and at the top your current contract information.

Now click on txHash you will see transaction details:

Copy hash from “To” because we will use this in our project for interacting with our contract, in our case the Contract address is “0xaf3155786afa67f796c9a93738f6af92d37f6c46”

That’s it we have successfully created and deployed our contract to “Ropsten Test Ethereum Network”.

Frontend: PORT_A

Create a project (PORT_A) in your local server (I am using XAMPP) and import web3.min.js file in your project folder and then create a new PHP file name it index.php and put the following code in it.

Index.php

You will copy ABI ARRAY by navigating details of your contract from remix IDE.

PORT_B

Index.php

PORT_C

Now run these in three different tabs or you can run them on three different systems.

PORT-A enter your smart phone details and hit submit you will see meta mask will popup to confirm the transaction hit submit and your information will be stored on ethereum test blockchain.

PORT-B click “get Inspection Result” you will see that your data will popup which you had sent from PORT-A, Now click on “inspect” (check for QMobile) and then click again on get Inspection Result – Because the smart phone is not a QMobile it will authorized for sending to PORT-C.

PORT-C when mobile received at PORT-C it will be confirmed by clicking on “confirm” button and then status will be updated.

Continue Reading
You may also like...

I am a Sr Android App, Web Developer & Blockchain Project Manager having 5 plus years of extensive hands-on experience in Object Oriented Programming, Database Design and Implementation using Agile & UML. Pro in Yii2 PHP Framework, Android App Development, MYSQL, EOS & Etherium Blockchain & Smart Contract development.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in Blockchain

Recent Posts

Categories

To Top