Skip to content

Commit b6c5b56

Browse files
committed
[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
1 parent 2ee7246 commit b6c5b56

18 files changed

Lines changed: 73 additions & 30 deletions

File tree

COMPATIBILITY.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Support and Compatibility for fabric-chaincode-java
2+
3+
Github is used for code base management, issues should reported in the [FABCN](https://jira.hyperledger.org/projects/FABCN/issues/) component in JIRA.
4+
5+
6+
## Summary of Compatibility
7+
8+
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.
9+
10+
| | Peer Connectivity v1.4 | NodeJS 8 | Peer Connectivity v2.0 | NodeJS12 |
11+
| --------------------- | ---------------------- | -------- | ---------------------- | -------- |
12+
| Node modules **v1.4** | Yes | Yes | Yes | Yes |
13+
| Node modules **v2.0** | Yes | No | Yes | Yes |
14+
15+
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. For example `CORE_CHAINCODE_NODE_RUNTIME=example/customNodeRuntime:latest`
16+
17+
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 fruntime, if a Nodejs 12 runtime was configured, the Node modules at v2.0.0 still function when connecting to the Fabric Peer v1.4.
18+
19+
## Compatibility
20+
21+
The key elements are : 
22+
23+
- the version of the Fabric Contract Node modules used
24+
- the version of the Nodejs runtime used to run the code
25+
- When starting a chaincode container to run a Smart Contract the version of the runtime that is used is determined by these factors:
26+
27+
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.
28+
29+
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.
30+
31+
Node modules that are produced are `fabric-contract-api`, `fabric-shim`, `fabric-shim-crypto` & `fabric-shim-api`
32+
33+
### Supported Runtimes
34+
35+
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.
36+
37+
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.
38+
39+
Architecture Support: all docker images, runtimes, tools are tested under x86_64 ONLY
40+
41+
### Default Peer Runtime selection
42+
43+
When using Fabric 2.0.0, the default docker image that is used to run the Node chaincode is node:12.13.0-alpine 
44+
45+
*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. 
46+
47+
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
48+
49+
### Supported Runtime communication with the Peer
50+
 
51+
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. 

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ As an application developer, to learn about how to implement **"Smart Contracts"
3030
- docker images
3131
- [fabric-nodeenv](https://hub.docker.com/r/hyperledger/fabric-nodeenv)
3232

33+
## Compatibility
34+
35+
For details on what Nodejs runtime and versions of Hyperledger Fabric can be used please see the [compatibility document](COMPATIBILITY.md).
36+
3337
---
3438

3539
## License <a name="license"></a>

apis/fabric-contract-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Fabric Shim"
2323
],
2424
"engines": {
25-
"node": "10.15.2",
25+
"node": "^12.13.0",
2626
"npm": "^6.4.1"
2727
},
2828
"license": "Apache-2.0",

apis/fabric-shim-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Fabric Shim"
1818
],
1919
"engines": {
20-
"node": "10.15.2",
20+
"node": "^12.13.0",
2121
"npm": "^6.4.1",
2222
"eslint": "6.6.0"
2323
},

libraries/fabric-shim-crypto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"Fabric Shim"
2121
],
2222
"engines": {
23-
"node": "10.15.2",
23+
"node": "^12.13.0",
2424
"npm": "^6.4.1"
2525
},
2626
"license": "Apache-2.0",

libraries/fabric-shim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"Fabric Shim"
3030
],
3131
"engines": {
32-
"node": "10.15.2",
32+
"node": "^12.13.0",
3333
"npm": "^6.4.1"
3434
},
3535
"yargs": {

libraries/fabric-shim/test/unit/chaincode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('Chaincode', () => {
257257
expect(typeof testOpts[attr]).to.deep.equal('string');
258258

259259
const json = JSON.parse(testOpts[attr]);
260-
expect(json.name).to.deep.equal('fabric-shim-test');
260+
expect(json.name).to.deep.equal('fabric-chaincode-node');
261261
});
262262

263263
Chaincode.__set__('Handler', handlerClass);

package.json

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
{
2-
"name": "fabric-shim-test",
2+
"name": "fabric-chaincode-node",
33
"version": "2.1.0-unstable",
44
"tag": "unstable",
5-
"description": "fabric-shim, fabric-shim-crypto",
5+
"description": "fabric-chaincode-node monorepo, built with rush",
66
"testFabricVersion": "master",
77
"testFabricCAVersion": "1.4.4",
88
"testFabricThirdParty": "0.4.15",
99
"docsLatestVersion": "release-1.4",
10-
"engines": {
11-
"node": "10.15.2",
12-
"npm": "^6.4.1"
13-
},
14-
"engineStrict": true,
15-
"license": "Apache-2.0",
16-
"scripts": {
17-
},
18-
"dependencies": {
19-
},
20-
"devDependencies": {
21-
22-
}
10+
"license": "Apache-2.0"
2311
}

test/chaincodes/annotations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ts_chaincode",
33
"description": "Chaincode testing typescript functionality and annotations",
44
"engines": {
5-
"node": ">=8.4.0",
5+
"node": "^12.13.0",
66
"npm": ">=5.3.0"
77
},
88
"scripts": {

test/chaincodes/clientidentity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "chaincode",
33
"description": "Chaincode testing ClientIdentity functionality",
44
"engines": {
5-
"node": ">=8.4.0",
5+
"node": "^12.13.0",
66
"npm": ">=5.3.0"
77
},
88
"scripts": {

0 commit comments

Comments
 (0)