Wed. Sep 28th, 2022

Chaincode is the code that defines the rules and logic for a specific application on the blockchain. When a transaction is submitted that deploys new chaincode to the blockchain, it is first sent to the endorsing peers. The endorsing peers will then execute the chaincode to simulate the proposed transaction and determine whether or not to endorse it. If the chaincode is valid and the transaction would result in a valid state change, the endorsing peers will sign the transaction and send it back to the client. The client will then submit the transaction to the orderer, which will broadcast it to the other nodes in the network. The other nodes will then validate the transaction and, if it is valid, update their local copy of the ledger.

Other related questions:

Q: Which transaction deploy new chaincode to the Hyperledger Fabric blockchain?

A: There is no single “transaction” that deploys new chaincode to the Hyperledger Fabric blockchain. Rather, the process of deploying new chaincode involves multiple steps, including:

1. Compiling the chaincode source code into a binary file
2. Submitting the chaincode binary file to a peer node
3. Installing the chaincode on the peer node
4. Initializing the chaincode
5. Invoking the chaincode to deploy the new chaincode

Q: How do you deploy chaincode in Hyperledger Fabric?

A: There are a few different ways to deploy chaincode in Hyperledger Fabric.

The most common way is to use the peer chaincode deploy command. This command will take your chaincode and package it into a container which will then be deployed on the peer.

Another way to deploy chaincode is to use the Fabric SDK. The SDK will allow you to deploy your chaincode as well as invoke and query it.

Finally, you can also use the Fabric REST API to deploy your chaincode. This can be done using curl or any other HTTP client.

Q: What are the two types of transactions in the Hyperledger Fabric?

A: There are two types of transactions in the Hyperledger Fabric:

1. Endorsing Transactions: These transactions are used to endorse a proposal. An endorsing transaction is valid only if it is signed by a majority of the members of the endorsing peer group.

2. Ordering Transactions: These transactions are used to order a set of endorsed transactions. An ordering transaction is valid only if it is signed by a majority of the members of the ordering peer group.

Q: Which chaincode function is called when the chaincode is first deployed?

A: There is no specific function that is called when the chaincode is first deployed. However, the chaincode’s Init function will be called when the chaincode is first deployed.

Bibliography

Leave a Reply

Your email address will not be published.