Multi host Kafka-zookeeper Hyper-ledger fabric network - hyperledger-fabric

I am trying to setup a Multi Org Multi Host network based on Hyperledger fabric block chain. I developed a network structure and trying to run docker containers in swarm mode. I have three aws instance Ubuntu on aws.
Here is link of my public repository https://github.com/medipal/MultiOrgNetwork
When I am running docker images there are no services replicated.
There is error while deploying the network thats why container are not starting.
How can I build a network like this or What should I have to correct in my code?

Here you have a great example of a orderer-kafka network. This is the first-network from fabric-sample with kafka. You need to adjust this to work in swarm mode and apply you changes.

Related

Multi Org Setup using HyperLedger Composer in multiple machines

I am working on setting up a Business Network for Multiple Organizations (two physical machines).
I did the setup of a business network using Hyperledger Composer Playground and achieved querying, rest-server implementation etc.
I have configured a multi-org (multiple organizations) setup for a single business network in a single cloud server (Reference link used: https://hyperledger.github.io/composer/latest/tutorials/deploy-to-fabric-multi-org). But, as in real scenario, I want to configure a multi-org functionality with two separate cloud servers.
I met with an error like below.
Error: Unable to Communicate with Peers. Peers not found.
Version of Composer : latest
Version of Fabric : V1.0
Thanks in Advance.
If you are using Composer latest (v0.19) then you have to use Fabric v1.1.
If you are Running on 2 servers with 2 IP addresses you need to solve the communications (IP Addressing and Routing) between you client and the servers, and between the containers on each server.
For the client to server you need to manage the addresses in the connection.json files for composer.
For the connectivity between the Peers and other containers the correct solution is to use Kubernetes or Docker Swarm to manage the addressing/routing. It is possible to use the extra_hosts feature of docker-compose for a simple demo but you might be restricted to one peer per org because of port conflicts.

Deploying a Hyperledger Composer blockchain business network to Hyperledger Fabric (multiple organizations)

I implemented hyperledger composer tutorial and created a simple business network definition. Then I deployed it through composer and implemented it's rest APIs through composer-rest-server. Now I want to add one more peer to it on a different machine (PC) which can access the Blockchain I previously created. I followed this Deploying a Hyperledger Composer blockchain business network to Hyperledger Fabric (multiple organizations), but in this tutorial, the network is configured using docker containers, with both organizations' fabric networks, on the same machine.
My Question:
1. What are the differences between multiple organizations using docker containers (on the same machine) and using multiple machines (PC)?
2. How to implement this with multiple machines (PC) using Hyplerledger Composer?
Thank you in advance!
As answered on Hyperledger Rocket Chat:
The tutorial you refer to (Multi Organisation on one PC) is used to illustrate the Composer Aspects of a Multi Organisation - Multi Peer configuration. It is not necessary to use Docker Containers to build a Fabric, but it is easier and the majority choose to do it that way.
It is easy for Composer to work with a Multi Machine setup - you just create a different connection.json file to 'point' to the various addresses! The real question is how to implement a Multi-Org Hyperledger Fabric.
Docker Compose is the tool used for a Development Fabric and for the tutorials and it provides networking between the component containers, but Docker Compose is only really intended for a single machine. To work with multiple machines Kubernetes or Docker Swarm are better choices (or cloud hosting) and certainly something other than Docker Compose is required for production.
There are however a couple of tutorials that can be used for learning or PoC - I haven't tried them, but others in the community have:
https://www.skcript.com/svr/setting-up-a-blockchain-business-network-with-hyperledger-fabric-and-composer-running-in-multiple-physical-machine/
https://medium.com/#wahabjawed/hyperledger-fabric-on-multiple-hosts-a33b08ef24f

Azure Hyperledger Fabric : Interacting with the network

I have a HyperLedger Fabric setup on Azure. I have spun-up the ready made software on the Azure. It has installed 4 machines peer0, peer1, ca & orderer.
Now where do i install the Composer software on? Do i need to spin up a new machine just for the composer or it should be installed on one of those 4 machines?
You don't actually need to install Fabric Composer on any of those machines. You should be able to run Composer locally and then just specify the correct endpoints in the connection profile in order to interact with the nodes deployed on Azure.
If you are looking to deploy Composer in the Azure, then yes, I'd suggest using a separate Azure VM / container for it

Hyperledger composer on hyperledger fabric deployed on Docker swarm

I have deployed a one org hyperledger fabric network over docker swarm. Where one node has an orderer, peer , ca and couchdb and other node has one couchdb and node. I was able to invoke basic chaincode over it. Now I want to deploy composer over it. But I am not sure what shall I give in request and event url of connection.json. I already tried giving individual IPs instead of localhost,but no luck. I used this tutorial to deploy one org fabric network over docker swarm.
See https://discourse.skcript.com/t/setting-up-a-blockchain-business-network-with-hyperledger-fabric-composer-running-in-multiple-physical-machine/602
you will need the requestURL and eventURL definition, along with peer addresses from the other 'node' (I assume you mean 'machine') on your node 1.

Hyperledger fabric deployment (real network)

I have created an application using "Hyperledger Composer"
https://hyperledger.github.io/composer/tutorials/developer-guide.html
Its working fine on my local machine and I am able to access REST API's over local network.
I would like to setup real network. What I mean is multiple hosts and peers. I have been trying to figure out steps/guideline to setup a real fabric v1 network and deploy application on it, but haven't had any luck yet.
My Questions are
What are the steps of deploying real Fabric 1.0 network with multiple hosts, peers?
How to deploy application in real network (once its setup)?
Appreciate any direction here.
If you have a couple of linux VMs with ssh keys configured so you can ssh without prompting for a password you may try https://github.com/yacovm/fabricDeployment

Resources