Carpooling Chain – Cab Booking made better

Reading Time: 3 minutes

About

Carpooling Chain is a decentralized blockchain solution built with the objective of eliminating the need for a central authority to book cabs. The blockchain backend for Carpooling chain is build using Substrate. Substrate is a next-generation framework for blockchain innovation. It comes with everything you need to build your blockchain. 

Substrate is a completely free and open-source project. It is built using Rust and WebAssembly. Rust is designed for creating fast and inherently safe software. Substrate is like a template from which you can make your own application-specific blockchain to add custom functionalities specific to one use case or group of use cases. 

Carpooling Chain provides various extrinsic calls for the services it provides like add cab, add customer, book ride etc. It also exposes some RPC calls to query the runtime for storage values. To query the runtime it provides various Runtime APIs.

Challenges

The challenges that we faced while building the blockchain backend-

  • To make node js apis that would call the extrinsics.
  • Make RPC calls for various operations.
  • To handle the data in the blockchain.

Our solution

To make this project a success, we tried to build a very user-friendly blockchain that exposes dispatch calls for all the different kinds of operations. To make things clear, there are dispatch calls to add customer details, add cab details, update customer and cab locations, book cabs or make them idle. So we tried to build a node js app that uses the polkadot.js APIs to call these dispatch calls with ease and submit the transactions using different accounts. We also used express js to handle the requests and responses.

Architecture

The architecture diagram for the Carpooling Chain is given below. It shows how various components interact with each other to perform a service. The LC in the diagram is a Light Client that will expose all the dispatch calls and RPCs to perform actions on blockchain.

Our next steps

We have successfully built the blockchain backend using the Substrate framework. We have exposed different dispatch calls for the services as discussed above. The list of accomplishments continues to APIs in node js that successfully submit extrinsic and perform transactions for the services. Now our next objective is to make a frontend that would allow the users to seamlessly interact with the blockchain. We also intend to build a node js backend for the WebApp that will do some of the basic carpooling services like shortlisting the cabs to book based on their locations.

Benefits

The benefits of working with Carpooling Chain manifolds the followings:

  • Provides a tamper-proof booking system.
  • It is completely decentralized.
  • Eradicates the monopoly of Cab services.
  • Anyone can become part of this chain.

This was all about the introduction of Carpooling Chain. Carpooling-chain is an open-source project. You can find the source code here: https://github.com/knoldus/Carpooling-Chain. All contributions are welcome. If you want to contribute, please create a GitHub issue and raise a pull request.


If you want to read more content like this?  Subscribe to Rust Times Newsletter and receive insights and latest updates, bi-weekly, straight into your inbox. Subscribe to Rust Times Newsletter: https://bit.ly/2Vdlld7.


Knoldus-blog-footer-image

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading