Projects
Web App

Web App

The web application is the user interface that allows participant users to setup and configure several aspects of the Blockchain, to carry out test simulations with data and evaluate results, and to view the updated data in the Blockchain as transactions are executed.

Each app will have to be developed based on the use case it is intended for and be synchronized with the functionality offered by the Smart Contract.

The development of the web app is reasonably complex and will not be covered as a part of this project. The app will be hosted as on the cloud as a SaaS solution and you can configure it to connect to a public Testnet or your private Devnet.

User Guide

The key concepts and the functions that can be carried out using this app for our use case are explained below.

Concepts

Roles

There are four user roles:

  • Owner: The owner will be responsible for adding the other participants to the database and to the Smart Contract and have the option to run test simulations. The owner will be not be a participant.
  • Buyer: The buyer will be responsible for creating orders with the relevant information and will be able to view the dashboard.
  • Seller: The seller will be responsible for updating orders with the relevant information and will be able to view the dashboard.
  • Transporter: The transporter will be responsible for updating orders with the relevant information and will be able to view the dashboard.

MetaMask

MetaMask is a software cryptocurrency wallet used to interact with the Ethereum blockchain. It allows users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications.

An app needs an intermediate solution such as MetaMask to be able to interact with the Blockchain and Smart Contract. You will need to install the MetaMask extension in your browser and configure it as explained in the steps below.

Connect

To get started you will need to connect MetaMask to the Blockchain network you will be working with. You can either select a Testnet from the list of available options, or connect to your private Devnet.

To connect to a private Devnet (specifically to your node), click on the network selector on the top left. Select the option to add a network, which will open up a web page. On that page select the option to add a network manually and enter the values below:

Network Name: A name of your choice
New RPC URL: The IP address and port number at which your node is listening (127.0.0.1:8545)
Chain ID: The chain id in your network genesis file. MetaMask fetches this value and suggests.
Currency Symbol: ETH
Block explorer URL: This is not available for our Devnet.

Once you have connected succesfully, you need to add the account you will be transacting with. You can do this by importing the account key file created on your node and entering the password provided when creating the account.

Every account has an address (which can be publicly known) and a private key (which should be known only to you). When logging in to the app you need to enter your private key.

Connect the App

The first step to using the app is to specify the network node you would like to connect to. While data is sycned across nodes, only your node has your account, which is required to execute transactions. Each participant will connect to their own nodes, which will have a different IP and/or port number.

On the Connect page enter your node IP address and port number. This will be the same values you entered to connect your MetaMask wallet.

Login

Entering your private key (which is known only to you) is the equivalent of logging in with a password. You can get your private key from the Account Details option in MetaMask.

Add Participants

To start the process the owner must add the three participants required for this use case to the database and also to the Smart Contract. For this the owner will need to get the participant account addresses from them offline (via email for example).

Create Order

Once the participants have been added they can all log in and execute transactions. The first step of the process is to create an order which must be initiated by the Buyer. The Buyer follows the steps to connect to their node (the IP address and/or port will be different), logs in using their private key, then creates an order with all required details.

Seller Update Order

After connecting and logging in the Seller can see all the orders created by the Buyer and can update them with all required details.

Transporter Update Order

After connecting and logging in the Transporter can see all the orders created by the Buyer and can update them with all required details.

Dashboard

All participants can view their account details on the Dashboard.

Order Details

All particpants can see the order details, the updates to the order, the penalties calculated, and the payments transferred on the Order Details page for any order.

Once an order is set up the microcontrollers at the Buyer, Seller, and Transporter locations can be activated. Each microcontroller will send live data updates about the order which will be captured in the Smart Contract and synced across all nodes so all participants see the same data on their nodes, for complete transparency.

Penalties are calculated as soon as relevant data is received from the microcontrollersand payments are initiated once the last data value is received from the microcontrollers and the order is marke as completed.