Skip to content

Commit

Permalink
Prepare v2.0.0-beta.1
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Change-Id: I1e77b81ea9488047f1ba64f6ee222c054fc573dc
  • Loading branch information
mbwhite committed Dec 12, 2019
1 parent 8fb3172 commit bd518a0
Show file tree
Hide file tree
Showing 23 changed files with 134 additions and 57 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Please visit the [contributors guide](http://hyperledger-fabric.readthedocs.io/e

## Folder Structure

This repo is structured as a monorepo using [Rush](https://rushjs.io/). Why a monorepo? There are multiple npm modules that are published from this repo, including end to end tests, and tooling. It is siginficant easier to manager within one repo - and Rush has proven to provide excellent support for management of issues such as different dependency versions.
This repo is structured as a monorepo using [Rush](https://rushjs.io/). Why a monorepo? There are multiple npm modules that are published from this repo, including end to end tests, and tooling. It is significantly easier to manager within one repo - and Rush has proven to provide excellent support for management of issues such as different dependency versions.

The standard Rush convetions are followed as much as possible, deviation only (currently) in publishing and broad release version control. This deviation is to fit in with the existing Hyperledger Fabric release process - and some of these features in Rush are still evolving. This current Rush configuration is also not meant to be the final configuration; we are happy to enterain changes to improve the structure
The standard Rush conventions are followed as much as possible, deviation only (currently) in publishing and broad release version control. This deviation is to fit in with the existing Hyperledger Fabric release process - and some of these features in Rush are still evolving. This current Rush configuration is also not meant to be the final configuration; we are happy to entertain changes to improve the structure

### Categories

Expand Down Expand Up @@ -59,7 +59,7 @@ To clean up docker

## Mechanics of Contributing

The codebase is maintained in [github](https://github.com/hyperledger/fabric-chaincode-node), with a CI pileline run with [Azure Devlops](https://dev.azure.com/Hyperledger/Fabric-Chaincode-Node/_build?definitionId=33&_a=summary). Issues are handling in [Jira](https://jira.hyperledger.org/issues/?jql=project%20%3D%20FAB%20AND%20component%20%3D%20fabric-chaincode-node) (please use the component `fabric-chaincode-node` in jira as this is shared project with other Fabric components).
The codebase is maintained in [github](https://github.com/hyperledger/fabric-chaincode-node), with a CI pipeline run with [Azure Devlops](https://dev.azure.com/Hyperledger/Fabric-Chaincode-Node/_build?definitionId=33&_a=summary). Issues are handling in [Jira](https://jira.hyperledger.org/issues/?jql=project%20%3D%20FAB%20AND%20component%20%3D%20fabric-chaincode-node) (please use the component `fabric-chaincode-node` in jira as this is shared project with other Fabric components).



Expand Down
6 changes: 3 additions & 3 deletions apis/fabric-contract-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fabric-contract-api",
"version": "2.0.0-snapshot",
"tag": "unstable",
"version": "2.0.0-beta.1",
"tag": "beta",
"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",
"repository": {
Expand Down Expand Up @@ -46,7 +46,7 @@
"lines": 100
},
"dependencies": {
"fabric-shim-api": "2.0.0-snapshot",
"fabric-shim-api": "2.0.0-beta.1",
"class-transformer": "^0.2.2",
"fast-safe-stringify": "~2.0.7",
"get-params": "^0.1.2",
Expand Down
4 changes: 2 additions & 2 deletions apis/fabric-shim-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fabric-shim-api",
"version": "2.0.0-snapshot",
"tag": "unstable",
"version": "2.0.0-beta.1",
"tag": "beta",
"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",
"repository": {
Expand Down
38 changes: 27 additions & 11 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ stages:
# output some basic information for reference
- job: displayenv
steps:
- script: |
env | sort
- template: templates/build-data.yaml
- job: main
displayName: 'Build, lint, UT'
steps:
Expand Down Expand Up @@ -222,15 +221,6 @@ stages:
dependsOn: Build_and_Test
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
jobs:
- job: update_version
steps:
- script: |
env | sort
echo "Update the version number"
VERSION=$(jq '.version' $(Build.SourcesDirectory)/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9]\.[0-9]?[0-9]).*/\1/")
echo Version is :${VERSION}:
echo "Make sure release notes are present"
echo "Make sure change history is present"
- job: npm_publish
displayName: 'npm publish'
steps:
Expand Down Expand Up @@ -260,3 +250,29 @@ stages:
set -ev
echo "checkout docs branch"
echo "checking"
- job: dockerhub_publish
steps:
- template: templates/build-data.yaml
- task: DownloadPipelineArtifact@2
inputs:
artifact: nodeenv-docker-image
path: $(Build.SourcesDirectory)/build

- script: |
wget -qO "$PWD/manifest-tool" https://github.com/estesp/manifest-tool/releases/download/v1.0.0/manifest-tool-linux-amd64
chmod +x ./manifest-tool
docker image load --input build/fabric-nodeenv.tar.gz
docker images
# Publish docker images to nexus repository
docker login ${DOCKER_REGISTRY_URL} --username=${DOCKER_REGISTRY_USERNAME} --password=${DOCKER_REGISTRY_PASSWORD}
echo "Logged in to docker registry"
# tag nodeenv image to PACKAGE_VERSION
docker tag hyperledger/fabric-nodeenv fabric-nodeenv:amd64-$(BuildData.PACKAGE_VERSION)-beta
# push nodeenv to repository
docker push hyperledger/fabric-nodeenv:amd64-$(BuildData.PACKAGE_VERSION)-beta
./manifest-tool push from-args --platforms linux/amd64 --template "hyperledger/fabric-nodeenv:amd64-$(BuildData.PACKAGE_VERSION)-beta" --target "hyperledger/fabric-nodeenv:$(BuildData.PACKAGE_VERSION)-beta"
./manifest-tool push from-args --platforms linux/amd64 --template "hyperledger/fabric-nodeenv:amd64-$(BuildData.PACKAGE_VERSION)-beta" --target "hyperledger/fabric-nodeenv:2.0"
env:
DOCKER_REGISTRY_USERNAME: $(DockerHub-Username)
DOCKER_REGISTRY_PASSWORD: $(DockerHub-Password)
4 changes: 2 additions & 2 deletions ci/scripts/publish_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ docker image load --input build/fabric-nodeenv.tar.gz # gets the build i
docker images

docker login nexus3.hyperledger.org:10003 --username="${NEXUS_USERNAME}" --password="${NEXUS_PASSWORD}"
docker tag hyperledger/fabric-nodeenv "${NEXUS_URL}/fabric-nodeenv:amd64-latest"
docker push "${NEXUS_URL}/fabric-nodeenv:amd64-latest"
docker tag hyperledger/fabric-nodeenv "${NEXUS_URL}/fabric-nodeenv:amd64-2.0.0-beta"
docker push "${NEXUS_URL}/fabric-nodeenv:amd64-2.0.0-beta"
8 changes: 8 additions & 0 deletions ci/templates/build-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
steps:
- script: |
env | sort
VERSION=$(jq '.version' $(Build.SourcesDirectory)/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9]\.[0-9]?[0-9]).*/\1/")
echo Current version in code is :${VERSION}:
echo "##vso[task.setvariable variable=PACKAGE_VERSION;isOutput=true]${VERSION}"
name: BuildData
displayName: 'Build data'
4 changes: 2 additions & 2 deletions docs/apidocs/tutorials/using-chaincodeinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd mycc
// create a new node project
npm init
// install fabric-shim at master branch
npm install fabric-shim@unstable
npm install 2.0.0-beta.1
// or using the released version
npm install fabric-shim
touch mychaincode.js
Expand Down Expand Up @@ -68,7 +68,7 @@ Finally, update the "start" script in package.json to "node mychaincode.js":
"engineStrict": true,
"license": "Apache-2.0",
"dependencies": {
"fabric-shim": "unstable"
"fabric-shim": "2.0.0-beta.1"
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions libraries/fabric-shim-crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fabric-shim-crypto",
"version": "2.0.0-snapshot",
"tag": "unstable",
"version": "2.0.0-beta.1",
"tag": "beta",
"description": "A node.js implementation of encryption library for Hyperledger Fabric chaincode shim",
"main": "index.js",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions libraries/fabric-shim/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fabric-shim",
"version": "2.0.0-snapshot",
"tag": "unstable",
"version": "2.0.0-beta.1",
"tag": "beta",
"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",
"bin": {
Expand Down Expand Up @@ -61,8 +61,8 @@
"@grpc/proto-loader": "^0.5.1",
"@types/node": "^8.9.4",
"ajv": "^6.5.5",
"fabric-contract-api": "2.0.0-snapshot",
"fabric-shim-api": "2.0.0-snapshot",
"fabric-contract-api": "2.0.0-beta.1",
"fabric-shim-api": "2.0.0-beta.1",
"fs-extra": "8.1.0",
"grpc": "^1.23.3",
"reflect-metadata": "^0.1.12",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fabric-shim-test",
"version": "2.0.0-snapshot",
"tag": "unstable",
"version": "2.0.0-beta.1",
"tag": "beta",
"description": "fabric-shim, fabric-shim-crypto",
"testFabricVersion": "master",
"testFabricThirdParty": "0.4.15",
Expand Down
53 changes: 53 additions & 0 deletions release_notes/v2.0.0-beta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
v2.0.0-beta, 12 December 2019
-----------------------------

Release Notes
-------------
The main change in the v2.0.0 beta is the level of NodeJS runtime has moved up to the latest LTS version of v12.13.0
v2.0.0 beta has the fixes from v1.4.4 level.

Migration Notes
---------------
Note that a change needed to be made to the metadata schema as it was in error; it had diverged from the JSONSchema standard
so that it was not possible to validate complex objects.

If you have custom metadata defined in the contract, then for the complex objects defined in the 'components' section
the properties of this object where previously held as array; they now need to be held as a map with the key as the name
of the property

Return types on functions where returned as an array of schema objects. this has been modified to be a single object. i.e.
the single value array is now just a single value.

There is also a new nodeenv docker image that is used for hosting the chaincode rather than use the baseos image as in V1.4

In v1.4, the fabric-contract-api had a dependency on the fabric-shim. This has changed in this version to have a dependency
on the new fabric-shim-api module. This allows the fabric-contract-api to be used client side for annotations.

For contributors, the v2.0.0 repo is built using rush and is organized as a full mono-repo.

The @Object annotation has been deprecated in favour of the @DataType annotation

The x509 library used for parsing has changed; this should be parse the X509 certificates exactly the same way; this is a note that
differences are observed in the parsed certificates please raise an issue.

Summary of the programming model
-------------------------------

This is designed to improve developer productivity and ease of use.
For more information see https://hyperledger-fabric.readthedocs.io/en/developapps/developing_applications.html

Known Vulnerabilities
---------------------
none

Resolved Vulnerabilities
------------------------
none

Known Issues & Workarounds
--------------------------
none

Change Log
----------
https://github.com/hyperledger/fabric-chaincode-node/blob/release-1.4/CHANGELOG.md#v141
4 changes: 2 additions & 2 deletions test/chaincodes/annotations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"author": "",
"license": "APACHE-2.0",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable",
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1",
"@types/node": "^10.3.6",
"ts-node": "^3.3.0",
"tslint": "^5.6.0",
Expand Down
4 changes: 2 additions & 2 deletions test/chaincodes/clientidentity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
4 changes: 2 additions & 2 deletions test/chaincodes/crosschaincode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
4 changes: 2 additions & 2 deletions test/chaincodes/crosschaincode2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
4 changes: 2 additions & 2 deletions test/chaincodes/crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
6 changes: 3 additions & 3 deletions test/chaincodes/encryption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable",
"fabric-shim-crypto": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1",
"fabric-shim-crypto": "2.0.0-beta.1"
}
}
4 changes: 2 additions & 2 deletions test/chaincodes/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
4 changes: 2 additions & 2 deletions test/chaincodes/query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
4 changes: 2 additions & 2 deletions test/chaincodes/scenario/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"fabric-shim": "unstable",
"fabric-contract-api": "unstable"
"fabric-shim": "2.0.0-beta.1",
"fabric-contract-api": "2.0.0-beta.1"
}
}
10 changes: 5 additions & 5 deletions test/fv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fvtests",
"version": "2.0.0-snapshot",
"version": "2.0.0-beta.1",
"description": "fv tests",
"testFabricVersion": "master",
"testFabricThirdParty": "0.4.15",
Expand All @@ -26,10 +26,10 @@
"del": "^3.0.0",
"delay": "4.3.0",
"eslint": "6.6.0",
"fabric-contract-api": "2.0.0-snapshot",
"fabric-shim": "2.0.0-snapshot",
"fabric-shim-api": "2.0.0-snapshot",
"fabric-shim-crypto": "2.0.0-snapshot",
"fabric-contract-api": "2.0.0-beta.1",
"fabric-shim": "2.0.0-beta.1",
"fabric-shim-api": "2.0.0-beta.1",
"fabric-shim-crypto": "2.0.0-beta.1",
"fs-extra": "8.1.0",
"git-rev-sync": "1.12.0",
"gulp": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ elif [[ ${NEW_SUFFIX} == 'snapshot' ]]; then
echo new suffix is ${NEW_SUFFIX}
CURRENT_VERSION=$(jq '.version' ${DIR}/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9]\.[0-9]?[0-9])(.)*/\1/")
NEW_VERSION=$( ${DIR}/node_modules/.bin/semver -i ${CURRENT_VERSION} )-snapshot
NEW_TAG="unstable-1.4"
NEW_TAG="2.0.0-beta.1-1.4"
else # for beta, rc etc releases where the version doesn't change
echo new suffix is ${NEW_SUFFIX}
NEW_VERSION=$(jq '.version' ${DIR}/package.json | sed -r "s/\"([0-9]?[0-9]\.[0-9]?[0-9]\.[0-9]?[0-9])(.)*/\1-${NEW_SUFFIX}/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ services:
# # bridge network as the peers
# # https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=node_default
- CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-nodeenv:2.0.0-snapshot
- CORE_CHAINCODE_NODE_RUNTIME=hyperledger/fabric-nodeenv:2.0.0-beta.1
# Allow more time for chaincode container to build on install.
- CORE_CHAINCODE_EXECUTETIMEOUT=300s
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
Expand Down

0 comments on commit bd518a0

Please sign in to comment.