@@ -5,15 +5,15 @@ System chaincodes are specialized chaincodes that run as part of the peer proces
5
5
as opposed to user chaincodes that run in separate docker containers. As
6
6
such they have more access to resources in the peer and can be used for
7
7
implementing features that are difficult or impossible to be implemented through
8
- user chaincodes. Examples of System Chaincodes are ESCC (Endorser System Chaincode)
9
- for endorsing proposals, QSCC (Query System Chaincode) for ledger and other
10
- fabric related queries and VSCC (Validation System Chaincode) for validating
11
- a transaction at commit time respectively.
8
+ user chaincodes. Examples of System Chaincodes include QSCC (Query System Chaincode)
9
+ for ledger and other fabric related queries, CSCC (Configuration System Chaincode)
10
+ which helps regulate access control, and LSCC (Lifecycle System Chaincode).
12
11
13
12
Unlike a user chaincode, a system chaincode is not installed and instantiated
14
- using proposals from SDKs or CLI. It is registered and deployed by the peer at start-up.
13
+ using proposals from SDKs or CLI. It is registered and deployed by the peer at
14
+ start-up.
15
15
16
- System chaincodes can be linked to a peer in two ways: statically and dynamically
16
+ System chaincodes can be linked to a peer in two ways: statically and dynamically,
17
17
using Go plugins. This tutorial will outline how to develop and load system chaincodes
18
18
as plugins.
19
19
@@ -27,21 +27,22 @@ A plugin includes a main package with exported symbols and is built with the com
27
27
``go build -buildmode=plugin ``.
28
28
29
29
Every system chaincode must implement the `Chaincode Interface <https://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim#Chaincode >`_
30
- and export a constructor method that matches the signature ``func New() shim.Chaincode `` in the main package.
31
- An example can be found in the repository at ``examples/plugin/scc ``.
30
+ and export a constructor method that matches the signature ``func New() shim.Chaincode ``
31
+ in the main package. An example can be found in the repository at ``examples/plugin/scc ``.
32
32
33
33
Existing chaincodes such as the QSCC can also serve as templates for certain
34
- features - such as access control - that are typically implemented through system chaincodes.
35
- The existing system chaincodes also serve as a reference for best-practices on
36
- things like logging and testing.
34
+ features --- such as access control --- that are typically implemented through
35
+ system chaincodes. The existing system chaincodes also serve as a reference for
36
+ best-practices on things like logging and testing.
37
37
38
38
.. note :: On imported packages: the Go standard library requires that a plugin must
39
- include the same version of imported packages as the host application (fabric, in this case)
39
+ include the same version of imported packages as the host application
40
+ (Fabric, in this case).
40
41
41
42
Configuring Plugins
42
43
-------------------
43
44
44
- Plugins are configured in the ``chaincode.systemPlugin `` section in * core.yaml * :
45
+ Plugins are configured in the ``chaincode.systemPlugin `` section in `` ` core.yaml`` :
45
46
46
47
.. code-block :: bash
47
48
@@ -54,7 +55,8 @@ Plugins are configured in the ``chaincode.systemPlugin`` section in *core.yaml*:
54
55
invokableCC2CC: true
55
56
56
57
57
- A system chaincode must also be whitelisted in the ``chaincode.system `` section in *core.yaml *:
58
+ A system chaincode must also be whitelisted in the ``chaincode.system `` section
59
+ in ``core.yaml ``:
58
60
59
61
.. code-block :: bash
60
62
0 commit comments