Skip to content

Commit

Permalink
Merge 2.3 (#227)
Browse files Browse the repository at this point in the history
* [FABCI-482] Update Nexus URL's to Artifactory

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>

* [FABCN-377] Prepare v2.0 release

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Fix docker tag

Tag needs to include hyperledger to match the publish command

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-377] Bump version to 2.0.1

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-378] Publish jsdoc

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Re-enable tests

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-381] Access localmspid

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Update audit level

Temporarily raise audit level to moderate to work around current minimist audit failures

Can be reverted after grpc, rc, and tar dependecies have been updated to pull in updated versions of mkdirp and minimist

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Expand node engine version range

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* FABCN-391 Use version 2.1 of fabric docker images

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* FABCN-391 Update test/chaincodes to use node 10 and add a missing hat

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* [FABCN-377] Prepare for v2.1 unstable builds (WIP)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-373] Compatibility Matrix

Ammended all the node-engines in package.json to match
that in the docker image

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Change-Id: Ia536ed66daf857679adf9f858b35d206a4f1007f

* [FABCN-382] fix compatibility.md title

Signed-off-by: Andrew Hurt <andrew.hurt1@ibm.com>

* Improve build reliability

It looks like rushjs symlinking can cause issues with the CopyFiles task. Use a script instead as suggested in microsoft/azure-pipelines-tasks#9046

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Add readme to redirect to site

Signed-off-by: Ry Jones <ry@linux.com>

* FABCN-241 Remove to.be.ok

Signed-off-by: lesleyannj <lesleyannj@hotmail.com>

* FABCN-241  Change to.be.ok

Signed-off-by: lesleyannj <lesleyannj@hotmail.com>

* FABCN-241 Remove to.be.ok

Signed-off-by: lesleyannj <lesleyannj@hotmail.com>

* fix: remove semicolon

Signed-off-by: Johnny Da Costa <johnny.dacosta@he-arc.ch>

* FABCN-391 Set docker images to use node 10
- reflect this in compatibility.md
- update some out of date tutorial lines

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* FABCN-391 Build against release-2.x

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* FABCN-391 Remove references to 2.0 and 2.0.0
- replace with 2.x

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* [FABCN-392] Update to Node 12

Set node engine to be the latest LTS at time of commit 12.6.1
Due to issues with comibation of the 12.6 and rewire, unit tests are run
with node 12.5.0

