create a Hyperledger Fabric network - hyperledger-fabric

Hyperledger Fabric community,
I am a beginner Hyperledger Fabric developer, I have some ambiguities regarding how a Hyperledger Fabric network works and is created.
So what is the use of the fabric-samples network and the test-network or first network and above all, what are the steps to follow to create, configure and launch a Hyperledger Fabric network
I need your help

Go to Getting Started
Use a Mac OS or Ubuntu platform and follow the instructions for installing and running the networks. The test-network example is a great starting point, as it covers all of the basic concepts. There are shell scripts there that will help you to create a new 2 peer network, as well as scripts to help you deploy some chaincode. There are a lot of concepts to learn, but just getting a network up and running and being able to run contract code will be a great start.
After you have got a network up and running, you should look at the shell scripts and see exactly which Hyperledger commands were used to create each artefact.

Related

Block chain data will lose in Hyperleger composer network

I Just create a hyper ledger composer network in production level. There are many data(Participant and asset) is existing in my composer blockchain( That is on CouchDB). My main problem is I need to set up a hyper ledger explorer for my existing network. I already use https://github.com/hyperledger/blockchain-explorer. But the issue is my network orderer port is not synced with explorer( I already post a question regarding this issue Hyperledger explorer starting problem- orderer port communication issue. Unfortunately no replay).
At this moment I decided to stop the running hyper ledger composer network and start again it without any data(participant and asset data) lose. Actually restart the network without data loss is possible...???
Have any other suggestion is available to resolve my issue..???
Any suggestion is much appreciated..
Thank you.
OS: Ubuntu 16.04
Composer: 0.19.16
Fabric: 1.1.0
When you stop your business network using stopFaric.sh under fabric-dev-servers (or fabric-tools). It will stop fabric Containers and after that run startFabric.sh it will recreate new Containers from the Docker Images. Impact of this is that you lose all data(assets, participant, transaction etc) of your business network.
So if you want to stop and start your fabric without loss of existing data. Then follow below commands :
Need to change the directory where the docker-compose.yml(/home/<user>/fabric-dev-servers/fabric-scripts/hlfv11/composer) file is, and
Run docker-compose stop to stop the Fabric then
Run docker-compose start to restart Fabric it will start your network with existing data. Make sure you are in the correct folder.
Hope, it will help you :)

Deploying a Hyperledger Composer blockchain business network to Hyperledger Fabric for a single organization

When I deployed a single-organization network in accordance with hyperledger composer, I used “composer network ping -c admin#tutorial-network” to test the business network connection and get this error.
Please help me, thank you
To solve this error...
"Error: Composer runtime (0.19.12) is not compatible with client (0.20.0)"
This looks like you have recently installed a new version of composer-cli (v0.20.0), and you are connecting to a Business Network that was originally installed with a composer client (v0.19.12). You will need to force an upgrade of your Business Network to get the upgraded runtime used.
You need to do the following:
update the version of your business network in your package.json file.
Create a new .bna file with composer archive create
Then use composer network install to install the new version on the peer(s)
Use composer network upgrade to upgrade the running version of the Business Network.
Try the ping again :-)
Note that you need to use your PeerAdmin card for the network install and network start commands.
There is an example of this procedure in the Composer Queries tutorial.

Hyperledger Fabric multiple hosts setup marbles demo

