Connect 2 separate laptops using docker swarm? - docker

I want to build a small blockchain network between 2 laptops (as an initial step). I am using Hyperledger Fabric and Hyperledger Composer on each laptop.
Can I use docker swarm to connect these 2 laptops then use Hyperledger Fabric and Hyperledger Composer to my blockchain network?
If the answer of question 1 is yes, can I do these without any cloud account (like amz, etc.) and without paying money?
If the answer of questions 1 and 2 is no, how can do my target?

Yes you can use docker swarm to connect 2 laptops and use hyperledger frameworks on them. Setup hyperledger fabric on multiple hosts using docker swarm
Since you are doing this on your laptop locally, you don't need to pay anything to anyone.

Related

Deploying Hyperledger Fabric organizations in multiple hosts

I have been struggling while trying to build a fabric 2.0 network with organizations spread in multiple hosts. The official documentation explains how to deploy two organizations (org1 and org2) using docker, and using configtxlator tool to add new orgs and peers.
The issue here is that in all documentation examples, organizations run in the same docker-engine host, which misses the whole point of distributed systems. Recently I found this blog post that endorses everything I am struggling with:
https://medium.com/#wahabjawed/hyperledger-fabric-on-multiple-hosts-a33b08ef24f
In this post, the author recommends using docker-swarm to create an overlay network that creates a distributed network among multiple Docker daemon hosts.
However, this post is from 2018, and I am wondering if this is still the best solution available? Or if Kubernetes, nowadays, would be the go for choice to create this overlay network?
ps: this network I am building is for academic purposes and research only, related to my PhD. studies.
Yes, you can use docker-swarm to deploy the network. docker-swarm is quite easy when compared to kubernetes. Since you mentioned that it is for academic purpose and research only then docker-swarm is fine.
Or you if want to deploy the production-grade hyperledger fabric you can use open source tool BAF, Blockchain Automation Framework which is an automation framework for rapidly and consistently deploying production-ready DLT platforms to cloud infrastructure.

Connect external workers to Cloud Composer airflow

Is it possible to connect an external worker that is not part of the Cloud Composer Kubernetes cluster? Use case would be connecting a box in a non-cloud data center to a Composer cluster.
Hybrid clusters are not currently supported in Cloud Composer. If you attempt to roll your own solution on top of Composer, I'd be very interested in hearing what did or didn't work for you.

Is it possible to deploy/interact with hyperledger composer network on another machine?

Single business network to be deployed on multiple machines and should be able to interact across different machines.
I am interested in deploying and accessing network in another machine. I am trying to do this by changing the connection profile (with ip and ports) of my desired host machine, but I am facing the issue:
Unable to find the response from the peers.
Is there any standard method for the same?
You can review these articles
https://discourse.skcript.com/t/running-hyperledger-composer-with-multiple-organization-on-different-host-machines/635
and
Hyperledger fabric deployment (real network)
How should composer setup to be done for hyperledger fabric network deployment for multiple orgs on multiple physical machine
You'll need to ensure that your dockerized nodes (on either physical machines etc) can 'see' each other on the IP network (standard networking stuff) and the connection profiles are configured accordingly. See also the multi-org tutorial (replace localhosts with real hosts and consider what crypto material (certs/keys) is required 'where' - but at least it gives you an indication of the sequence from a Composer standpoint https://hyperledger.github.io/composer/tutorials/deploy-to-fabric-multi-org.html (ie if using Composer v0.16.x) - if using Composer v0.17.x (and Fabric v1.1.x) then you need these docs https://hyperledger.github.io/composer/next/tutorials/deploy-to-fabric-multi-org.html (the connection profiles are a different format).

Hyperledger Fabric v1.0 setup on multiple machines

I am working with balance transfer example I did setup in single machine I want to do that example in two machines.I am following the below link https://github.com/hyperledger/fabric-samples/tree/release/balance-transfer can anyone tell me what are the steps or ways I have to do for implementing that example in multiple machines.
I was able to host hyperledger fabric network using docker swarm mode. Swarm mode provides a network across multiple hosts/machines for the communication of the fabric network components.
This post explains the deployment process https://medium.com/#wahabjawed/hyperledger-fabric-on-multiple-hosts-a33b08ef24f

Does Hyperledger Fabric need Docker?

This may be the stupid question.
Does Hyperledger Fabric require Docker for its operations.
I'm just wondering that Docker is needed only if we need to run Fabric peer, orderer or couchDB as virtual machine in the same physical machine. I think Docker might not be necessary if we install those sofwares (peer, order, couchDB, etc) natively on the separate and same server.
Thank you.
Just so this point does not go unnoticed, while you do not need to run the peer in a Docker container, endorsing peers (the ones which run chaincode) need access to a Docker daemon (ideally on the same host). Chaincode is currently only deployed via Docker containers.
The question as to whether Docker is required to run a peer, orderer, fabric-ca, etc. depends on what effort you are willing to expend.
The Hyperledger Fabric community publishes stable, tested Docker images for X86, PowerPC and s390 (mainframe) architectures for each of its releases. These images are based on Ubuntu.
To use the Hyperledger Fabric published release images, you need Docker and some form of orchestration support. For sample use cases, we provide some simple Docker Compose definitions. Hyperledger Cello and other provisioning platforms such as the IBM sandbox, provide kubernetes helm charts.
It is possible to build the binaries outside of their Docker images without modification of the source. However, if you wish to build for an alternative OS (e.g. Windows, RHEL or CENTOS, etc) then you will need to modify the build process. However, it can and has been done. Suggest you reach out to the hyperledger-fabric#lists.hyperledger.org mailing list to see if any in the community that have built for alternative deployment will share their work.
Starting HLF 2.0 things have changed. According to documentation, chaincode can be in 'external containers' also.
https://hyperledger-fabric.readthedocs.io/en/release-2.0/cc_launcher.html
Yes, it is the second heading on the prerequisites page at http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
Docker and Docker Compose

Resources