Skip to content

Commit 6fb76f2

Browse files
authored
add integration test for peer gateway connector + updated docker compose for fabric 2.4 (#1310)
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
1 parent 9e736c0 commit 6fb76f2

File tree

16 files changed

+451
-47
lines changed

16 files changed

+451
-47
lines changed

packages/caliper-fabric/lib/connector-versions/peer-gateway/PeerGateway.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class PeerGateway extends ConnectorBase {
175175
client.close();
176176
}
177177

178+
this.clients.clear();
178179
this.context = undefined;
179180
}
180181

packages/caliper-tests-integration/fabric_tests/docker-compose.yaml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
#######
2525

2626
ca.org1.example.com:
27-
image: hyperledger/fabric-ca:1.4.8
27+
image: hyperledger/fabric-ca:1.5.3
2828
environment:
2929
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
3030
- FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
@@ -42,8 +42,9 @@ services:
4242
- ./config/crypto-config/peerOrganizations/org1.example.com/tlsca/:/etc/hyperledger/fabric-ca-server-tls
4343
container_name: ca.org1.example.com
4444

45+
4546
ca.org2.example.com:
46-
image: hyperledger/fabric-ca:1.4.8
47+
image: hyperledger/fabric-ca:1.5.3
4748
environment:
4849
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
4950
- FABRIC_CA_SERVER_CA_NAME=ca.org2.example.com
@@ -67,7 +68,7 @@ services:
6768

6869
orderer0.example.com:
6970
container_name: orderer0.example.com
70-
image: hyperledger/fabric-orderer:1.4.8
71+
image: hyperledger/fabric-orderer:2.4.3
7172
environment:
7273
- FABRIC_LOGGING_SPEC=info
7374
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
@@ -80,9 +81,6 @@ services:
8081
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key
8182
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt
8283
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt]
83-
# Mutual TLS
84-
- ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED=true
85-
- ORDERER_GENERAL_TLS_CLIENTROOTCAS=[/etc/hyperledger/msp/caOrg1/ca.org1.example.com-cert.pem, /etc/hyperledger/msp/caOrg2/ca.org2.example.com-cert.pem, /etc/hyperledger/msp/caOrderer/ca.example.com-cert.pem]
8684
# Raft TLS
8785
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt
8886
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key
@@ -107,7 +105,7 @@ services:
107105

108106
orderer1.example.com:
109107
container_name: orderer1.example.com
110-
image: hyperledger/fabric-orderer:1.4.8
108+
image: hyperledger/fabric-orderer:2.4.3
111109
environment:
112110
- FABRIC_LOGGING_SPEC=info
113111
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
@@ -120,9 +118,6 @@ services:
120118
- ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key
121119
- ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt
122120
- ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt]
123-
# Mutual TLS
124-
- ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED=true
125-
- ORDERER_GENERAL_TLS_CLIENTROOTCAS=[/etc/hyperledger/msp/caOrg1/ca.org1.example.com-cert.pem, /etc/hyperledger/msp/caOrg2/ca.org2.example.com-cert.pem, /etc/hyperledger/msp/caOrderer/ca.example.com-cert.pem]
126121
# Raft TLS
127122
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt
128123
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key
@@ -151,7 +146,7 @@ services:
151146

152147
peer0.org1.example.com:
153148
container_name: peer0.org1.example.com
154-
image: hyperledger/fabric-peer:1.4.8
149+
image: hyperledger/fabric-peer:2.4.3
155150
environment:
156151
- FABRIC_LOGGING_SPEC=info
157152
- CORE_CHAINCODE_LOGGING_LEVEL=INFO
@@ -169,14 +164,16 @@ services:
169164
# CouchDB
170165
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
171166
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb.peer0.org1.example.com:5984
167+
# The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
168+
# provide the credentials for ledger to connect to CouchDB. The username and password must
169+
# match the username and password set for the associated CouchDB.
170+
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
171+
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
172172
# TLS
173173
- CORE_PEER_TLS_ENABLED=true
174174
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/msp/peer/tls/server.key
175175
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/msp/peer/tls/server.crt
176176
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/msp/peer/tls/ca.crt
177-
# Mutual TLS
178-
- CORE_PEER_TLS_CLIENTAUTHREQUIRED=true
179-
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/etc/hyperledger/msp/caOrg1/ca.org1.example.com-cert.pem /etc/hyperledger/msp/caOrg2/ca.org2.example.com-cert.pem /etc/hyperledger/msp/caOrderer/ca.example.com-cert.pem
180177
# setting up metrics
181178
- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9000
182179
- CORE_OPERATIONS_TLS_ENABLED=false
@@ -199,15 +196,18 @@ services:
199196

