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

Commit 8f65202

Browse files
committed
FAB-8523 Update fabric generated artifacts to v1.1
PS: 14 issue with testing on Windows. Change-Id: I67c728f92762c2edcca7e1b9890b5425b4296ab3 Signed-off-by: rickr <cr22rc@gmail.com>
1 parent dc2b94f commit 8f65202

File tree

252 files changed

+1819
-1018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+1819
-1018
lines changed

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,20 @@ In the directory src/test/fixture/sdkintegration/e2e-2Orgs/channel
241241

242242
The command used to generate end2end `crypto-config` artifacts:</br>
243243

244-
```build/bin/cryptogen generate --config crypto-config.yaml --output=crypto-config```
244+
v1.0 ```build/bin/cryptogen generate --config crypto-config.yaml --output=crypto-config```
245+
246+
v1.1 ```cryptogen generate --config crypto-config.yaml --output=v1.1/crypto-config```
245247

246248
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.
247249

248250
The files used by the end to end are:
249-
* _src/test/fixture/sdkintegration/e2e-2Orgs/channel_ (everything needed to bootstrap the orderer and create the channels)
250-
* _src/test/fixture/sdkintegration/e2e-2Orgs/crypto-config_ (as-is. Used by `configtxgen` and `docker-compose` to map the MSP directories)
251+
* _src/test/fixture/sdkintegration/e2e-2Orgs/vX.0_ (everything needed to bootstrap the orderer and create the channels)
252+
* _src/test/fixture/sdkintegration/e2e-2Orgs/vX.0crypto-config_ (as-is. Used by `configtxgen` and `docker-compose` to map the MSP directories)
251253
* _src/test/fixture/sdkintegration/docker-compose.yaml_
252254

253255

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

256260
### TLS connection to Orderer and Peers
@@ -297,25 +301,31 @@ and one file in the _src/test/fixture/sdkintegration/e2e-2Orgs/channel_ director
297301
section to be true. The `signed-by` references an identity in the identities section.
298302

299303
### Channel creation artifacts
300-
Channel configuration files and orderer bootstrap files ( see directory _src/test/fixture/sdkintegration/e2e-2Orgs/channel_ ) are needed when creating a new channel.
301-
This is created with the Hyperledger Fabric `configtxgen` tool.
304+
Channel configuration files and orderer bootstrap files ( see directory _src/test/fixture/sdkintegration/e2e-2Orgs_ ) are needed when creating a new channel.
305+
This is created with the Hyperledger Fabric `configtxgen` tool. This must be run after `cryptogen` and the directory you're
306+
running in **must** have a generated `crypto-config` directory.
307+
308+
If `build/bin/configtxgen` tool is not present run `make configtxgen`
302309

303-
For End2endIT.java the commands are
310+
For v1.0 integration test the commands are:
304311

305312
* build/bin/configtxgen -outputCreateChannelTx foo.tx -profile TwoOrgsChannel -channelID foo
306313
* build/bin/configtxgen -outputCreateChannelTx bar.tx -profile TwoOrgsChannel -channelID bar
307-
* build/bin/configtxgen -outputBlock orderer.block -profile TwoOrgsOrdererGenesis
308314

309-
with the configtxgen config file _src/test/fixture/sdkintegration/e2e-2Orgs/channel/configtx.yaml_
315+
For v1.1 integration the commands use the v11 profiles in configtx.yaml.
316+
You need to for now copy the configtx.yaml in `e2e-20orgs` to the v1.1 directory and run from there:
317+
* configtxgen -outputBlock orderer.block -profile TwoOrgsOrdererGenesis_v11
318+
* configtxgen -outputCreateChannelTx bar.tx -profile TwoOrgsChannel_v11 -channelID bar
319+
* configtxgen -outputCreateChannelTx foo.tx -profile TwoOrgsChannel_v11 -channelID foo
320+
321+
This should produce in the `v1.1` directory: bar.tx,foo.tx, orderer.block
322+
323+
**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.
325+
One examle of this is the docker-compose.yaml (search for **_sk**)
310326

311327

312-
If `build/bin/configtxgen` tool is not present run `make configtxgen`
313328

