concept peer chaincode invoke in category hyperledger

appears as: peer chaincode invoke
Programming Hyperledger Fabric: Creating Permissioned Blockchains

This is an excerpt from Manning's book Programming Hyperledger Fabric: Creating Permissioned Blockchains.

Figure 1. 3. Lifecycle of a Fabric transaction or equivalently the peer chaincode invoke command. Step 1, user submits a proposal using a client app. Step 2, proposal is evaluated by each of the peer nodes independently. Step 3, peer nodes send back endorsed responses to the client together with readwrite sets. Step 4, client application packages endorsements into a transaction, digitally signs it and submits it to the orderer. Step 5, orderer is a pubsub service that performs an atomic broadcast and establishes an unambiguous order on transactions. Step 6, peer nodes can poll the orderer for new blocks or get notified via an event; they dequeue new blocks, validate transactions and commit them to their copy of the blockchain. Step 7, client application can register with a peer node to be notified when its transaction is committed to the ledger. Figure adapted from medium.com/coinmonks/demystifying-hyperledger-fabric-1-3-fabric-architecture-a2fdb587f6cb

Steps 1-3 in Figure 1. 3 are known as execution phase. Steps 4-5 are known as ordering phase and steps 6-7 are known as commit or validation phase. Taken together Fabric calls it the execute-order-validate architecture. The entire transaction flow we have covered in this section gets executed when one runs the peer chaincode invoke command which we will cover later in the book. This command comes with peer binary of Fabric. The title of this section might as well be lifecycle of peer chaincode invoke. The command acts as the client application in the transaction flow.

Table 7.1. peer CLI commands introduced in this chapter.

Command

Purpose

Orderer is involved

Need administrator privileges

peer chaincode invoke

submit a transaction, write to the ledger and world db

peer chaincode query

read from the world db

peer channel update

update channel configuration

Let’s begin by creating a few assets in the system. This is done using the peer chaincode invoke command as follows. Execute it from $/three-org-network directory with identity of a Biotor user (not an admin):