200197
couchdb.peer0.org1.example.com:
201198
container_name: couchdb.peer0.org1.example.com
202-
image: hyperledger/fabric-couchdb:0.4.14
199+
image: couchdb:3.1.1
203200
ports:
204201
- 5984:5984
202+
# Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
203+
# for CouchDB. This will prevent CouchDB from operating in an "Admin Party" mode.
205204
environment:
206-
DB_URL: http://localhost:5984/member_db
205+
- COUCHDB_USER=admin
206+
- COUCHDB_PASSWORD=adminpw
207207

208208
peer0.org2.example.com:
209209
container_name: peer0.org2.example.com
210-
image: hyperledger/fabric-peer:1.4.8
210+
image: hyperledger/fabric-peer:2.4.3
211211
environment:
212212
- FABRIC_LOGGING_SPEC=info
213213
- CORE_CHAINCODE_LOGGING_LEVEL=INFO
@@ -225,14 +225,16 @@ services:
225225
# CouchDB
226226
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
227227
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb.peer0.org2.example.com:5984
228+
# The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
229+
# provide the credentials for ledger to connect to CouchDB. The username and password must
230+
# match the username and password set for the associated CouchDB.
231+
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
232+
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
228233
# TLS
229234
- CORE_PEER_TLS_ENABLED=true
230235
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/msp/peer/tls/server.key
231236
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/msp/peer/tls/server.crt
232237
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/msp/peer/tls/ca.crt
233-
# Mutual TLS
234-
- CORE_PEER_TLS_CLIENTAUTHREQUIRED=true
235-
- CORE_PEER_TLS_CLIENTROOTCAS_FILES=/etc/hyperledger/msp/caOrg1/ca.org1.example.com-cert.pem /etc/hyperledger/msp/caOrg2/ca.org2.example.com-cert.pem /etc/hyperledger/msp/caOrderer/ca.example.com-cert.pem
236238
# setting up metrics
237239
- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9000
238240
- CORE_OPERATIONS_TLS_ENABLED=false
@@ -255,11 +257,14 @@ services:
255257

256258
couchdb.peer0.org2.example.com:
257259
container_name: couchdb.peer0.org2.example.com
258-
image: hyperledger/fabric-couchdb:0.4.14
260+
image: couchdb:3.1.1
259261
ports:
260262
- 6984:5984
263+
# Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
264+
# for CouchDB. This will prevent CouchDB from operating in an "Admin Party" mode.
261265
environment:
262-
DB_URL: http://localhost:5984/member_db
266+
- COUCHDB_USER=admin
267+
- COUCHDB_PASSWORD=adminpw
263268

264269
##############
265270
# MONITORING #
@@ -312,5 +317,4 @@ services:
312317
- "1883:1883"
313318
- "9001:9001"
314319
volumes:
315-
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
316-
320+
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf

packages/caliper-tests-integration/fabric_tests/phase2/networkconfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version: "2.0.0"
1818
caliper:
1919
blockchain: fabric
2020
sutOptions :
21-
mutualTls: true
21+
mutualTls: false
2222

2323
channels:
2424
- channelName: mychannel

packages/caliper-tests-integration/fabric_tests/phase3/networkconfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version: "2.0.0"
1818
caliper:
1919
blockchain: fabric
2020
sutOptions :
21-
mutualTls: true
21+
mutualTls: false
2222

2323
channels:
2424
- channelName: mychannel

packages/caliper-tests-integration/fabric_tests/phase4/networkconfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version: "2.0.0"
1818
caliper:
1919
blockchain: fabric
2020
sutOptions :
21-
mutualTls: true
21+
mutualTls: false
2222

2323
channels:
2424
- channelName: mychannel

packages/caliper-tests-integration/fabric_tests/phase5/networkconfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version: "2.0.0"
1818
caliper:
1919
blockchain: fabric
2020
sutOptions :
21-
mutualTls: true
21+
mutualTls: false
2222

2323
channels:
2424
- channelName: mychannel

packages/caliper-tests-integration/fabric_tests/phase6/networkconfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version: "2.0.0"
1818
caliper:
1919
blockchain: fabric
2020
sutOptions :
21-
mutualTls: true
21+
mutualTls: false
2222

