IBM MQ Bridge to blockchain Part 1: Setting up a local Hyperledger Fabric network

 View Only

IBM MQ Bridge to blockchain Part 1: Setting up a local Hyperledger Fabric network 

Wed March 04, 2020 12:55 PM

Laurence Bonney
Published on 07/11/2017 / Updated on 22/02/2018

IBM MQ Bridge to blockchain

At IBM MQ version 904, the IBM MQ Bridge to blockchain is available on Linux for connecting to advanced queue managers. Version 903 IBM MQ Bridge to blockchain for connecting to z/OS queue managers worked with the initial beta service in IBM Cloud. As we were preparing for 904, the IBM Blockchain offering expanded to include the Blockchain platform, Hyperledger Fabric, Hyperledger Composer, and several ways to explore setting up your own blockchain network that includes some sample blockchain networks that helped us get started. We tested the 904 bridge with two example networks and wanted to share how we set them up. We worked with:

  • A Local Hyperledger Fabric network built with Docker and the Fabcar sample
  • A Kubernetes container cluster network with the Example02 sample

In this post we share the steps for configuring an Ubuntu system for the local Hyperledger Fabric network. We used Docker and the Fabcar sample chaincode. Look out for the Part 2 post where we share our steps for the Kubernetes cluster network example.

Configuring a local Hyperledger Fabric network built with Docker and the Fabcar sample

  1. Install the current hyperledger fabric prereqs. New version of docker, docker-compose and cURL - (i.e. apt-get install docker-compose; apt-get install curl).
  2. (Optional) Add docker service to start on machine startup.
  3. Add the docker group if it doesn't already exist:
sudo groupadd docker
  1. Add the user "$USER" to the docker group. Change the user name to match your preferred user. If you do not want to use your current user:
sudo gpasswd -a $USER docker
  1. Run "newgrp docker" or log out/in to activate the changes to groups
  2. Use "docker run hello-world" to check if you can run docker without sudo
  3. Download Hyperledger Fabric samples:
git clone https://github.com/hyperledger/fabric-samples.git
  1. Download platform specific binaries:
cd fabric-samples; curl -sSL https://goo.gl/6wtTN5 | bash -s 1.0.0
  1. Add platform specific binaries bin directory to your PATH and in your .profile to preserve on reboot
  2. Run the generate.sh script to create fresh SSL certificates:
cd basic-network;./generate.sh
  1. Edit basic-network/docker-compose.yml:
    • Under the CA docker image configuration, replace:
o   command: sh -c 'fabric-ca-server starto   --ca.certfile /etc/hyperledger/fabric-ca-server-config/org1.example.com-cert.pemo   --ca.keyfile /etc/hyperledger/fabric-ca-server-config/a22daf356b2aab5792ea53e35f66fccef1d7f1aa2b3a2b92dbfbf96a448ea26a_sk-b admin:adminpw -d'
    • With:
o   command: sh -c 'fabric-ca-server starto   --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pemo   --ca.keyfile /etc/hyperledger/fabric-ca-server-config/replace_value_with_new_key_file-b admin:adminpw -d'
    • Where replace_value_with_new_key_file is the newly generated *_sk file found under "fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/ca/".
  1. Start the fabcar demo:
fabric-samples/fabcar/startFabric.sh

If you reboot your machine, you'll have to rerun this command or add it to a startup job.

Configuring the IBM MQ Bridge to blockchain to connect to your Fabcar blockchain network

Once the Hyperledger Fabric containers are running, you can start configuring your IBM MQ Bridge to blockchain. You will need several parameters from your docker-compose.yml configuration file to allow the bridge to successfully connect to your Fabcar blockchain network. See Configuring IBM MQ for use with blockchain for more information.  

Entry Details

Statistics
0 Favorited
3 Views
1 Files
0 Shares
5 Downloads
Attachment(s)
pdf file
IBM MQ Bridge to blockchain Part 1- Setting up a local Hy....pdf   138 KB   1 version
Uploaded - Wed March 04, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.