Uploaded image for project: 'Fabric Chaincode Node'
  1. Fabric Chaincode Node
  2. FABCN-8 Fabric support for javascript chaincode
  3. FABCN-315

Design and implement the JS chaincode plugin mechanism

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Medium
    • Resolution: Done
    • None

    Description

      What's the format of the chaincode source?

      • chaincode should be written as CommonJS modules and be launch-able with the node.js engine

      How does the chaincode get discovered and loaded into the node.js app?

      • a package.json must accompany is chaincode sources, in the root folder of the "chaincodePath" parameter during chaincode install. The package.json is critically important for two purposes:
        1. specifies any dependencies, including the fabric-shim package itself which is needed by all JS chaincodes, and any other external dependencies
        2. using the "scripts" section to specify how the chaincode should be launched:
            "scripts": {
              "start": "node mychaincode.js"
            },

      Do we allow JS chaincodes to have other source dependencies? in other words can a JS chaincode by broken up into multiple modules?

      • yes definitely

      How do we ensure multiple install operations produce the same binary from npm install?

      • use best practices with shrinkwrap.json

      Attachments

        Activity

          People

            jimthematrix Jim Zhang
            jimthematrix Jim Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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