2323
channels:
2424
- channelName: mychannel

packages/caliper-tests-integration/fabric_tests/phase7/benchconfig.yaml

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,64 @@ test:
2020
rounds:
2121
- label: init1
2222
txNumber: 100
23-
rateControl: { type: 'fixed-rate', opts: { tps: 20 } }
23+
rateControl: { type: 'fixed-load', opts: { "transactionLoad": 5, "startingTps": 100 }}
2424
workload:
2525
module: ./../init.js
2626
arguments:
27-
marblePrefix: marbles_phase_5
28-
- label: init2
27+
marblePrefix: marbles_phase_7
28+
- label: query1
2929
txNumber: 200
3030
rateControl: { type: 'fixed-feedback-rate', opts: { tps: 20, maximum_transaction_load: 5 } }
3131
workload:
32-
module: ./../init.js
33-
arguments:
34-
marblePrefix: marbles_phase_5
35-
- label: query
36-
txNumber: 100
32+
module: ./queryByChannelNoTargetPeer.js
33+
- label: init2
34+
txNumber: 25
3735
rateControl: { type: 'linear-rate', opts: { startingTps: 10, finishingTps: 20 } }
3836
workload:
39-
module: ./../query.js
37+
module: ./../initByChannel.js
38+
arguments:
39+
marblePrefix: marbles_phase_7
40+
- label: query2
41+
txNumber: 25
42+
rateControl: { type: 'linear-rate', opts: { startingTps: 5, finishingTps: 10 } }
43+
workload:
44+
module: ./../queryNoTargetPeers.js
45+
monitors:
46+
transaction:
47+
- module: prometheus-push
48+
options:
49+
pushInterval: 5
50+
pushUrl: "http://localhost:9091"
51+
resource:
52+
- module: prometheus
53+
options:
54+
interval: 5
55+
url: "http://localhost:9090"
56+
metrics:
57+
include: [peer*, dev*]
58+
queries:
59+
- name: Endorse Time (s)
60+
query: rate(endorser_propsal_duration_sum{chaincode="marbles:v0"}[1m])/rate(endorser_propsal_duration_count{chaincode="marbles:v0"}[1m])
61+
step: 1
62+
label: instance
63+
statistic: avg
64+
- name: Max Memory (MB)
65+
query: sum(container_memory_rss{name=~".+"}) by (name)
66+
step: 10
67+
label: name
68+
statistic: max
69+
multiplier: 0.000001
70+
charting:
71+
polar:
72+
metrics: [Max Memory (MB)]
73+
bar:
74+
metrics: [all]
75+
- module: process
76+
options:
77+
interval: 3
78+
processes: [{ command: 'node', arguments: 'caliper.js', multiOutput: 'avg' }]
79+
- module: docker
80+
options:
81+
interval: 4
82+
containers: ['peer0.org1.example.com', 'peer0.org2.example.com', 'orderer0.example.com', 'orderer1.example.com']
83+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
#
14+
15+
name: test-network-org1
16+
version: 1.0.0
17+
client:
18+
organization: Org1
19+
connection:
20+
timeout:
21+
peer:
22+
endorser: '300'
23+
24+
organizations:
25+
Org1:
26+
mspid: Org1MSP
27+
peers:
28+
- peer0.org1.example.com
29+
30+
orderers:
31+
orderer0.example.com:
32+
url: grpcs://localhost:7050
33+
grpcOptions:
34+
ssl-target-name-override: orderer0.example.com
35+
tlsCACerts:
36+
path: ./config/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
37+
orderer1.example.com:
38+
url: grpcs://localhost:8050
39+
grpcOptions:
40+
ssl-target-name-override: orderer1.example.com
41+
tlsCACerts:
42+
path: ./config/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
43+
44+
peers:
45+
peer0.org1.example.com:
46+
url: grpcs://localhost:7051
47+
grpcOptions:
48+
ssl-target-name-override: peer0.org1.example.com
49+
grpc.keepalive_time_ms: 600000
50+
tlsCACerts:
51+
path: ./config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
52+
53+
peer0.org2.example.com:
54+
url: grpcs://localhost:8051
55+
grpcOptions:
56+
ssl-target-name-override: peer0.org2.example.com
57+
grpc.keepalive_time_ms: 600000
58+
tlsCACerts:
59+
path: ./config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem

0 commit comments

Comments
 (0)