系统链码与智能合约

System Chaincode and Smart Contract

再次强调一遍:
system chaincode 系统链码;smart contract智能合约

a smart contract defines the executable logic that generates new facts that are added to the ledger.

A smart contract defines the rules between different organizations in executable code. Applications invoke a smart contract to generate transactions that are recorded on the ledger.

A chaincode is typically used by administrators to group related smart contracts for deployment, but can also be used for low level system programming of Fabric

a smart contract defines the transaction logic that controls the lifecycle of a business object contained in the world state.

It is then packaged into a chaincode which is then deployed to a blockchain network.

Think of smart contracts as governing transactions, whereas chaincode governs how smart contracts are packaged for deployment.
系统链码与智能合约
A smart contract is defined within a chaincode. Multiple smart contracts can be defined within the same chaincode. When a chaincode is deployed, all smart contracts within it are made available to applications.

Different Types of System chaincode

_lifecycle runs in all peers and manages the installation of chaincode on your peers, the approval of chaincode definitions for your organization, and the committing of chaincode definitions to channels.

  • Lifecycle system chaincode (LSCC) manages the chaincode lifecycle for the 1.x releases of Fabric. This version of lifecycle required that chaincode be instantiated or upgradedon channels. You can still use LSCC to manage your chaincode if you have the channel application capability set to V1_4_x or below.
  • Configuration system chaincode (CSCC) runs in all peers to handle changes to a channel configuration, such as a policy update.
  • Query system chaincode (QSCC) runs in all peers to provide ledger APIs which include block query, transaction query etc.
  • Endorsement system chaincode (ESCC) runs in endorsing peers to cryptographically sign a transaction response.
  • Validation system chaincode (VSCC) validates a transaction, including checking endorsement policy and read-write set versioning.

关于这一块的好文