Skip to content

Commit b4434a2

Browse files
authored
Merge pull request #94 from heatherlp/masterCommits
FABCJ-283 Cherry pick useful commits from master
2 parents 72e6f78 + 071e022 commit b4434a2

File tree

7 files changed

+65
-4
lines changed

7 files changed

+65
-4
lines changed

COMPATIBILITY.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Support and Compatibility for fabric-chaincode-java
2+
3+
Github is used for code base management, issues should reported in the [FABCJ](https://jira.hyperledger.org/projects/FABCJ/issues/) component in JIRA.
4+
5+
6+
## Summary of Compatibility
7+
8+
This table shows the summary of the compatibility of the Java libraries at versions 1.4 and 2.0, together with the JVM version they require and the Fabric Peer versions they can communicate with.
9+
10+
| | Fabric Peer v1.4 connectivity | Java 8 VM | Fabric Peer v2.0 Connectivity | Java 11 VM |
11+
| ----------------------- | ----------------------------- | --------- | ----------------------------- | ---------- |
12+
| Java libraries **v1.4** | Yes | Yes | Yes | Yes |
13+
| Java libraries **v2.0** | Yes | No | Yes | Yes |
14+
15+
Testing is performed with
16+
- Java v8: Openjdk version 1.8.0_222
17+
- Java v11: Openjdk version 11.04_11
18+
19+
By default a Fabric Peer v1.4 will create a Java 8 VM, and a Fabric Peer v2.0 will create a Java 11 VM. Whilst is the default, the docker image used to host the chaincode and contracts can be altered. Set the environment variable `CORE_CHAINCODE_JAVA_RUNTIME` on the peer to the name of the docker image. For example `CORE_CHAINCODE_JAVA_RUNTIME=example/customJavaRuntime:latest`
20+
21+
The Java Libraries 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 Java 8 environment, if a Java 11 environment was configured, the Java Libraries at v2.0.0 still function when connecting to the Fabric Peer v1.4.
22+
23+
## Compatibility
24+
25+
The key elements are : 
26+
27+
- the version of the Fabric Contract Java libraries used
28+
- the version of the JVM used to run the code
29+
- When starting a chaincode container to run a Smart Contract the version of the runtime that is used is determined by these factors:
30+
31+
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.
32+
33+
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.
34+
35+
The Java libraries are produced are `group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim'`
36+
37+
### Supported JVMs
38+
39+
v1.4.x and v2.0.0 Java Libraries are supported running in Java 11 with the x86_64 architecture. Later Java 11 versions are supported but are not tested.
40+
41+
v1.4.x Java Libraries are supported running in Java 8 with the  x86_64 architecture. Later Java 8 versions are supported but are not tested.
42+
43+
Architecture Support: all docker images, JVMs, tools are tested under x86_64 ONLY
44+
45+
### Default Peer Runtime selection
46+
47+
When using Fabric 2.0.0, the default docker image that is used to run the Java chaincode is *openjdk11:jdk-11.04_11-alpine*
48+
49+
With the default docker image used by Fabric 2.0.0. should the packaged Java code contains a maven or gradle build script, it will be built using Gradle 5.6.2, or Maven 3.6.2 (if both Gradle and Maven files are present Gradle is used. Gradle build files can be groovy, or kotlin. If the Gradle wrapper is present, this will used in preference to the installed version of Gradle)
50+
51+
### Supported Runtime communication with the Peer
52+
 
53+
Subject to a suitable runtime environment, the 1.4.4 and 2.0.0 Java Libraries 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
@@ -79,6 +79,10 @@ Build javaenv docker image, to have it locally.
7979
./gradlew buildImage
8080
```
8181

82+
## Compatibility
83+
84+
For details on what Java runtime and versions of Hyperledger Fabric can be used please see the [compatibility document](COMPATIBILITY.md).
85+
8286
---
8387

8488
[![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/)

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
apply plugin: 'idea'
88
apply plugin: 'eclipse-wtp'
9-
version = '2.0.2'
9+
version = '2.1.0'
1010
allprojects {
1111
repositories {
1212
mavenCentral()

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ More options can be found on the [central maven repository](https://search.maven
4040

4141
Check the [release notes](https://github.com/hyperledger/fabric-chaincode-java/releases) for the changes in each version.
4242

43+
## Compatibility
44+
45+
For details on what versions of Java and Hyperledger Fabric can be used please see the [compatibility document](COMPATIBILITY.md).
46+
4347
## Samples
4448

4549
Java chaincode samples for commercial paper and fabcar can be found in the [fabric-samples repository](https://github.com/hyperledger/fabric-samples)

fabric-chaincode-docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ task copyAllDeps(type: Copy) {
7171
task buildImage(type: DockerBuildImage) {
7272
dependsOn copyAllDeps
7373
inputDir = project.file('Dockerfile').parentFile
74-
tags = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:amd64-2.0.2', 'hyperledger/fabric-javaenv:amd64-latest']
74+
tags = ['hyperledger/fabric-javaenv', 'hyperledger/fabric-javaenv:amd64-2.1.0', 'hyperledger/fabric-javaenv:amd64-latest']
7575
}
7676

fabric-chaincode-integration-test/src/contracts/fabric-chaincode-example-sacc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repositories {
1414
}
1515

1616
dependencies {
17-
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.0.2'
17+
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.1.0'
1818
testCompile group: 'junit', name: 'junit', version: '4.12'
1919
}
2020

fabric-chaincode-integration-test/src/contracts/fabric-chaincode-example-sbe/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repositories {
1414
}
1515

1616
dependencies {
17-
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.0.2'
17+
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.1.0'
1818
testCompile group: 'junit', name: 'junit', version: '4.12'
1919
}
2020

0 commit comments

Comments
 (0)