I have successfully installed a few hyperledger demos, including the marbles one (https://github.com/IBM-Blockchain/marbles)
A few questions,
How can I move some of the marbles demo nodes to another host/s and still get this demo to work?
I have read the following two posts on the same topic already (where
docker-swarm has been used for intra-host communication)
How can I set up hyperledger fabric with multiple hosts using Docker?
hyperledger-fabric-with-multiple-hosts-using-docker &
How can I make a communication between several docker containers on my local network
communication-between-several-docker-containers-on-my-local-net
I still couldn't decipher installing additional nodes and running them
on different hosts.
As running blockchain nodes on multiple hosts seems to be a common task,
how is it being done now? I saw references to Cello and an ansible
script, though they look not so mature and sure shot solutions.
Could I install the fabric nodes manually by pulling the hyperledger/fabric peer images from the docker hub? How do I then install & run the marbles demo on this pulled images?
Thanks
How can I move some of the marbles demo nodes to another host/s and still get this demo to work?
What do you want to do? I don't understand why you want to move a node. Has it got any sense? If you move some nodes, you are removing them from your Blockchain. If they are part of the Ordering Service or they endorsement is required for the endorsement policy, your demo will not continue running.
The intra-host communication and the communication among multiple docker containers are different things from what you are asking.
Could I install the fabric nodes manually by pulling the
hyperledger/fabric peer images from the docker hub? How do I then
install & run the marbles demo on this pulled images?
You can install you nodes manually via the docker-compose. You should define what you want to start up and then execute it. Of course, you should have in your machine the corresponding docker images. Then, you should deploy the marbles Smart Contract in your peers. You have more info about it here.

Hyperledger Composer on a local network of Ubuntu servers

I was able to setup Hyperledger Composer on Docker containers on a mac by following the instructions here: https://hyperledger.github.io/composer/installing/development-tools.html. I was also able to develop a proof of concept project with both a mobile web app that connected the blockchain via a rest API.
Now, I am trying to run the nodes on actual Ubuntu servers in a local network but I can't seem to find any tutorial to explains how to do that.
I know I might have some gap in my knowledge of computer architecture or networking in general that's why I am struggling with this.
I was looking at the downloadFabric.sh script in fabric-tools and I see how the Docker images are filled. I was thinking maybe I should just pull the Docker images to the individual Linux servers.
### Pull and tag the latest Hyperledger Fabric base image.
docker pull hyperledger/fabric-peer:$ARCH-1.0.1 on server 1
docker pull hyperledger/fabric-ca:$ARCH-1.0.1 on server 2
docker pull hyperledger/fabric-ccenv:$ARCH-1.0.1 on server 3
docker pull hyperledger/fabric-orderer:$ARCH-1.0.1
docker pull hyperledger/fabric-couchdb:$ARCH-1.0.1
and so on.
Please, how will you do this? Are there any resources I missed while researching how to do this? Can you point me to some resources that I can read to help understand how to do this?
So Hyperledger Composer will connect to the Fabric that you configure. So your problem is to configure a Fabric environment and set of nodes, using the host name resolution etc that you want to configure your network.
Would advise to check out the Fabric Docs http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html to build your network. They have some sample-networks (see the Github Repository here -> https://github.com/hyperledger/fabric/tree/release/examples )
The 'Fabric' that is set up by Hyperledger Composer's dev environment is just a Dev environment with one peer configured (via docker containers) to get you going.
You need to understand from the Fabric Docs how to set up your network, then come back to Composer (once all that is set up) and use connection profiles to connect to the runtime Fabric.
You could consider using docker-composer which builds on the docker client and makes it easier to run multiple docker containers. Please consult the manual to install docker-compose.
After installing docker-compose, you can use the startFabric.sh script provided here to start Fabric containers you had downloaded.
You may want to consider deploying Fabric with it's sister project Hyperledger Cello. Specifically, the Ansible driver for Kubernetes.
The samples provided in both Composer and Fabric are mostly for single host deployment. You could adapt the Docker Compose to use Swarm, but even Docker is moving away from Swarm, now.
Of course, if you just want to try to run locally, then the Build Your First Network tutorial in Hyperledger Fabric will get you rolling with the docker images in your question.

Hyperledger-fabric setup in real systems

I have been working on hyperledger-fabric node sdk v 1.0 and successfully created prototype based on dockers . However now I wanted to implement this architecture on real systems. I haven't found any documentation which helps in setting up environment in real systems. All I found is to set up different peers and organization using dockers and then invoke transactions etc.Can we connect different computer machines using dockers and then spin up the network on all these different machine to create private blockchain?
Yes, you can do it. For that, first of all you should define your network configuration. Then, you would create the artifacts that are required for the network: the keys, the channel artifact, the genesis block... You would follow the steps that are defined on the Fabric documentation to Build your first network. Also, you should share the public keys and the genesis block.
Then, in each machine you would install the docker images, like is explained in the Fabric documentation. After that, you would define the containers that you are going to set up in each machine. You do that on the docker configuration files (docker-compose.yaml, docker-base.yaml...). There, be aware of defining well the docker network configuration. You have more info about it in the answer of this question.
At the end you would switch on each container executin the docker-compose.
I don't know if I've given you enough information. If not, ask again please.
Docker is good for production systems. Docker swarm can be used for connecting multiple machines.

Resources