Updated timeout as Typescript compilation seems to have slowed down.

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* [FABCN-391] Publish JSDoc to release-2.1

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* FABCN-391 v2.1.0 Release (#112)

* FABCN-391 v2.1.0 Release
- also fixed nodeenv images to use node 12

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* Update timeout (#114)

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>

Co-authored-by: Brett Logan <brett.t.logan@ibm.com>

* FABCN-391 Bump to 2.1.1 and fix docker tag (#122)

* FABCN-391 Remove "latest" from tag name on docker image publishing for tagged versions

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* FABCN-391 Bump version number to 2.1.1

Signed-off-by: heatherlp <heatherpollard0@gmail.com>

* [FABCN-391] fix directory for api doc publish (#125)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-394] Update typescript interface file (#128)

Updated both typescript definition files to match the case
and the existance of the implementation function.

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* Prepare 2.1.1 release (#133)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Bump version (#134)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-397] State queries limited to 100 results (#141)

Errow was the new version of protobufjs used to create the bundle.js
gave a different property to the 'has more' field.  hasMore replaced
has_more

As this accessed as JS property it didn't fail, but meant only a limited
number could be accessed.

corrected, added test for 229 results.
bit of dead code pruning

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* [FABCN-396] Add notes on minimum 1.4 module version for node 12 (#139)

Stated that 1.4.5 and above are the versions that work with node 12
Added a better example for the use of the chaincode node runtime environment
variable

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* FABCN-395: Use @grpc/grpc-js for Node.js chaincode (#143) (#144)

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>

* FABCN-401 Correct use of Yargs api (#145)

* FABCN-401 Correct use of Yargs api

Change from package.json to api parser configuration

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* Force build

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* Fix broken tutorials link (#137) (#138)

Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>

Co-authored-by: NIKHIL E GUPTA <negupta@us.ibm.com>

Co-authored-by: NIKHIL E GUPTA <negupta@us.ibm.com>

* Prepare 2.1.2 release (#148)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Bump version to 2.1.3 (#149)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* FABCN-405 Fix tutorial reference (#150) (#152)

Updated to use 2.1 modules

Signed-off-by: Ry Jones <ry@linux.com>

Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

Co-authored-by: Ry Jones <ry@linux.com>

* [FABCN-407] Update protos (#154) (#157)

To prepare for the implementation of chaincode gRPC server, this patch
updates protobuf definitions to the latest ones.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* [FABCN-410] Use new lifecycle for fv/e2e tests (#160)

This patch enables v2.0 feature in the test Hyperledger Fabric network
and uses new lifecycle commands in the fv and e2e tests.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* Fix 'rush install' error in release-2.x (#163)

This patch upgrades pnpm to fix the "Could not find peer dependency
'google-auth-library'" error.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* Cheery-pick chaincode server feature to release-2.x (#166)

* [FABCN-408] Separate message handler from client (#155)

This patch divides the ChaincodeSupportClient class into two classes:
ChaincodeSupportClient, which represents a chaincode client that
connects to a peer, and ChaincodeMessageHandler, which handles messages
in communciation with the peer through a stream.

Because the latter part is common in both client and server model,
the ChaincodeMessageHandler class will be used in the future
implementation for a chaincode gRPC server.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>

* [FABCN-409] Chaincode gRPC server w/o TLS (#159)

This patch adds the ChaincodeServer class to support the server mode of
chaincode.
It also adds the server() method, which creates a new instance of
the ChaincodeServer class, to the Shim class, the entrypoint of the
fabric-shim library.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* [FABCN-411] Add server command to CLI (#161)

This patch adds a "server" command to the "fabric-chaincode-node" CLI.
The command starts the contracts as a chaincode server.

Example: fabric-chaincode-node server --chaincode-address 0.0.0.0:9999 \
           --chaincode-id mycc_v0:a1233bb13227a05932

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* [FABCN-413] Add e2e test for chaincode server (#162)

This patch adds new e2e test for the chaincode gRPC server feature.

The test performs as following:
  - Create a package which contains server and cc information
  - Build a container image of the chaincode
  - Install the package into peers
  - Obtain the installed package ID from the peers
  - Start the chaincode container with the package ID
  - Approve and commit the chaincode definition
  - Invoke and query the chaincode

"rush test:e2e" will perform both tests for both server and client mode.

This patch also modifies "rush start-fabric" to use external builder
scripts.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* [FABCN-414] Update TypeScript definition (#165)

This patch updates the type defintion file for TypeScript to add classes
and interfaces related to the chaincode server feature.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* [FABCN-412] TLS support for chaincode server (#164)

This patch adds TLS support for chaincode server.

To enable TLS, set tlsProps in the second argument for shim.server,
or add --chaincode-tls-cert-file and --chaincode-tls.key-file for CLI.

Client certificate validation can be enabled via tlsProps.clientCACerts
for shim.server or --chaincode-tls-client-cacert-file for CLI.

Also the -path options (for base64 encoded files) are supported.

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>

* [FABCN-415] Lock grpc-js to 1.0.3 (#170)

@grpc/grpc-js updated to 1.1.0; this has caused the initial request to the
peer on chaincode start to fail.

Dropping back to 1.0.3 resolves the issue.

See FABCN-415

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* [FABCN-416] Release v2.1.3 (#171)

For resolving grpc version dependency

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* Specify exact version of winston dependency

Work around for issue winstonjs/winston#1814

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Prepare 2.1.4 release (#174)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-393] Fix broken links in documents (#169)

This patch fixes broken links to the fabric documents.
This patch also fixes links to point to those for the proper version
(2.1).

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* Bump version to 2.1.5 (#175)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-319] Update dependnency versions (#176)

- Update grpc-js and winston to pre-lock levels
- General update of dependcies
- Note add about shirnkwrap.
- Corrected test cases

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* [FABCN-420] Remove Azure pipeline warnings (#177)

Used new coverage merge tool to joing coverage together

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* Use Official CouchDB 3.1 Image (#180)

Fabric 2.2 removes official support for CouchDB 2.x.
The migration to 3.1 was to address fsync issues
in the underlying storage implementation in Couch.

This change moves to CouchDB 3.1 which requires the
user to now set an admin identity at startup.

Node 12.18.2 is the latest LTS

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>

* [FABCN-421] release: 2.2.0 LTS release (#181)

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* Bump version to 2.2.1 (#184)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* Fix: ChaincodeStub.getMspID should be in lowerCamelCASE

Signed-off-by: winderica <winderica@gmail.com>

* [FABCN-422] Add release guide (#187)

Signed-off-by: James Taylor <jamest@uk.ibm.com>

* [FABCN-433] Update typescript and @types/node (#199)

Need current supported levels.

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* [FABCN-241] Remove to.be.ok (#204)

Signed-off-by: lesleyannj <lesleyannj@hotmail.com>

* [FABCN-435] OOM on Large Arg Size (#207)

Incorrect trace point logging entire binary message

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

* v2.x tutorials updated (#217)

Signed-off-by: Kestutis Gudynas <44440041+kemi04@users.noreply.github.com>

* [FABCN-430] Fix type for timestamp.second (#194) (#209)

This patch fixes the type definition for the second field in the
Timestamp, which is actually Long (int64).

Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>

Co-authored-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>

* [FABCN-432] - Update class transformer dependency (#213)

* [FABCN-241] Remove to.be.ok

Signed-off-by: lesleyannj <lesleyannj@hotmail.com>

* [FABCN-1627]-Update class transformer dependency

Signed-off-by: lesleyannj <lesleyannj@hotmail.com>

* Release v2.3.0

Signed-off-by: Kestutis Gudynas <gudynask@gmail.com>

* Bump version to 2.3.1

Signed-off-by: Kestutis Gudynas <gudynask@gmail.com>

Co-authored-by: Brett Logan <brett.t.logan@ibm.com>
Co-authored-by: heatherlp <heatherpollard0@gmail.com>
Co-authored-by: Matthew B White <whitemat@uk.ibm.com>
Co-authored-by: Andrew Hurt <andrew.hurt1@ibm.com>
Co-authored-by: Ry Jones <ry@linux.com>
Co-authored-by: lesleyannj <lesleyannj@hotmail.com>
Co-authored-by: Johnny Da Costa <johnny.dacosta@he-arc.ch>
Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>
Co-authored-by: heatherlp <40789053+heatherlp@users.noreply.github.com>
Co-authored-by: Simon Stone <sstone1@uk.ibm.com>
Co-authored-by: nikhil550 <nikhilg550@gmail.com>
Co-authored-by: NIKHIL E GUPTA <negupta@us.ibm.com>
Co-authored-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>
Co-authored-by: winderica <winderica@gmail.com>
Co-authored-by: LAJ <33546098+lesleyannjordan@users.noreply.github.com>
Co-authored-by: Kestutis Gudynas <44440041+kemi04@users.noreply.github.com>
Co-authored-by: Kestutis Gudynas <gudynask@gmail.com>
  • Loading branch information
18 people committed Nov 10, 2020
1 parent ae5a352 commit 1cdb585
Show file tree
Hide file tree
Showing 42 changed files with 331 additions and 146 deletions.
67 changes: 66 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,72 @@
## v2.3.0
Tue 3 Nov 15:40:46 GMT 2020

* [f71eb0c](https://github.com/hyperledger/fabric-chaincode-node/commit/f71eb0c) [FABCN-432](https://jira.hyperledger.org/browse/FABCN-432) - Update class transformer dependency (#213)
* [fc32346](https://github.com/hyperledger/fabric-chaincode-node/commit/fc32346) [FABCN-430](https://jira.hyperledger.org/browse/FABCN-430) Fix type for timestamp.second (#194) (#209)
* [85188f5](https://github.com/hyperledger/fabric-chaincode-node/commit/85188f5) v2.x tutorials updated (#217)
* [05df03f](https://github.com/hyperledger/fabric-chaincode-node/commit/05df03f) [FABCN-435](https://jira.hyperledger.org/browse/FABCN-435) OOM on Large Arg Size (#207)
* [58387e8](https://github.com/hyperledger/fabric-chaincode-node/commit/58387e8) [FABCN-241](https://jira.hyperledger.org/browse/FABCN-241) Remove to.be.ok (#204)
* [c9a1f5d](https://github.com/hyperledger/fabric-chaincode-node/commit/c9a1f5d) [FABCN-433](https://jira.hyperledger.org/browse/FABCN-433) Update typescript and @types/node (#199)
* [eb39270](https://github.com/hyperledger/fabric-chaincode-node/commit/eb39270) [FABCN-422](https://jira.hyperledger.org/browse/FABCN-422) Add release guide (#187)
* [be2ef68](https://github.com/hyperledger/fabric-chaincode-node/commit/be2ef68) Fix: ChaincodeStub.getMspID should be in lowerCamelCASE
* [7de3c12](https://github.com/hyperledger/fabric-chaincode-node/commit/7de3c12) Bump version to 2.2.1 (#184)

## v2.2.0
Thu 2 Jul 11:40:02 BST 2020

* [0f1b616](https://github.com/hyperledger/fabric-chaincode-node/commit/0f1b616) [FABCN-421](https://jira.hyperledger.org/browse/FABCN-421) release: 2.2.0 LTS release
* [9f30e90](https://github.com/hyperledger/fabric-chaincode-node/commit/9f30e90) Use Official CouchDB 3.1 Image (#180)
* [eeca625](https://github.com/hyperledger/fabric-chaincode-node/commit/eeca625) [FABCN-420](https://jira.hyperledger.org/browse/FABCN-420) Remove Azure pipeline warnings (#177)
* [cc7fee7](https://github.com/hyperledger/fabric-chaincode-node/commit/cc7fee7) [FABCN-319](https://jira.hyperledger.org/browse/FABCN-319) Update dependnency versions (#176)
* [8966eed](https://github.com/hyperledger/fabric-chaincode-node/commit/8966eed) [FABCN-393](https://jira.hyperledger.org/browse/FABCN-393) Fix broken links in documents (#169)

## v2.1.4
Mon 22 Jun 2020 14:51:02 BST

* [81e1123](https://github.com/hyperledger/fabric-chaincode-node/commit/81e1123) Specify exact version of winston dependency

## v2.1.3
Fri 19 Jun 15:26:50 BST 2020

* [cb4afae](https://github.com/hyperledger/fabric-chaincode-node/commit/cb4afae) [FABCN-410](https://jira.hyperledger.org/browse/FABCN-410) Use new lifecycle for fv/e2e tests (#160)
* [e02abf4](https://github.com/hyperledger/fabric-chaincode-node/commit/e02abf4) [FABCN-407](https://jira.hyperledger.org/browse/FABCN-407) Update protos (#154) (#157)
* [f4643f4](https://github.com/hyperledger/fabric-chaincode-node/commit/f4643f4) [FABCN-405](https://jira.hyperledger.org/browse/FABCN-405) Fix tutorial reference (#150) (#152)
* [c1979e3](https://github.com/hyperledger/fabric-chaincode-node/commit/c1979e3) Bump version to 2.1.3 (#149)

## v2.1.2
Mon 18 May 2020 17:06:23 BST

* [3d3264d](https://github.com/hyperledger/fabric-chaincode-node/commit/3d3264d) Fix broken tutorials link (#137) (#138)
* [ac5b009](https://github.com/hyperledger/fabric-chaincode-node/commit/ac5b009) [FABCN-401](https://jira.hyperledger.org/browse/FABCN-401) Correct use of Yargs api (#145)
* [a81935a](https://github.com/hyperledger/fabric-chaincode-node/commit/a81935a) [FABCN-395](https://jira.hyperledger.org/browse/FABCN-395): Use @grpc/grpc-js for Node.js chaincode (#143) (#144)
* [8de8a6e](https://github.com/hyperledger/fabric-chaincode-node/commit/8de8a6e) [FABCN-396](https://jira.hyperledger.org/browse/FABCN-396) Add notes on minimum 1.4 module version for node 12 (#139)
* [00fab0a](https://github.com/hyperledger/fabric-chaincode-node/commit/00fab0a) [FABCN-397](https://jira.hyperledger.org/browse/FABCN-397) State queries limited to 100 results (#141)
* [b1f992d](https://github.com/hyperledger/fabric-chaincode-node/commit/b1f992d) Bump version (#134)

## v2.1.1
Wed 22 Apr 2020 10:31:05 BST

* [3e67b8c](https://github.com/hyperledger/fabric-chaincode-node/commit/3e67b8c) [FABCN-394](https://jira.hyperledger.org/browse/FABCN-394) Update typescript interface file (#128)
* [61c253a](https://github.com/hyperledger/fabric-chaincode-node/commit/61c253a) [FABCN-391](https://jira.hyperledger.org/browse/FABCN-391) fix directory for api doc publish (#125)
* [c753261](https://github.com/hyperledger/fabric-chaincode-node/commit/c753261) [FABCN-391](https://jira.hyperledger.org/browse/FABCN-391) Bump to 2.1.1 and fix docker tag (#122)

## v2.1.0
Wed 1 Apr 2020 16:12:36 BST

* [644213a](https://github.com/hyperledger/fabric-chaincode-node/commit/644213a) [FABCN-391](https://jira.hyperledger.org/browse/FABCN-391) Remove references to 2.0 and 2.0.0 - replace with 2.x
* [de8c29c](https://github.com/hyperledger/fabric-chaincode-node/commit/de8c29c) [FABCN-241](https://jira.hyperledger.org/browse/FABCN-241) Change to.be.ok test calls
* [a3ff93c](https://github.com/hyperledger/fabric-chaincode-node/commit/a3ff93c) Add readme to redirect to site
* [659d36d](https://github.com/hyperledger/fabric-chaincode-node/commit/659d36d) Improve build reliability
* [d62ecae](https://github.com/hyperledger/fabric-chaincode-node/commit/d62ecae) [FABCN-373](https://jira.hyperledger.org/browse/FABCN-373) Compatibility Matrix
* [c09385c](https://github.com/hyperledger/fabric-chaincode-node/commit/c09385c) [FABCN-391](https://jira.hyperledger.org/browse/FABCN-391) Use version 2.1 of fabric docker images
* [78f8cf8](https://github.com/hyperledger/fabric-chaincode-node/commit/78f8cf8) Expand node engine version range
* [c9e9e5b](https://github.com/hyperledger/fabric-chaincode-node/commit/c9e9e5b) Update audit level
* [dd51dfa](https://github.com/hyperledger/fabric-chaincode-node/commit/dd51dfa) [FABCN-381](https://jira.hyperledger.org/browse/FABCN-381) Access localmspid

## v2.0.0
Wed 22 Jan 2020 16:03:50 GMT

* [869f107](https://github.com/hyperledger/fabric-chaincode-node/commit/869f107) [FABCI-482](https://jira.hyperledger.org/browse/FABCI-482) Update Nexus URL's to Artifactory
* [6ef0042](https://github.com/hyperledger/fabric-chaincode-node/commit/6ef0042) [FABCI-482](https://jira.hyperledger.org/browse/FABCI-482) Update Nexus URL's to Artifactory
* [b296d0a](https://github.com/hyperledger/fabric-chaincode-node/commit/b296d0a) [FABCN-241](https://jira.hyperledger.org/browse/FABCN-241) - Remove to.be.ok (#55)
* [b345925](https://github.com/hyperledger/fabric-chaincode-node/commit/b345925) Update maintainers list
* [81eb5a9](https://github.com/hyperledger/fabric-chaincode-node/commit/81eb5a9) Update rush node.js version (#54)
Expand Down
30 changes: 15 additions & 15 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Github is used for code base management, issues should reported in the [FABCN](h

## Summary of Compatibility

This table shows the summary of the compatibility of the Node modules at versions 1.4 and 2.0, together with the Nodejs runtime they require and the Fabric Peer versions they can communicate with.
This table shows the summary of the compatibility of the Node modules at versions 1.4 and 2.x, together with the Nodejs runtime they require and the Fabric Peer versions they can communicate with.

| | Peer Connectivity v1.4 | NodeJS 8 | Peer Connectivity v2.0 | NodeJS12 |
| ----------------------- | ---------------------- | -------- | ---------------------- | -------- |
| Node modules **v1.4.5** | Yes | Yes | Yes | Yes |
| Node modules **v2.1.x** | Yes | No | Yes | Yes |
| | Peer Connectivity v1.4 | NodeJS | Peer Connectivity v2.x |
| ----------------------- | ---------------------- | ------ | ---------------------- |
| Node modules **v1.4.5** | Yes | 8 | Yes |
| Node modules **v2.x.x** | Yes | 12 | Yes |

By default a Fabric Peer v1.4 will create a Nodejs v8 , and a Fabric Peer v2.0 will create a Nodejs v12 runtime. Whilst is the default, the docker image used to host the chaincode and contracts can be altered. Set the environment variable `CORE_CHAINCODE_NODE_RUNTIME` on the peer to the name of the docker image.
By default a Fabric Peer v1.4 will create a Nodejs v8 runtime, and a Fabric Peer v2.x will create a Nodejs 12 runtime. Whilst this is the default, the docker image used to host the chaincode and contracts can be altered. Set the environment variable `CORE_CHAINCODE_NODE_RUNTIME` on the peer to the name of the docker image.

For example `CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-nodeenv:2.1` will allow the latest Node 12 runtime to be used within a Peer v1.4.
For example `CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-nodeenv:2.1` will allow the use of the latest Node 12 runtime to be used within a Peer v1.4.

The Node modules will connect to the peer whilst running; this is referred to as 'Fabric Peer Connectivity' in the table. For example, whilst the Fabric Peer v1.4 will create a Nodejs 8 runtime, if a Nodejs 12 runtime was configured, the node modules at v2.x still function when connecting to the Fabric Peer v1.4.

Expand All @@ -26,30 +26,30 @@ The key elements are : 

- the version of the Fabric Contract Node modules used
- the version of the Nodejs runtime used to run the code
- When starting a chaincode container to run a Smart Contract the version of the runtime that is used is determined by these factors:
- When starting a chaincode container to run a Smart Contract, the version of the runtime that is used is determined by these factors:

Fabric v1.4.2, and Fabric v2.0.0 will, by default, start up docker image to host the chaincode and contracts. The version of the docker image used is defined by the version of Fabric in use.
Fabric v1.4.2, and Fabric v2.x will, by default, start up docker image to host the chaincode and contracts. The version of the docker image used is defined by the version of Fabric in use.

With Fabric v2.0.0, the chaincode container can be configured to be started by other means, and not the Peer. In this case, the environment used is not in the control of Fabric.
With Fabric v2.x, the chaincode container can be configured to be started by other means, and not the Peer. In this case, the environment used is not in the control of Fabric.

Node modules that are produced are `fabric-contract-api`, `fabric-shim`, `fabric-shim-crypto` & `fabric-shim-api`

### Supported Runtimes

v1.4.x and v2.0.0 Node modules are supported running in Nodejs 12.13 with the x86_64 architecture. Later Nodejs 12 versions are supported but are not tested.
v2.x Node modules are supported running in Nodejs 12.16.1, with the x86_64 architecture.

v1.4.x Node modules are supported running Nodejs 8.16.1 with the  x86_64 architecture. Later Nodejs 8 versions are supported but are not tested.
v1.4.x Node modules are supported running Nodejs 8.16.1 with the x86_64 architecture.

Architecture Support: all docker images, runtimes, tools are tested under x86_64 ONLY

### Default Peer Runtime selection

When using Fabric 2.0.0, the default docker image that is used to run the Node chaincode is node:12.13.0-alpine 
When using Fabric 2.x, the default docker image that is used to run the Node chaincode is node:12.16.1-alpine 

*Note:* With the default docker image used by Fabric 2.0.0 the packaged code will be installed with npm. If a `package-lock.json` or a `npm-shrinkwrap.json` file is present, `npm ci --only=production` will be used. Otherwise `npm install --production` will be used. 
*Note:* With the default docker image used by Fabric 2.x, the packaged code will be installed with npm. If a `package-lock.json` or a `npm-shrinkwrap.json` file is present, `npm ci --only=production` will be used. Otherwise `npm install --production` will be used. 

When using Fabric 1.4.4, the docker image that is used to run the Node chaincode is node v8.16.1. It is installed with npm install --production

### Supported Runtime communication with the Peer

Subject to a suitable runtime environment, the 1.4.4 Node modules and 2.0.0 Node modules can used to communicate with a Fabric 2.0.0 or 1.4.4 Peer - with the level of functionality that is implied by the Fabric version in use. 
Subject to a suitable runtime environment, the 1.4.4 Node modules and 2.x Node modules can be used to communicate with a Fabric 2.x or 1.4.4 Peer - with the level of functionality that is implied by the Fabric version in use. 
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following [Rush categories](https://rushjs.io/pages/maintainer/add_to_repo/)

### Pre-requisites

* node v10.15.2 (npm v6.4.1) => recommend to use [nvm](https://github.com/nvm-sh/nvm)
* node v12.16.1 (npm v6.4.1) => recommend to use [nvm](https://github.com/nvm-sh/nvm)
* rush => `npm install -g @microsoft/rush`

> Note that npm v6 has some bugs that mean adding new dependencies etc are not properly picked up. Longer term we should consider moving to yarn or pnpm. However in practice this isn't a serious problem and has been possible to be worked around by issuing `rm ./common/config/rush/npm-shrinkwrap.json` and then `rush update`
Expand All @@ -33,7 +33,7 @@ They also need to have the `nodeenv` image present - this is build as part of th

## Using the repo

* Clone the repo, and ensure you are using node v10, and have rush installed
* Clone the repo, and ensure you are using node v12, and have rush installed
* `rush update` is needed to ensure everything is correctly linked and updated.
* `rush edge-docker` will pull down and tag the very latest docker images for the peers, orderes etc to test against

Expand Down
8 changes: 4 additions & 4 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The dependencies of `fabric-contract-api` and `fabric-shim` will be required.
"name": "chaincode",
"description": "My first exciting chaincode implemented in node.js",
"engines": {
"node": ">=8.4.0",
"npm": ">=5.3.0"
"node": "^12.13.0",
"npm": "^6.13.4"
},
"scripts": {
"test":"mocha.....
Expand All @@ -28,8 +28,8 @@ The dependencies of `fabric-contract-api` and `fabric-shim` will be required.
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-contract-api": "^1.4.0",
"fabric-shim": "^1.4.0"
"fabric-contract-api": "^2.3.1-unstable",
"fabric-shim": "^2.3.1-unstable"
}
}
Expand Down
6 changes: 3 additions & 3 deletions apis/fabric-contract-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

[![Version](https://badge.fury.io/js/fabric-shim.svg)](http://badge.fury.io/js/fabric-shim)

The `fabric-contract-api` provides the *contract interface* a high level API for application developers to implement [Smart Contracts](https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html#smart-contract). Working with this API provides a high level entry point to writing business logic.
The `fabric-contract-api` provides the *contract interface* a high level API for application developers to implement [Smart Contracts](https://hyperledger-fabric.readthedocs.io/en/release-2.1/glossary.html#smart-contract). Working with this API provides a high level entry point to writing business logic.

Within Hyperledger Fabric, Smart Contracts can also be referred to as [Chaincode](https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html#chaincode). To be more specific, the term chaincode is preferred to be used to refer to the overall container that is hosting the contracts.
Within Hyperledger Fabric, Smart Contracts can also be referred to as [Chaincode](https://hyperledger-fabric.readthedocs.io/en/release-2.1/glossary.html#chaincode). To be more specific, the term chaincode is preferred to be used to refer to the overall container that is hosting the contracts.

The `fabric-shim` provides the *chaincode interface*, a lower level API for implementing "Smart Contracts". It also _currently_ provides the implementation to support communication with Hyperledger Fabric peers for Smart Contracts written using the `fabric-contract-api`. To confirm that this is the same as the `fabric-shim` in previous versions of Hyperledger Fabric.

Expand Down Expand Up @@ -129,7 +129,7 @@ Visit [API Reference](https://hyperledger.github.io/fabric-chaincode-node/master


## Support
Tested with node.js 8.9, and also the v10 LTS release.
Tested with Node v12 LTS release.

## License

Expand Down
8 changes: 4 additions & 4 deletions apis/fabric-contract-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fabric-contract-api",
"version": "3.0.0-unstable",
"version": "2.3.1-unstable",
"tag": "unstable",
"description": "A node.js implementation of Hyperledger Fabric chaincode shim, to allow endorsing peers and user-provided chaincodes to communicate with each other",
"main": "index.js",
Expand Down Expand Up @@ -46,7 +46,7 @@
"lines": 100
},
"dependencies": {
"fabric-shim-api": "3.0.0-unstable",
"fabric-shim-api": "2.3.1-unstable",
"class-transformer": "^0.3.1",
"fast-safe-stringify": "^2.0.7",
"get-params": "^0.1.2",
Expand All @@ -56,10 +56,10 @@
"devDependencies": {
"ajv": "^6.12.2",
"ajv-cli": "^3.2.1",
"chai": "^4.1.1",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai-things": "^0.2.0",
"eslint": "6.6.0",
"eslint": "^6.6.0",
"gulp": "^4.0.0",
"gulp-debug": "~4.0.0",
"gulp-eslint": "~6.0.0",
Expand Down
6 changes: 3 additions & 3 deletions apis/fabric-shim-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fabric-shim-api",
"version": "3.0.0-unstable",
"version": "2.3.1-unstable",
"tag": "unstable",
"description": "A node.js API of Hyperledger Fabric chaincode shim, to allow endorsing peers and user-provided chaincodes to communicate with each other",
"main": "index.js",
Expand All @@ -19,11 +19,11 @@
"engines": {
"node": "^12.13.0",
"npm": "^6.4.1",
"eslint": "6.6.0"
"eslint": "^6.6.0"
},
"types": "./types/index.d.ts",
"license": "Apache-2.0",
"devDependencies": {
"@types/long": "^4.0.1"
}
}
}

0 comments on commit 1cdb585

Please sign in to comment.