Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit aa14f2e

Browse files
mastersingh24Gerrit Code Review
authored andcommitted
Merge "FAB-8961 V1.1 release notes updates."
2 parents 19dc59a + 5c41e56 commit aa14f2e

File tree

7 files changed

+186
-174
lines changed

7 files changed

+186
-174
lines changed

README.md

Lines changed: 42 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -31,47 +31,31 @@ SDK's `Enrollment` interface.
3131
<p &nbsp; />
3232

3333
`*************************************************`
34-
## *v1.1.0-alpha*
34+
## *v1.1.0*
3535

3636
## v1.1 release notes
37-
Please review the [v1.1 release notes](./docs/release_v1.1.0_notes.md) to familarize yourself with changes since v1.0 sdk release
37+
Please review the [v1.1 release notes](./docs/release_v1.1.0_notes.md) to familiarize yourself with changes since v1.0 release
3838

39-
### Git v1.1.0-alpha
40-
41-
There is a git tagged v1.1.0-alpha release of the SDK where there is no
42-
need to build the Hyperledger Fabric and Hyperledger Fabric CA described below.
43-
The provided docker-compose.yaml for the integration tests should pull v1.1.0-alpha tagged images from Docker hub.
44-
45-
The v1.1.0-alpha version of the Hyperledger Fabric Java SDK is published to Maven so you can directly use in your application's pom.xml.
46-
47-
[Maven Repository Hyperledger Fabric Java SDK](https://mvnrepository.com/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java)
48-
49-
_Make sure you're using docker images at the level of the Fabric that matches the level of the SDK you're using in your application._
50-
51-
### Using the SDK in your application
52-
53-
Add below code in your `pom.xml` to download fabric-sdk-java-1.1.0-alpha
54-
55-
```xml
56-
57-
<dependencies>
58-
<dependency>
59-
<groupId>org.hyperledger.fabric-sdk-java</groupId>
60-
<artifactId>fabric-sdk-java</artifactId>
61-
<version>1.1.0-alpha</version>
62-
</dependency>
63-
</dependencies>
64-
```
65-
66-
<p &nbsp; />
67-
<p &nbsp; />
6839

6940
`*************************************************`
7041

7142
## 1.1.0-SNAPSHOT builds
7243
Work in progress 1.1.0 SNAPSHOT builds can be used by adding the following to your application's
7344
pom.xml
7445
```
46+
<repositories>
47+
<repository>
48+
<id>snapshots-repo</id>
49+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
50+
<releases>
51+
<enabled>false</enabled>
52+
</releases>
53+
<snapshots>
54+
<enabled>true</enabled>
55+
</snapshots>
56+
</repository>
57+
</repositories>
58+
7559
<dependencies>
7660
7761
<!-- https://mvnrepository.com/artifact/org.hyperledger.fabric-sdk-java/fabric-sdk-java -->
@@ -84,111 +68,36 @@ pom.xml
8468
</dependencies>
8569
```
8670

87-
Add to your maven's setting.xml typically in the .m2 directory under your home directory:
88-
```
89-
<profiles>
90-
<profile>
91-
<id>allow-snapshots</id>
92-
<activation>
93-
<activeByDefault>true</activeByDefault>
94-
</activation>
95-
<repositories>
96-
<repository>
97-
<id>snapshots-repo</id>
98-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
99-
<releases>
100-
<enabled>false</enabled>
101-
</releases>
102-
<snapshots>
103-
<enabled>true</enabled>
104-
</snapshots>
105-
</repository>
106-
</repositories>
107-
</profile>
108-
</profiles>
109-
```
110-
111-
112-
113-
114-
11571
## Latest builds of Fabric and Fabric-ca v1.1.0
11672

117-
Hyperledger Fabric v1.1.0 is currently under active development.
118-
119-
You can clone these projects by going to the [Hyperledger repository](https://gerrit.hyperledger.org/r/#/admin/projects/).
120-
121-
## Working with the Fabric Vagrant environment
122-
Vagrant is NOT required if your OS has Docker support and all the requirements needed to build directly in your
123-
environment. For non Vagrant environment, the steps would be the same as below minus those parts involving Vagrant.
124-
Do the following if you want to run the Fabric components ( peer, orderer, fabric-ca ) in Vagrant:
125-
126-
```
127-
git clone https://github.com/hyperledger/fabric.git
128-
git clone https://github.com/hyperledger/fabric-ca.git
129-
cd fabric-ca
130-
git reset --hard fabric-ca_commitlevel from above
131-
cd ../fabric
132-
git reset --hard fabric_commitlevel from above
133-
cd devenv
134-
change the Vagrant file as suggested below:
135-
vagrant up
136-
vagrant ssh
137-
make docker
138-
cd ../fabric-ca
139-
make docker
140-
cd ../fabric/sdkintegration
141-
docker-compose down; rm -rf /var/hyperledger/*; docker-compose up --force-recreate
142-
```
143-
144-
145-
146-
* Open the file `Vagrantfile` and verify that the following `config.vm.network` statements are set. If not, then add them:
147-
```
148-
config.vm.network :forwarded_port, guest: 7050, host: 7050 # fabric orderer service
149-
config.vm.network :forwarded_port, guest: 7051, host: 7051 # fabric peer vp0 service
150-
config.vm.network :forwarded_port, guest: 7053, host: 7053 # fabric peer event service
151-
config.vm.network :forwarded_port, guest: 7054, host: 7054 # fabric-ca service
152-
config.vm.network :forwarded_port, guest: 5984, host: 15984 # CouchDB service
153-
### Below are probably missing.....
154-
config.vm.network :forwarded_port, guest: 7056, host: 7056
155-
config.vm.network :forwarded_port, guest: 7058, host: 7058
156-
config.vm.network :forwarded_port, guest: 8051, host: 8051
157-
config.vm.network :forwarded_port, guest: 8053, host: 8053
158-
config.vm.network :forwarded_port, guest: 8054, host: 8054
159-
config.vm.network :forwarded_port, guest: 8056, host: 8056
160-
config.vm.network :forwarded_port, guest: 8058, host: 8058
161-
config.vm.network :forwarded_port, guest: 7059, host: 7059
162-
163-
```
164-
165-
Add to your Vagrant file a folder for referencing the sdkintegration folder between the lines below:
166-
167-
config.vm.synced_folder "..", "/opt/gopath/src/github.com/hyperledger/fabric"</br>
73+
To get a functioning Fabric v1.1.0 network needed by the SDK Integration tests.
74+
In the directory `src/test/fixture/sdkintegration` issue :
16875

169-
`config.vm.synced_folder "/home/<<user>>/fabric-sdk-java/src/test/fixture/sdkintegration", "/opt/gopath/src/github.com/hyperledger/fabric/sdkintegration"`</br>
76+
`IMAGE_TAG_FABRIC=:x86_64-1.1.0 IMAGE_TAG_FABRIC_CA=:x86_64-1.1.0 ./fabric.sh restart`
17077

171-
config.vm.synced_folder ENV.fetch('LOCALDEVDIR', ".."), "#{LOCALDEV}"</br>
78+
This command needs to be rerun each time the Integration tests are run.
17279

80+
You can clone these projects by going to the [Hyperledger repository](https://gerrit.hyperledger.org/r/#/admin/projects/).
17381

82+
## Latest Fabric Builds.
83+
Latest Fabric builds are seldom needed except for those working on the very latest Fabric features.
84+
Some information to help with that can been found in [Developer Instructions](./docs/DeveloperInstructions.md)
17485

86+
### Setting Up Eclipse
87+
To get started using the Fabric Java SDK with Eclipse, refer to the instructions at: ./docs/EclipseSetup.md
17588

17689
## SDK dependencies
17790
SDK depends on few third party libraries that must be included in your classpath when using the JAR file. To get a list of dependencies, refer to pom.xml file or run
17891
<code>mvn dependency:tree</code> or <code>mvn dependency:list</code>.
179-
18092
Alternatively, <code> mvn dependency:analyze-report </code> will produce a report in HTML format in target directory listing all the dependencies in a more readable format.
18193

182-
## Using the SDK
183-
The SDK's test cases uses chaincode in the SDK's source tree: `/src/test/fixture`
184-
185-
The SDK's JAR is in `target/fabric-sdk-java-1.1.0-SNAPSHOT.jar` and you will need the additional dependencies listed above.
94+
To build this project, the following dependencies must be met
95+
* JDK 1.8 or above
96+
* Apache Maven 3.5.0
18697

98+
## Using the SDK
18799

188100
### Compiling
189-
To build this project, the following dependencies must be met
190-
* JDK 1.8 or above
191-
* Apache Maven
192101

193102
Once your JAVA_HOME points to your installation of JDK 1.8 (or above) and JAVA_HOME/bin and Apache maven are in your PATH, issue the following command to build the jar file:
194103
<code>
@@ -200,17 +109,16 @@ or
200109
</code> if you don't want to run the unit tests
201110

202111
### Running the unit tests
203-
To run the unit tests, please use <code>mvn test</code> or <code>mvn install</code> which will run the unit tests and build the jar file.
204-
You must be running a local peer and orderer to be able to run the unit tests.
112+
To run the unit tests, please use <code>mvn install</code> which will run the unit tests and build the jar file.
205113

206114
**Many unit tests will test failure condition's resulting in exceptions and stack traces being displayed. This is not an indication of failure!**
207115

208116
**[INFO] BUILD SUCCESS** **_At the end is usually a very reliable indication that all tests have passed successfully!_**
209117

210118
### Running the integration tests
211-
You must be running local instances of Fabric-ca, Fabric peers, and Fabric orderers to be able to run the integration tests. See above for running these services in Vagrant.
119+
You must be running local instances of Fabric-ca, Fabric peers, and Fabric orderers to be able to run the integration tests. See above for for how to get a Fabric network running.
212120
Use this `maven` command to run the integration tests:
213-
* _mvn failsafe:integration-test -DskipITs=false_
121+
* _mvn clean install -DskipITs=false -Dmaven.test.failure.ignore=false javadoc:javadoc_
214122

215123
### End to end test scenario
216124
The _src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java_ integration test is an example of installing, instantiating, invoking and querying a chaincode.
@@ -220,13 +128,9 @@ The _src/test/java/org/hyperledger/fabric/sdkintegration/End2endAndBackAgainIT.j
220128
upgrading chaincode and invoking the up graded chaincode.
221129

222130
Between End2endIT.java and End2endAndBackAgainIT.java this code shows almost all that the SDK can do.
223-
To learn the SDK you must have some understanding first of the Fabric. Then it's best to study these two integrations tests and better yet work with them in a debugger to follow the code. ( *a live demo* )
131+
To learn the SDK you must have some understanding first of the Fabric. Then it's best to study these two integrations tests and better yet work with them in a debugger to follow the code. ( *a live demo* )
224132
Then once you understand them you can cut and paste from there to your own application. ( _the code is done for you!_ )
225133

226-
227-
This test is a reworked version of the Fabric [e2e_cli example](https://github.com/hyperledger/fabric/tree/master/examples/e2e_cli) to demonstrate the features of the SDK.
228-
To better understand blockchain and Fabric concepts, we recommend you install and run the _e2e_cli_ example.
229-
230134
### End to end test environment
231135
The test defines one Fabric orderer and two organizations (peerOrg1, peerOrg2), each of which has 2 peers, one fabric-ca service.
232136

@@ -243,7 +147,7 @@ In the directory src/test/fixture/sdkintegration/e2e-2Orgs/channel
243147

244148
v1.0 ```build/bin/cryptogen generate --config crypto-config.yaml --output=crypto-config```
245149

246-
v1.1 ```cryptogen generate --config crypto-config.yaml --output=v1.1/crypto-config```
150+
v1.1 ```cryptogen generate --config crypto-config.yaml --output=v1.1/crypto-config```
247151

248152
For ease of assigning ports and mapping of artifacts to physical files, all peers, orderers, and fabric-ca are run as Docker containers controlled via a docker-compose configuration file.
249153

@@ -253,8 +157,6 @@ The files used by the end to end are:
253157
* _src/test/fixture/sdkintegration/docker-compose.yaml_
254158

255159

256-
257-
258160
The end to end test case artifacts are stored under the directory _src/test/fixture/sdkintegration/e2e-2Org/channel_ .
259161

260162
### TLS connection to Orderer and Peers
@@ -264,19 +166,16 @@ IBM Java needs the following properties defined to use TLS 1.2 to get an HTTPS c
264166
-Dcom.ibm.jsse2.overrideDefaultTLS=true -Dhttps.protocols=TLSv1.2
265167
```
266168

267-
We need certificate and key for each of the Orderer and Peers for TLS connection. You can generate your certificate and key files with openssl command as follows:
169+
Currently, the pom.xml is set to use netty-tcnative-boringssl for TLS connection to Orderer and Peers, however, you can change the pom.xml (uncomment a few lines) to use an alternative TLS connection via ALPN.
268170

269-
* Set up your own Certificate Authority (CA) for issuing certificates
270-
* For each of orderers and peers:
271-
* generate a private key: <code>openssl genrsa 512 > key.pem</code>.
272-
* generate a certificate request (csr): <code>openssl req -new -days 365 -key key.pem -out csr.pem</code>, which will request your input for some information, where CN has to be the container's alias name (e.g. peer0, peer1, etc), all others can be left blank.
273-
* sign the csr with the CA private key to generate a certificate: <code>openssl ca -days 365 -in csr.pem -keyfile {CA's privatekey} -notext -out cert.pem</code>
274-
* put the resulting cert.pem and key.pem together with the CA's certificate (as the name cacert.pem) in the directory where the docker container can access.
171+
### TLS Environment for SDK Integration Tests
172+
The SDK Integration tests can be enabled by adding before the ./fabric restart the follow as:
275173

276-
The option -notext in the last openssl command in the above is important. Without the option, the resulting cert.pemmay does not work for some Java implementation (e.g. IBM JDK).
277-
The certificates and keys for the end-to-end test case are stored in the directory _src/test/fixture/sdkintegration/e2e-2Org/tls/_.
174+
ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=--tls.enabled ./fabric.sh restart
278175

279-
Currently, the pom.xml is set to use netty-tcnative-boringssl for TLS connection to Orderer and Peers, however, you can change the pom.xml (uncomment a few lines) to use an alternative TLS connection via ALPN.
176+
Then run the Integration tests with:
177+
178+
ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true mvn clean install -DskipITs=false -Dmaven.test.failure.ignore=false javadoc:javadoc
280179

281180
### Chaincode endorsement policies
282181
Policies are described in the [Fabric Endorsement Policies document](https://gerrit.hyperledger.org/r/gitweb?p=fabric.git;a=blob;f=docs/endorsement-policies.md;h=1eecf359c12c3f7c1ddc63759a0b5f3141b07f13;hb=HEAD).
@@ -321,19 +220,14 @@ For v1.1 integration the commands use the v11 profiles in configtx.yaml.
321220
This should produce in the `v1.1` directory: bar.tx,foo.tx, orderer.block
322221

323222
**Note:** The above describes how this was done. If you redo this there are private key files
324-
which are produced with uniqe names which won't match what's expected in the integration tests.
223+
which are produced with unique names which won't match what's expected in the integration tests.
325224
One examle of this is the docker-compose.yaml (search for **_sk**)
326225

327226

328-
329-
330227
### GO Lang chaincode
331228
Go lang chaincode dependencies must be contained in vendor folder.
332229
For an explanation of this see [Vendor folder explanation](https://blog.gopheracademy.com/advent-2015/vendor-folder/)
333230

334-
### Setting Up Eclipse
335-
336-
To get started using the Fabric Java SDK with Eclipse, refer to the instructions at: ./docs/EclipseSetup.md
337231

338232
## Basic Troubleshooting
339233

config.properties

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,36 @@
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
6-
# Hyperledger Fabric member CA certificates. Used to verify chain of trust on receipt of peer messages
7-
# Note that this is temporary and will go away when the SDK can read the chain's genesis block and
8-
# set up MSP configuration from that.
9-
org.hyperledger.fabric.sdk.cacerts = /genesisblock/peercacert.pem
10-
11-
# the timeout for a single proposal request to endorser in milliseconds.
12-
org.hyperledger.fabric.sdk.proposal.wait.time = 20000
13-
14-
# Time in milliseconds to wait for genesis block
15-
org.hyperledger.fabric.sdk.channel.genesisblock_wait_time=5000
6+
## The timeout for a proposal requests to endorser in milliseconds.
7+
#org.hyperledger.fabric.sdk.proposal.wait.time = 20000
8+
## Time in milliseconds to wait for genesis block
9+
#org.hyperledger.fabric.sdk.channel.genesisblock_wait_time=5000
10+
## Time that events that are not being handled are cleaned up. This should never need to be changed.
11+
# org.hyperledger.fabric.sdk.client.transaction_cleanup_up_timeout_wait_time=600000
12+
## Time waited between some orderer reties in ms.
13+
#org.hyperledger.fabric.sdk.orderer_retry.wait_time=200
14+
## The time the peer event registration waits for first failure in ms
15+
#org.hyperledger.fabric.sdk.peer.eventRegistration.wait_time=5000
16+
## The time the event hub waits to reconnect in ms
17+
#EVENTHUB_CONNECTION_WAIT_TIME=5000
18+
## The number of unsuccessful attempts by the eventhub to reconnect before another warning is issued. Set to -1 for none.
19+
#EVENTHUB_RECONNECTION_WARNING_RATE=50
20+
## The number of unsuccessful attempts by the peer eventing service to reconnect before another warning is issued. Set to -1 for none.
21+
#PEER_EVENT_RECONNECTION_WARNING_RATE=50
22+
## The time the peer eventing service wait to retry to connect in ms.
23+
#org.hyperledger.fabric.sdk.peer.retry_wait_time=500
24+
## The time to wait get the genesis block in ms. Usually needed to join the peer to a channel.
25+
#org.hyperledger.fabric.sdk.channel.genesisblock_wait_time=5000
26+
## Limits logging of some long strings to this many characters.
27+
#org.hyperledger.fabric.sdk.log.stringlengthmax=64;
28+
## Setting this to 10 or higher produce larger amounts of logging. Seldom beneficial.
29+
#org.hyperledger.fabric.sdk.log.extraloglevel=10
30+
## Quick way to set apache log4j setting. Default is not to set anything (null). Default for Apache log file is INFO. Can be
31+
## TRACE, DEBUG, INFO, WARN, ERROR
32+
#org.hyperledger.fabric.sdk.loglevel=null
33+
## If true the SDK will perform a check on the endorsed proposals to guarantee they are consistent. This will be checked by the endorsing peers
34+
## prior to committing the block and will fail regardless.
35+
#org.hyperledger.fabric.sdk.proposal.consistency_validation=true
1636

1737
# System wide defaults for CryptoPrimitives objects. You can customize further by using the
1838
# CryptoPrimitives.setProperties() method.
@@ -21,13 +41,13 @@ org.hyperledger.fabric.sdk.channel.genesisblock_wait_time=5000
2141
#
2242
# security level determines the elliptic curve used to generate keys. Valid values are 256 ( curve is P-256 )
2343
# and 384 ( curve is secp384r1 )
24-
org.hyperledger.fabric.sdk.crypto.security_level = 256
44+
# org.hyperledger.fabric.sdk.crypto.security_level = 256
2545
# hash algorithm determines the message digest used when creating a signature. Valid values are
2646
# SHA2 ( digest is SHA-256 ) and SHA3 ( digest is SHA-3 )
27-
org.hyperledger.fabric.sdk.crypto.hash_algorithm = SHA2
47+
#org.hyperledger.fabric.sdk.crypto.hash_algorithm = SHA2
2848
# The format for the certificate PEM files used by the SDK, Fabric and Fabric-ca components.
2949
# currently X.509 is the only valid format supported. This entry is here to allow for future support
30-
org.hyperledger.fabric.sdk.crypto.certificate_format = X.509
50+
# org.hyperledger.fabric.sdk.crypto.certificate_format = X.509
3151
# The algorithm used to generate a signature. Valid values are listed in the JCA Standard Algorithm Name Documentation
3252
# e.g. http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Signature
33-
org.hyperledger.fabric.sdk.crypto.default_signature_algorithm = SHA256withECDSA
53+
# org.hyperledger.fabric.sdk.crypto.default_signature_algorithm = SHA256withECDSA

0 commit comments

Comments
 (0)