Create your own custom chaincode in Hyperldeger Fabric 2.X

Fig.1 : The network architecture that we will create

Introduction

In this tutorial we are going to create a Hyperledger Fabric network containing 2 peer organizations and 1 orderer organization, which communicate with each other through a channel. After setting up the network, we will move on to developing and distributing the chaincode. The code will be written in Java and, then, we are going to deploy it in the network adapting the deploy script to do it.

This chaincode it’s just a simple parcel shipping manager, that allows us to check the status of the transport of goods inside parcels. The assets (parcels) are created with the following attributes: ID, SENDER, RECEIVER, CITY and TIMESTAMP. Therefore, through the chaincode, each city that will cross the package will be registered together with its timestamp, in order to keep track of all its movements in the Blockchain. Furthermore, the possibility of querying assets through their ID or some attribute will be added.

Deploy the network

In order to deploy the network just follow my first tutorial.

Create chaincode Maven project

more content available soon

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

7 Reasons I Saw Good Programmers Quit

SQL Server Query Store: The story of a performance regressed query!

I Almost Uninstalled The Coding Plugin That Saves Me Hours Of Time

CSS Flexbox and Grid

Weekly update #1

“You should learn a programming language every year”

Jelly starts building on AVA

READ/DOWNLOAD*< Explore It!:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Davide Senatori

Davide Senatori

More from Medium

Basics of Jupyter Kernel Gateway

Differences between static and dynamic libraries

API key

Low-Pass Filter design for RFID-IOT