Using Hyperledger Fabric REST interface in multi-organization network - hyperledger-fabric

I'm trying to set up a 3-organization network, with users of each org connecting to their own peer over a REST interface.
In the examples I've seen for single-org networks, the rest connection is made to localhost, i.e. the host of all the Docker containers. In a multi-org network, what should I be trying to connect the REST interface to from the client, is it the peer of that org, i.e. peer0.org1 etc?

Related

Unable to update the orderer endpoint in an existing hyperledger fabric network

I have a hyperledger fabric network deployed in v2.2.0 in a kubernetes cluster. The network has an orderer org with 5 orderering nodes and few peer orgs.
Initially the network is deployed in such a way that no services of peers/orderers were exposed outside of the cluster and they were reachable using ClusterIP service of k8s.
Later, due to our need, we exposed the k8s peer/orderer services using ingress. After creating ingress for all the network components, I have updated the orderer endpoints to the channel configuration by fetching the latest channel configuration block.
Now, I need to add a new org which is deployed in another k8s cluster to the channel in this network. I joined the new org peer using the channel's genesis block. Since the genesis block is configured with the internal service endpoints and not with ingress endpoints, the new peer in another k8s cluster is trying to reach the internal service name (Eg: orderer1.hyperledger.svc.cluster.local:7050) of the orderer to fetch the block.
Since the above internal service is not accessible outside the cluster, the new peer is unable to fetch the blocks and get synced to the channel.
Is there anyway that we can update the genesis block configuration with the orderer ingress endpoints? Or any other possible solutions available?
Please provide suggestions. Thanks in Advance!

I want to build a Hyperledger Fabric network running on multiple hosts with multiple organizations

I was following Abdul Wahab's tutorial: Hyperledger Fabric on Multiple Hosts here. He had one organization with two peers.
It all worked fine for me until I tried to create two organizations each having 1 peer. I changed crypto-config.yaml, configtx.yaml and bmhn.sh and I’m pretty sure they’re right (In configtx.yaml, I added org2 with anchor peer0 and port 7051. In script.sh, I added CORE_PEER_ADDRESS=peer0.org2.example.com:7051). Is there something wrong with the ports?
And should I change something in the commands he provided? (For example in 6. Peer1, I changed org1 to org2 when necessary but I haven’t touched the port numbers). I think the problem is with the ports…
Could you please help me?
Assuming you need to run two org setup on multiple hosts, you'll need to do the following:
Open up the ports #2377(TCP), #7946(TCP+UDP) and #4789(UDP) for docker swarm network.
Create swarm from one of the hosts and make the other host join this swarm network.
Create an overlay network.
Make sure your docker-compose file for fabric components like orderers, peers, ca, couchdb and optionally cli joins this overlay network. These components should be configured to connect to the external network.
Spinup docker containers for fabric components on both the hosts.
Run "docker network inspect " on both the hosts to check if all the containers have joined the correct network.
By the end, you should be having a multi-org setup on multiple hosts ready.

Connecting 2 existing Org in separate Machines - Hyperledger Fabric

Do you have any idea how am I going to connect 2 existing organizations from different machines using the existing channel of 1 organizations. Here is what I have as of now, Org1 is running in VM1 and Org2 is running in VM2 with both have there own chaincode installed. What I am trying to do is to connect Org2 to Org1 to a channel of Org1. I don't have any idea how am I going to do it since currently the only example that I have is only using the same VM. Thank you.
You can connect them through the channel.
Suppose that you have already all the url exposed of each components (peer, orderer ..) and that org1 hold the channel. You simply need give to org2 the right to join the existing channel.
Here a guide:
https://hyperledger-fabric.readthedocs.io/en/release-1.2/channel_update_tutorial.html
based on what you said, you should start the tutorial from the section "Generate the Org3 Crypto Material".
To connect organizations on different hosts, you'll need to create a Docker Swarm. Once you have all the hosts joined to docker swarm, you'll need to create an overlay network and make your containers join this overlay network.
You can start following this blog that describes a simple configuration for multiple hosts. For further reference, you can refer to this SO answer.
For deployment using Kubernetes, you can refer to this medium blog.

Configuring existing hyperledger nodes with hyperledger cello

I have deployed [two org hyperledger fabric network1. Now I want to integrate it with hyperledger Cello. I have installed it, now I am bit confused what values shall I put in Add host fields as per my installed network(please refer to link regarding peer ip and port). Its just a simple network on my local machine with docker(not swarm or kubernetes).
Cello is used to deploy fabric network you can find the container configuration file in fabric.solo.yaml
once you add your host go to chain tab and add new chain network
write on your terminal docker ps you will find the container created

Hyperledger composer peer to peer connection not establishing

We have established a business network using Hyperledger composer and created participant card by creating peers.
When we try to connect the peer to a different machine in the local after importing participant card then I'm getting the following error
Error: Error trying login and get user Context. Error: Error trying to
enroll user or load channel configuration. Error: Enrollment failed
with errors [[{"code":400,"message":"Authorization failure"}]]
Business network is created in the mac machine and both machine are connected in the same wi-fi. Please help us to establish connection.
Check the connection profile that you are using. See documentation. By default, the connection profile assumes that you are running everything on the same machine by using localhost as the HOST.
If you are using the basic Fabric network in the single organisation tutorial, you can make use of their script to point the machines to the correct IP address or host domain by running the following command to generate the peer admin card with the correct connection profile
./createPeerAdminCard.sh --host {{HOST}}
Remember to replace {{HOST}} with the correct IP address or host domain like 192.168.1.1 or fabric-endpoint.example.com.
Once you have the correct connection profile in the peer admin card, all other business network cards generated will have the same connection profile and it would work.

Resources