Fabric orderer to peer configuration for deliver RPC - hyperledger-fabric

We've a below network setup for hyperledger fabric:
3 Ordering Service nodes, 4 Kafka brokers and 3 Organizations (2 peers in each organization)
Requirement is - we need to make sure leader peer from each organization is receiving blocks via deliver RPC from a "specific" ordering service node.
How can we configure a specific ordering service node for peers in fabric?

There's no "magic" way to configure something like this in Fabric. The orderer endpoint information is stored in the system channel so normally all 3 of the Ordering Service endpoints would be in their so that any peer from any organization is aware of all the endpoints (for fault tolerance).
With the current Kafka-based ordering service, you might be able to achieve what you want by only setting a single endpoint in the orderer addresses section and then making sure that each organization resolved that DNS name to the specific endpoint desired.

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!

How many peers(hyperledger fabric) do we need?

I thought peer's roll is processing transaction, managing chaincode and ledger.
Already I know there are endoring peer, committing peer, anchor peer, leader peer.
My question is how many peers are needed.
According to fabric docs, when client doing something, it approaches the peer by changing the env.
For example, if there are 1000 clients who access the same channel at the same time, do they need at least 1000 peers? I asked this question because there is only one client in the tutorial.
Many clients can access a single peer. Typically there will be multiple organizations in a Fabric network, with each organization having a few peers for redundancy and load balancing of client requests.

Can we override discovered orderer with defined orderer in connection profile?

I am trying to connect Hyperledger Explorer with my fabric network hosted on Oracle Blockchain Service. To my surprise, service discovery is finding an orderer that does not belong to my network and gets timed out while retrieving the data. After looking into the codebase, I found that any orderer defined in the connection.yaml is not looked up. Can we override the discovered orderer with the orderer defined in my connection.yaml?
Discovery returns the orderers from the channel configuration which is specified in the configtx.yaml.
Issue a config update transaction that changes the endpoints and it'll fix it.

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.

Does hyperledger fabric use structured p2p?

P2P has two different structures.
one is unstructured P2P and the other one is structured P2P.
I know fabric use hybrid-P2P.
And is it use strutured P2P?
Hyperledger Fabric really uses "structured" peer to peer communication.
Peers communicate with ordering service nodes and with other peer nodes.
Channels form the basis of the peer to peer communication (meaning that communication is scoped on a per channel basis).
For peer to orderer communication, this is structured based on channel definitions .... when a peer joins a channel, the channel definition is contained in the block passed via the JoinChannel API. This is a special type of block known as a config block and it contains the information about the ordering service endpoints, membership for the channel and optionally the endpoints of peers from other organizations (anchor peers).
Peers which belong to the same organization can also "gossip" and this is configured by setting a bootstrap peer when a peer starts up. From this, the peers within an org will "discover" each other.
If an organization chooses to expose public endpoints from multiple peers, peers from other organizations will discover these peers by connecting the to anchor peer for the other org for a given a channel.

Resources