314-
Before running the end to end test case:
315-
* you may need to modify `configtx.yaml` to change all hostname and port definitions to match
316-
your server(s) hostname(s) and port(s).
317-
* you **WILL** have to modify `configtx.yaml` to have the _MSPDir_ point to the correct path to the _crypto-config_ directories.
318-
* `configtx.yaml` currently assumes that you are running in a Vagrant environment where the fabric, fabric-ca and fabric-sdk-java projects exist under the _/opt/gopath/src/github.com/hyperledger_ directory.
319329

320330
### GO Lang chaincode
321331
Go lang chaincode dependencies must be contained in vendor folder.

src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
import org.hyperledger.fabric.sdk.helper.Utils;
9898
import org.hyperledger.fabric.sdk.security.CryptoPrimitives;
9999
import org.hyperledger.fabric.sdk.security.CryptoSuite;
100-
import org.hyperledger.fabric_ca.sdk.HFCAAffiliation.HFCAAffiliationResp;
101100
import org.hyperledger.fabric_ca.sdk.exception.AffiliationException;
102101
import org.hyperledger.fabric_ca.sdk.exception.EnrollmentException;
103102
import org.hyperledger.fabric_ca.sdk.exception.GenerateCRLException;
@@ -168,6 +167,8 @@ public class HFCAClient {
168167
*/
169168
public static final String HFCA_ATTRIBUTE_HFGENCRL = "hf.GenCRL";
170169

170+
private static final Config config = Config.getConfig(); // DO NOT REMOVE THIS IS NEEDED TO MAKE SURE WE FIRST LOAD CONFIG!!!
171+
171172
private static final Log logger = LogFactory.getLog(HFCAClient.class);
172173

173174
static final String FABRIC_CA_REQPROP = "caname";

src/main/java/org/hyperledger/fabric_ca/sdk/RegistrationRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class RegistrationRequest {
3434
// The enrollment ID of the user
3535
private String enrollmentID;
3636
// Type of identity
37-
private String type = "user";
37+
private String type = HFCAClient.HFCA_TYPE_CLIENT;
3838
// Optional secret
3939
private String secret;
4040
// Maximum number of enrollments with the secret

src/test/cirun.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ export ORG_HYPERLEDGER_FABRIC_SDK_CHANNEL_GENESISBLOCK_WAIT_TIME=180000
2828
ORG_HYPERLEDGER_FABRIC_SDKTEST_VERSION=${ORG_HYPERLEDGER_FABRIC_SDKTEST_VERSION:-}
2929

3030
if [ "$ORG_HYPERLEDGER_FABRIC_SDKTEST_VERSION" == "1.0.0" ]; then
31+
# Limit the test run for V1.0
3132
export ORG_HYPERLEDGER_FABRIC_SDKTEST_ITSUITE="-Dorg.hyperledger.fabric.sdktest.ITSuite=IntegrationSuiteV1.java"
33+
#Options starting fabric-ca in docker-compose.yaml which are not supported on v1.0
3234
export V11_IDENTITIES_ALLOWREMOVE=""
3335
export V11_AFFILIATIONS_ALLOWREMOVE=""
36+
#set which images we pull for docker-compose.yaml when starting Fabric.
3437
export IMAGE_TAG_FABRIC=:x86_64-1.0.0
3538
export IMAGE_TAG_FABRIC_CA=:x86_64-1.0.0
39+
# set which Fabric generated configuations is used.
40+
export FAB_CONFIG_GEN_VERS="v1.0"
3641
else
42+
#everythign just defaults for latest (v1.1)
3743
export ORG_HYPERLEDGER_FABRIC_SDKTEST_ITSUITE=""
3844
#unset to use what's in docker's .env file.
3945
unset IMAGE_TAG_FABRIC

src/test/fixture/sdkintegration/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=
1515
#IMAGE_TAG_FABRIC_CA=:x86_64-1.1.0-alpha
1616
IMAGE_TAG_FABRIC=
1717
IMAGE_TAG_FABRIC_CA=
18+
#FAB_CONFIG_GEN_VERS=v1.0
19+
FAB_CONFIG_GEN_VERS=v1.1
1820
V11_IDENTITIES_ALLOWREMOVE=--cfg.identities.allowremove
1921
V11_AFFILIATIONS_ALLOWREMOVE=--cfg.affiliations.allowremove

src/test/fixture/sdkintegration/docker-compose.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
command: sh -c 'fabric-ca-server start -n ca0 ${V11_IDENTITIES_ALLOWREMOVE} ${V11_AFFILIATIONS_ALLOWREMOVE} --registry.maxenrollments -1 --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/fcf776b02a05600408d0be9d9752afc59f64950b721cacb363b5b95a0fea6216_sk -b admin:adminpw ${ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS} --tls.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --tls.keyfile /etc/hyperledger/fabric-ca-server-config/fcf776b02a05600408d0be9d9752afc59f64950b721cacb363b5b95a0fea6216_sk -d'
1616

1717
volumes:
18-
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
18+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
1919
container_name: ca_peerOrg1
2020

2121
ca1:
@@ -26,7 +26,7 @@ services:
2626
- "8054:7054"
2727
command: sh -c 'fabric-ca-server start --registry.maxenrollments -1 --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/b59bba37975dafcc4a93984aa01d3d29b64894617db9e0c9a2d486b5273cbd27_sk -b admin:adminpw ${ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS} --tls.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --tls.keyfile /etc/hyperledger/fabric-ca-server-config/b59bba37975dafcc4a93984aa01d3d29b64894617db9e0c9a2d486b5273cbd27_sk -d'
2828
volumes:
29-
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
29+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config:ro
3030
container_name: ca_peerOrg2
3131

3232

@@ -44,14 +44,14 @@ services:
4444
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key
4545
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt
4646
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt]
47-
# - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt, /etc/hyperledger/msp/peer0Org1/tls/ca.crt, /etc/hyperledger/msp/peer1Org1/tls/ca.crt, /etc/hyperledger/msp/peer0Org2/tls/ca.crt, /etc/hyperledger/msp/peer1Org2/tls/ca.crt]
4847
- GRPC_TRACE=all=true,
4948
- GRPC_VERBOSITY=debug
49+
- ORDERER_GENERAL_AUTHENTICATION_TIMEWINDOW=3600s #Not for production -- remove.
5050
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
5151
command: orderer
5252
volumes:
53-
- ./e2e-2Orgs/channel:/etc/hyperledger/configtx:ro
54-
- ./e2e-2Orgs/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer:ro
53+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}:/etc/hyperledger/configtx:ro
54+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/msp/orderer:ro
5555
ports:
5656
- 7050:7050
5757

