Hyperledger Fabric on SAP Cloud Platform
- Types of Blockchain
- What is Hyperledger
- Consensus in Hyperledger
- Consensus in Hyperledger Fabric
- Implementation of Hyperledger Fabric using SAP Cloud Platform
- Generic Architecture
- Setup of Hyperledger Fabric on Cloud Platform
After the release of bitcoin and its underline principle i.e. Blockchain, several techno players launched their own platforms for the same. In 2015, many different companies interested in blockchain technology realized that they could achieve more by working together than by working separately. This marked the birth of Hyperledger.
In this blog, we will explore Hyperledger Fabric and how SAP has integrated it in to its cloud platform. Before we start with Hyperledger, please read What is Blockchain?
Types of Blockchain
Blockchains classifications are primarily based upon restrictions on block (or simply data) accessibility. Following are the three types of Blockchain networks:
- Public Blockchains
A public blockchain is the one which has absolutely no access restrictions and anyone on internet can become a user or validator. These blockchains are mainly used by crypto currencies. These blockchains use a consensus mechanism to keep their transactions valid. Most famous examples include Bitcoin and Ethereum.
- Private Blockchains
A Private Blockchain is just like a relational database i.e. fully centralized and owned by a single organization. All the participants are vetted before entering into this blockchain network. These types of blockchains are mainly used by banking organization, where data cannot be shared with and validated by anyone. Multichain is a tool to create private blockchains.
- Consortium Blockchains
The literal meaning of consortium is “an association of several companies”. As the name suggests, it is a blockchain that is jointly controlled by a group of organizations. It is best suited for business and ERP solutions. Hyperledger and R3Cev are leading blockchain networks in this area.
What is Hyperledger
In 2015, several companies came together and created an open source Consortium blockchain platform under the guardianship of Linux Foundation and named it Hyperledger. Hyperledger, since then, has evolved a lot. It has launched multiple frameworks and tools for the same. Among them Hyperledger Fabric is the most suited framework for Enterprise.
According to the Hyperledger whitepaper, “Hyperledger fabric is a platform for building distributed ledger solutions with a modular architecture that delivers a high degree of confidentiality, flexibility, resiliency, and scalability. This enables solutions developed with Fabric to be adapted for any industry”.
To learn how Hyperledger Fabric works, watch this video.
Consensus in Hyperledger
The literal meaning of consensus is “A general agreement”. As the meaning suggests, a consensus in a Blockchain is a mechanism of validating a transaction based on general agreement (agreement of more than 51% miners in Bitcoin).
For example, Gargi sends $100 worth of Bitcoin to Rudra, Gargi will lose 100$ worth of Bitcoin from her wallet, and Rudra will gain 100$ worth of Bitcoin in his wallet. But it needs to be validated and verified that if Gargi had 100$ worth Bitcoin in her wallet or not. This is validated by the miners in the Blockchain and if more that 51% miners agreed upon this transaction, then only the transaction will be validated.
In Hyperledger fabric, consensus is the process by which block of transactions and their ordering are validated.
According to Hyperledger Whitepaper, consensus must provide the following core functionality:
- Confirms the correctness of all transactions in a proposed block, according to endorsement and consensus policies
- Agrees on order and correctness and hence on results of execution (implies agreement on global state)
- Interfaces and depends on smart-contract layer to verify correctness of an ordered set of transactions in a block
There are different types of consensus algorithms used by different Hyperledger frameworks like Kafka, RBFT, Sumeragi and PoET. Hyperledger Fabric uses Kafka algorithm.
Consensus in Hyperledger Fabric
Consensus in Hyperledger Fabric consists of following three phases:
- Endorsement: To Endorse means “to approve”. In Hyperledger Fabric, predefined policies are made under which it is stated that who will endorse whom. These policies of Endorsement are strictly followed during transaction validation.
- Ordering: This phase validates the order in which transaction are committed to the blockchain.
- Validation: At this phase, both endorsement and ordering are validated with double-spending.
Implementation of Hyperledger Fabric using SAP Cloud Platform
This is a generic architecture where it is shown how SAP Cloud Platform communicates with a Fabric Node. To learn more about Hyperledger Fabric Architecture please refer the references.
Setup of Hyperledger Fabric on Cloud Platform
To work with Hyperledger Fabric on SAP Cloud Platform, initially we need to setup our Global Account on SAP Cloud Platform and create a Hyperledger Fabric enabled sub-account. Then only we can proceed with development.
Follow the following steps to enable Hyperledger Fabric on your Cloud Platform:
Step 01: Go to your SAP cloud platform Cockpit [If you don’t have, go here and click Free Trial] and select region as Europe (Rot) – US East(VA).
Step 02: Create a sub account there [Give your desired Display name and Subdomain name].
Step 03: Click Entitlements button from the left menu bar.
Step 04: Inside Entitlements menu, you will see Edit button, click it to change the mode to editable and scroll down to Hyperledger Fabric as shown below:
Add dev and channel nodes by clicking ‘+’ button.
Step 05: Click your sub account to open it. Click Spaces and create a new space giving all authorization to that space as shown below:
Step 06: Click on the newly space created and select Service Marketplace and scroll down to Hyperledger Fabric and click to open it as shown below:
Once the initial setup of Hyperledger Fabric is done, you can create your own nodes and instances. Follow Hands on Exercise to create your own SAP Hyperledger Fabric service.
Thanks for such a beautiful blog. This gives a great insight towards hyper-ledger fabric.
Good work keep it going!!!
great blog, but just to confirm, 'dev' entitlement is a paid service in the trial account (at least in mine), so it would be great if this was disclosed along with the other links.
It is free for my trial account. I think, you might have to contact your admin/ raise a ticket for the same.
this message is there because it is a paid service when you use it in the commercial (non-trial) Cloud Platform. SAP won't charge you for using it in the trial.
Hi Marius and Rudramani,
i apologize for not being able to paste a screenshot here and i'm not sure what it is, but something is different in my trial account as the 'Next' button is greyed out when i'm trying to click through to the next screen from here:
do you still encounter this problem?
i haven’t noticed any change and have extended the trial. the image upload is not working for me here either, so i can’t really ‘prove it’, but my entitlements are showing this:
1 of 1 assigned
2 of 2 assigned
mysubcount 1 1
i tried different combinations for toggling between dev and channel, but that didn’t help.
thanks for checking with me.
is the ‘Next’ button also greyed out for other services from the marketplace?
From the information you provided it looks like you’ve created an own subaccount (mysubcount) and transferred entitlements from the default trial subaccount to mysubcount. Please make sure that you have enough quota for services left in your space. You can check this by going into the subaccount and navigating to the ‘Spaces’ tab on the left.
Maybe try to assign application_runtime entitlements to your subaccount or try to work with the trial subaccount.