Adelin
Adelin

Reputation: 19011

Understand Hyperledger Fabric endorsement policy logic and peers types

Sorry for the long question but Hyperledger is a fairly complex system.

Reading the Blockchain network In the section Generating and accepting transactions

In contrast to peer nodes, which always host a copy of the ledger, we see that there are two different kinds of peer nodes; those which host smart contracts and those which do not. In our network, every peer hosts a copy of the smart contract, but in larger networks, there will be many more peer nodes that do not host a copy of the smart contract

How to design the blockchain network and to decide how many peers should have smart contracts and how many should not?, Is there any design rules or patterns ?

When we have multiple organizations, should every organization has an endorsing peer, or they all can have only one within one organization and all other can call it ?

Upvotes: 2

Views: 273

Answers (1)

yacovm
yacovm

Reputation: 5140

How to design the blockchain network and to decide how many peers should have smart contracts and how many should not?, Is there any design rules or patterns ?

My rule of thumb is - you first think about the endorsement policy, and then you install the chaincode on peers that belong to organizations that are in the endorsement policy.

Then, you can also optionally install the chaincode for query-only transactions (that don't get into the Blockchain) on peers of organizations regardless of their involvements in the endorsement policy or not, because it makes sense that a client would want to query its own organization (since it trusts it the most).

The only corner case is that sometimes the code of the chaincode is not known and the organizations of the endorsement policy, do not want to share it.

When we have multiple organizations, should every organization have an endorsing peer, or they all can have only one within one organization and all other can call it ?

It depends on the use case. Some organizations have clients only, and some organizations have peers only, or only orderers.

Whether an organization is an endorser for a chaincode, usually depends on the endorsement policy.

Upvotes: 3

Related Questions