@@ -68,7 +68,7 @@ services:
6868
- CORE_PEER_LOCALMSPID=Org1MSP
6969
volumes:
7070
- /var/run/:/host/var/run/
71-
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peer:ro
71+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peer:ro
7272
ports:
7373
- 7051:7051
7474
- 7053:7053
@@ -88,7 +88,7 @@ services:
8888
- CORE_PEER_LOCALMSPID=Org1MSP
8989
volumes:
9090
- /var/run/:/host/var/run/
91-
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/:/etc/hyperledger/msp/peer:ro
91+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/:/etc/hyperledger/msp/peer:ro
9292
ports:
9393
- 7056:7051
9494
- 7058:7053
@@ -109,7 +109,7 @@ services:
109109
- CORE_PEER_LOCALMSPID=Org2MSP
110110
volumes:
111111
- /var/run/:/host/var/run/
112-
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peer:ro
112+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peer:ro
113113
ports:
114114
- 8051:7051
115115
- 8053:7053
@@ -129,7 +129,7 @@ services:
129129
- CORE_PEER_LOCALMSPID=Org2MSP
130130
volumes:
131131
- /var/run/:/host/var/run/
132-
- ./e2e-2Orgs/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/:/etc/hyperledger/msp/peer:ro
132+
- ./e2e-2Orgs/${FAB_CONFIG_GEN_VERS}/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/:/etc/hyperledger/msp/peer:ro
133133
ports:
134134
- 8056:7051
135135
- 8058:7053

src/test/fixture/sdkintegration/e2e-2Orgs/channel/configtx.yaml

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)