Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-2331 Fabric support for javascript chaincode
  3. FAB-5371

Code structure design and initial impl of node chaincode shim

    Details

    • Type: Sub-task
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: fabric-chaincode-node
    • Labels:
      None

      Description

      • the runtime image should be built based on the fabric-baseimage image, which already has node 6.9.x and npm 3.10.x pre-installed, and add the following pieces:
      • module: command-line-require
      • module: log4js
      • module: grpc
      • the user-provided chaincode should be the main entry point to start the app:
        const shim = require('fabric-shim');
        var Chaincode = class {
          Init() { // init() impl }
          Invoke() { // invoke() impl }
        };
        shim.Start(new Chaincode());
        
      • all shim interface's functions should be implemented in the 'fabric-shim' package
      • arguments passing b/w the SDK and the chaincode should be JSON based instead of byte arrays

      Note: a significant internal refactoring on the communication protocol b/w the peer and chaincode container during endorsement is being worked on, with the main goal to eliminate FSM: https://gerrit.hyperledger.org/r/#/c/11867. Basing the javascript shim implementation on the refactored code should be preferred.

        Attachments

          Activity

            People

            • Assignee:
              jimthematrix Jim Zhang
              Reporter:
              jimthematrix Jim Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 days
                4d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days
                4d

                  Git Source Code