Uploaded image for project: 'Fabric Chaincode Node'
  1. Fabric Chaincode Node
  2. FABCN-8

Fabric support for javascript chaincode

    Details

    • Epic Name:
      Unknown
    • SDK Impact:
      Unset
    • Design Status:
      Unset
    • Function Test Status:
      Unset
    • Documentation Status:
      Unset
    • Sample/Tutorial:
      Unset

      Description

      Add support to allow chaincode to be written in javascript, specifically in the node.js execution environment.

      • A chaincode written in javascript is able to use the standard shim interface https://github.com/hyperledger/fabric/blob/release/core/chaincode/shim/interfaces.go, implemented in JS
      • follows the same lifecycle as golang and java: install -> instantiate -> upgrade
      • utilizes the "chaincode platform" framework based on docker, so that a javascript chaincode image is built by the peer based on a base image and dockerfile commands specific to the js chaincode execution environment
      • chaincodes written in javascript is able to use the standard require() to make use of npm modules
      • an optional package.json can accompany the chaincode to specify name, version, and most importantly external dependencies
      • during install, the chaincode's external dependencies can either be specified by the package.json, for which they will be installed when the chaincode docker image is being built by the peer, or they can be included in the chaincode package as part of the ChaincodeDeploymentSpec inside a "node_modules" folder. having this flexibility provides the balance b/w deterministic installs and light-weight code packages, and enables the developer to determine the optimal approach

      The implementation of this new capability will be split b/w two repositories:

      • fabric: enhancement to core/chaincode/chaincode_support.go to direct requests targeting the node.js chaincode to new platform handler, to be implemented in core/chaincode/platforms/node package
      • fabric-chaincode-node: will originally contain the shim implementation in node.js

        Attachments

        1. fab-2331.png
          651 kB
          Greg Haskins
        2. js_examplecc.js
          1 kB
          Cong Honglei
        3. jscc.diff
          42 kB
          Cong Honglei

          Issue Links

            Activity

              People

              • Assignee:
                jimthematrix Jim Zhang
                Reporter:
                Honglei Cong Honglei
              • Votes:
                6 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 14 weeks, 1 day
                  14w 1d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 14 weeks, 1 day
                  14w 1d

                    Git Integration