BlockChain App Deployment Using Microservices With Docker
BlockChain on Docker
What is a BlockChain?
The Blockchain is a distributed database that maintains a continuously-growing list of ordered records called blocks. This technology underlying Bitcoin and other cryptocurrencies. It is a public ledger of all Bitcoin transaction. These blocks are added in a chronological order. In order to deploy a Blockchain application, you need a distributed Hyperledger Blockchain on your choice of infrastructure (on-premise or cloud).
In this article, we will deploy a Hyperledger Fabric cluster using Docker.
To follow this guide you need a system with working Docker engine and docker-compose on it. We will use Fabric which is an implementation of Blockchain technology written in Golang, so go version go1.6.2 or above is required. Before proceeding further let’s have a look on Hyperledger Fabric.
The HyperLedger Project
Hyperledger is an open source project with collaborative effort created to advance Blockchain technology. It helps in cross-industry distributed ledgers which support transaction system, property transaction, and other services.
The Fabric is an implementation of blockchain technology. It provides a modular architecture allowing pluggable implementations of the various function.
Setting HyperLedger Cluster
First, pull the latest images published by the Hyperledger fabric project from DockerHub.
docker pull hyperledger/fabric-peer:latest
docker pull hyperledger/fabric-membersrvc:latest
Now in order to run these images. Create a docker-compose file which will launch both of these services.
That’s it now we are ready to launch these service by simply running docker-compose up
Running the ChainCode
Before running chaincode you need to set your $GOPATH and then make a directory to download the sample chaincode in the src directory.
Next, you’ll need to download the Hyperledger fabric to your local $GOPATH, after that you have to build the chaincode.
Go to chaincode_example02 directory and build the code
Starting And Registering The ChainCode
Run the following command to start the chaincode.
After that chaincode console will display the message “Received REGISTERED, ready for invocations” which shows that chaincode is ready for use.
Running Rest API
To log in with the help of REST API, send a POST request to the /registrar endpoint, with the enrollment ID and enrollment PW. These parameters are listed in the eca.users section of the membersrvc.yaml file.
If try to log in again it should say user already logged in.
You can also track the events on the console also.
BlockChains can support the creation of new, more efficient business processes. Now as you understand the basic fundamentals of BlockChain Technology, you need to decide whether BlockChain fits your needs or not. There will be a rush to develop new decentralized apps so as to enable the decentralized world that we are moving towards. Considering this fact, Business Leaders need to learn a new vocabulary around crypto-related frameworks. Developers need to learn how to write decentralized apps that are enabled by BlockChain Technology. And End Users need to learn how to create or use smart contracts, e.g. as depicted via the Mist browser vision (Ethereum), which is a mix of marketplace discovery, management dashboard, and creation platform, all-in-one.
Decentralized Apps will come in different sizes, flavors and complexity levels. At XenonStack we are prepared for that and have specialized professionals to develop the solutions. Reach Us for Deployment and Consulting on BlockChain Technology Solutions.
XenonStack is a leading Software Company in Product Development and Solution Provider for DevOps, Big Data Integration, Real Time Analytics & Data Science.
Product NexaStack - Unified DevOps Platform Provides monitoring of Kubernetes, Docker, OpenStack infrastructure, Big Data Infrastructure and uses advanced machine learning techniques for Log Mining and Log Analytics.
Product ElixirData - Modern Data Integration Platform Enables enterprises and Different agencies for Log Analytics and Log Mining.
Product Akira.AI is an Automated & Knowledge Drive Artificial Intelligence Platform that enables you to automate the Infrastructure to train and deploy Deep Learning Models on Public Cloud as well as On-Premises.
Get 1 Hour Free Assessment For DevOps, Big Data Strategy, and Data Science. CONTACT US NOW!