T_murder
T_murder

Reputation: 31

Did all peers execute chaincode?

I have a question. I want to know whether all nodes execute the chain code or only endorsement nodes execute the chain code?

Upvotes: 0

Views: 344

Answers (1)

Artem Barger
Artem Barger

Reputation: 41222

The only peers to execute chaincode are the endorsing peers, rest only validates during the commit time whenever the transaction satisfies endorsement policy. And in order to be peer to be able to endorse the transaction proposal someone (admin) has to install the chaincode on it.

You can find more details in documentation or there is a nice blog post which also describes it pretty well.

Basically flow from high level perspective works as following:

  1. Client submits transaction proposal to endorsing peers
  2. Endorsing peers invokes chaincodes
  3. Endorsing peers signs over the execution results
  4. Client gathers all results and check consistency
  5. Client submits transaction to the ordering service
  6. Ordering service cuts new block with several transactions
  7. Peer gets new block via dissemination layer
  8. Peer validates each transaction
  9. Eventually block is committed where all valid transaction changes the sate according to the simulation results from #2.

There some more int depth detail published in the official Fabric paper.

Upvotes: 3

Related Questions