Skip to content

Commit

Permalink
[FABCN-396] Add notes on minimum 1.4 module version for node 12 (#139)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mbwhite authored May 7, 2020
1 parent 00fab0a commit 8de8a6e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ Github is used for code base management, issues should reported in the [FABCN](h

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 | Peer Connectivity v2.x |
| --------------------- | ---------------------- | ------ | ---------------------- |
| Node modules **v1.4** | Yes | 8 | Yes |
| Node modules **v2.x** | Yes | 12 | 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 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=example/customNodeRuntime:latest`
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 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.

Note that the `fabric-contract-api` & `fabric-shim` node modules must be at v1.4.5 or greater to work with Node version 12. If you therefore use a contract originally written to work with Fabric 1.4, check the node modules before deploying on Fabric v2.

## Compatibility

The key elements are : 
Expand Down

0 comments on commit 8de8a6e

Please sign in to comment.