Skip to content

Commit

Permalink
Merge pull request #105 from heatherlp/sortdocker10
Browse files Browse the repository at this point in the history
FABCN-391 Set docker images to use node 10
  • Loading branch information
mbwhite authored Mar 31, 2020
2 parents ff0962f + 1d75530 commit 6ef54eb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This table shows the summary of the compatibility of the Node modules at version
| Node modules **v1.4** | Yes | 8 | Yes |
| Node modules **v2.0** | Yes | 10 | 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. 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.0 will create a Nodejs v10 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`

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.0.0 still function when connecting to the Fabric Peer v1.4.

Expand All @@ -32,15 +32,15 @@ Node modules that are produced are `fabric-contract-api`, `fabric-shim`, `fabric

### 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.0.0 Node modules are supported running in Nodejs 10.15+, 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.0.0, the default docker image that is used to run the Node chaincode is node:10.15.2-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. 

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-chaincode-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": "^10.15.2",
"npm": "^6.4.1"
},
"scripts": {
"test":"mocha.....
Expand All @@ -28,8 +28,8 @@ The dependencies of `fabric-chaincode-api` and `fabric-shim` will be required.
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-chaincode-api": "^1.4.0",
"fabric-shim": "^1.4.0"
"fabric-chaincode-api": "2.1.0-unstable",
"fabric-shim": "2.1.0-unstable"
}
}
Expand Down
2 changes: 1 addition & 1 deletion docker/fabric-nodeenv/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
ARG NODE_VER=12.13.0
ARG NODE_VER=10.15.2
FROM node:${NODE_VER}-alpine
RUN apk add --no-cache \
make \
Expand Down
2 changes: 1 addition & 1 deletion docker/fabric-nodeenv/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const util = require('util');
const { shell: runcmds } = require('toolchain');

const version = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'))).version;
const node_version = process.env.NODE_VERSION || '12.9.1';
const node_version = process.env.NODE_VERSION || '10.15.2';
const build_dir = path.join(__dirname);
const tag = version + '-' + git.short();

Expand Down
4 changes: 2 additions & 2 deletions docs/_jsdoc/tutorials/using-chaincodeinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Finally, update the "start" script in package.json to "node mychaincode.js":
"version": "1.0.0",
"description": "My first exciting chaincode implemented in node.js",
"engines": {
"node": ">=8.4.0",
"npm": ">=5.3.0"
"node": "^10.15.2",
"npm": "^6.4.1"
},
"scripts": { "start" : "node mychaincode.js" },
"engine-strict": true,
Expand Down
8 changes: 4 additions & 4 deletions docs/_jsdoc/tutorials/using-contractinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The dependencies of `fabric-chaincode-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": "^10.15.2",
"npm": "^6.4.1"
},
"scripts": {
"test":"mocha.....
Expand All @@ -28,8 +28,8 @@ The dependencies of `fabric-chaincode-api` and `fabric-shim` will be required.
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-chaincode-api": "^1.4.0",
"fabric-shim": "^1.4.0"
"fabric-chaincode-api": "2.1.0-unstable",
"fabric-shim": "2.1.0-unstable"
}
}
Expand Down

0 comments on commit 6ef54eb

Please sign in to comment.