diff --git a/packages/caliper-tests-integration/fabric_tests/run.sh b/packages/caliper-tests-integration/fabric_tests/run.sh index d3da2d35e..c332cc527 100755 --- a/packages/caliper-tests-integration/fabric_tests/run.sh +++ b/packages/caliper-tests-integration/fabric_tests/run.sh @@ -40,7 +40,7 @@ export CALIPER_PROJECTCONFIG=../caliper.yaml dispose () { docker ps -a - ${CALL_METHOD} launch manager --caliper-workspace phase8 --caliper-flow-only-end + ${CALL_METHOD} launch manager --caliper-workspace phase6 --caliper-flow-only-end } TEST_NETWORK_DIR=${DIR}/fabric-samples/test-network diff --git a/packages/caliper-tests-integration/generator_tests/.gitignore b/packages/caliper-tests-integration/generator_tests/.gitignore new file mode 100644 index 000000000..8febd029a --- /dev/null +++ b/packages/caliper-tests-integration/generator_tests/.gitignore @@ -0,0 +1 @@ +fabric-samples diff --git a/packages/caliper-tests-integration/generator_tests/fabric/config/.gitignore b/packages/caliper-tests-integration/generator_tests/fabric/config/.gitignore deleted file mode 100644 index 2bc6f264d..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/config/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -bin/* -config/* -crypto-config/* -genesis.block -mychannel.tx diff --git a/packages/caliper-tests-integration/generator_tests/fabric/config/configtx.yaml b/packages/caliper-tests-integration/generator_tests/fabric/config/configtx.yaml deleted file mode 100644 index 8ee584f0c..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/config/configtx.yaml +++ /dev/null @@ -1,92 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - ---- - -Organizations: -- &OrdererOrg - Name: OrdererMSP - ID: OrdererMSP - MSPDir: crypto-config/ordererOrganizations/example.com/msp - AdminPrincipal: Role.MEMBER - -- &Org1 - Name: Org1MSP - ID: Org1MSP - MSPDir: crypto-config/peerOrganizations/org1.example.com/msp - AdminPrincipal: Role.ADMIN - AnchorPeers: - - Host: peer0.org1.example.com - Port: 7051 - -- &Org2 - Name: Org2MSP - ID: Org2MSP - MSPDir: crypto-config/peerOrganizations/org2.example.com/msp - AdminPrincipal: Role.ADMIN - AnchorPeers: - - Host: peer0.org2.example.com - Port: 7051 - -Orderer: &OrdererDefaults - OrdererType: etcdraft - Addresses: - - orderer0.example.com:7050 - - orderer1.example.com:7050 - - BatchTimeout: 500ms - BatchSize: - MaxMessageCount: 50 - AbsoluteMaxBytes: 1 MB - PreferredMaxBytes: 1 MB - - MaxChannels: 0 - EtcdRaft: - Consenters: - - Host: orderer0.example.com - Port: 7050 - ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/server.crt - ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/tls/server.crt - - Host: orderer1.example.com - Port: 7050 - ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/server.crt - ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/server.crt - - Organizations: - -Application: &ApplicationDefaults - Organizations: - -Profiles: - OrdererGenesis: - Orderer: - <<: *OrdererDefaults - Organizations: - - *OrdererOrg - Consortiums: - SampleConsortium: - Organizations: - - *Org1 - - *Org2 - SampleConsortium2: - Organizations: - - *Org1 - - *Org2 - ChannelConfig: - Consortium: SampleConsortium - Application: - <<: *ApplicationDefaults - Organizations: - - *Org1 - - *Org2 diff --git a/packages/caliper-tests-integration/generator_tests/fabric/config/crypto-config.yaml b/packages/caliper-tests-integration/generator_tests/fabric/config/crypto-config.yaml deleted file mode 100644 index d66bf601d..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/config/crypto-config.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -OrdererOrgs: -- Name: Orderer - Domain: example.com - - Template: - Count: 2 - -PeerOrgs: -- Name: Org1 - Domain: org1.example.com - Template: - Count: 1 - Users: - Count: 1 - -- Name: Org2 - Domain: org2.example.com - Template: - Count: 1 - Users: - Count: 1 diff --git a/packages/caliper-tests-integration/generator_tests/fabric/config/generate.sh b/packages/caliper-tests-integration/generator_tests/fabric/config/generate.sh deleted file mode 100755 index 061338094..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/config/generate.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -# if the binaries are not available, download them -if [[ ! -d "bin" ]]; then - curl -sSL -k https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/bootstrap.sh | bash -s -- 1.4.8 1.4.8 0.4.15 -ds -fi - -rm -rf ./crypto-config/ -rm -f ./genesis.block -rm -f ./mychannel.tx - -./bin/cryptogen generate --config=./crypto-config.yaml -./bin/configtxgen -profile OrdererGenesis -outputBlock genesis.block -channelID syschannel -./bin/configtxgen -profile ChannelConfig -outputCreateChannelTx mychannel.tx -channelID mychannel - -# Rename the key files we use to be key.pem instead of a uuid -for KEY in $(find crypto-config -type f -name "*_sk"); do - KEY_DIR=$(dirname ${KEY}) - mv ${KEY} ${KEY_DIR}/key.pem -done diff --git a/packages/caliper-tests-integration/generator_tests/fabric/docker-compose.yaml b/packages/caliper-tests-integration/generator_tests/fabric/docker-compose.yaml deleted file mode 100644 index f36a02e63..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/docker-compose.yaml +++ /dev/null @@ -1,262 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -version: '3' - -volumes: - prometheus_data: {} - -services: - -####### -# CAs # -####### - - ca.org1.example.com: - image: hyperledger/fabric-ca:1.4.8 - environment: - - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server - - FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com - - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem - - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/key.pem - # TLS - - FABRIC_CA_SERVER_TLS_ENABLED=true - - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-tls/tlsca.org1.example.com-cert.pem - - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-tls/key.pem - ports: - - "7054:7054" - command: sh -c 'fabric-ca-server start -b admin:adminpw -d' - volumes: - - ./config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config - - ./config/crypto-config/peerOrganizations/org1.example.com/tlsca/:/etc/hyperledger/fabric-ca-server-tls - container_name: ca.org1.example.com - - ca.org2.example.com: - image: hyperledger/fabric-ca:1.4.8 - environment: - - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server - - FABRIC_CA_SERVER_CA_NAME=ca.org2.example.com - - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem - - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/key.pem - # TLS - - FABRIC_CA_SERVER_TLS_ENABLED=true - - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-tls/tlsca.org2.example.com-cert.pem - - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-tls/key.pem - ports: - - "8054:7054" - command: sh -c 'fabric-ca-server start -b admin:adminpw -d' - volumes: - - ./config/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config - - ./config/crypto-config/peerOrganizations/org2.example.com/tlsca/:/etc/hyperledger/fabric-ca-server-tls - container_name: ca.org2.example.com - -############ -# ORDERERS # -############ - - orderer0.example.com: - container_name: orderer0.example.com - image: hyperledger/fabric-orderer:1.4.8 - environment: - - FABRIC_LOGGING_SPEC=info - - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - - ORDERER_GENERAL_GENESISMETHOD=file - - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block - - ORDERER_GENERAL_LOCALMSPID=OrdererMSP - - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp - # TLS - - ORDERER_GENERAL_TLS_ENABLED=true - - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key - - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt - - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt] - # Mutual TLS - - ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED=true - - 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] - # Raft TLS - - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt - - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key - # setting up metrics - - ORDERER_OPERATIONS_LISTENADDRESS=0.0.0.0:9000 - - ORDERER_OPERATIONS_TLS_ENABLED=false - - ORDERER_METRICS_ENABLE=true - - ORDERER_METRICS_PROVIDER=prometheus - working_dir: /opt/gopath/src/github.com/hyperledger/fabric - command: orderer - ports: - - 7050:7050 - volumes: - - ./config/:/etc/hyperledger/configtx - - ./config/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/:/etc/hyperledger/msp/orderer - - ./config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/msp/caOrg1 - - ./config/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/msp/caOrg2 - - ./config/crypto-config/ordererOrganizations/example.com/ca/:/etc/hyperledger/msp/caOrderer - depends_on: - - ca.org1.example.com - - ca.org2.example.com - - orderer1.example.com: - container_name: orderer1.example.com - image: hyperledger/fabric-orderer:1.4.8 - environment: - - FABRIC_LOGGING_SPEC=info - - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - - ORDERER_GENERAL_GENESISMETHOD=file - - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block - - ORDERER_GENERAL_LOCALMSPID=OrdererMSP - - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp - # TLS - - ORDERER_GENERAL_TLS_ENABLED=true - - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key - - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt - - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/msp/orderer/tls/ca.crt] - # Mutual TLS - - ORDERER_GENERAL_TLS_CLIENTAUTHREQUIRED=true - - 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] - # Raft TLS - - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/msp/orderer/tls/server.crt - - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/msp/orderer/tls/server.key - # setting up metrics - - ORDERER_OPERATIONS_LISTENADDRESS=0.0.0.0:9000 - - ORDERER_OPERATIONS_TLS_ENABLED=false - - ORDERER_METRICS_ENABLE=true - - ORDERER_METRICS_PROVIDER=prometheus - working_dir: /opt/gopath/src/github.com/hyperledger/fabric - command: orderer - ports: - - 8050:7050 - volumes: - - ./config/:/etc/hyperledger/configtx - - ./config/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/:/etc/hyperledger/msp/orderer - - ./config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/msp/caOrg1 - - ./config/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/msp/caOrg2 - - ./config/crypto-config/ordererOrganizations/example.com/ca/:/etc/hyperledger/msp/caOrderer - depends_on: - - ca.org1.example.com - - ca.org2.example.com - -######### -# PEERS # -######### - - peer0.org1.example.com: - container_name: peer0.org1.example.com - image: hyperledger/fabric-peer:1.4.8 - environment: - - FABRIC_LOGGING_SPEC=info - - CORE_CHAINCODE_LOGGING_LEVEL=INFO - - CORE_CHAINCODE_LOGGING_SHIM=INFO - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_PEER_ID=peer0.org1.example.com - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_LOCALMSPID=Org1MSP - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/msp/ - - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 - - CORE_PEER_GOSSIP_USELEADERELECTION=true - - CORE_PEER_GOSSIP_ORGLEADER=false - - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 - - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=caliper_default - # CouchDB - - CORE_LEDGER_STATE_STATEDATABASE=CouchDB - - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb.peer0.org1.example.com:5984 - # TLS - - CORE_PEER_TLS_ENABLED=true - - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/msp/peer/tls/server.key - - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/msp/peer/tls/server.crt - - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/msp/peer/tls/ca.crt - # Mutual TLS - - CORE_PEER_TLS_CLIENTAUTHREQUIRED=true - - 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 - # setting up metrics - - CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9000 - - CORE_OPERATIONS_TLS_ENABLED=false - - CORE_METRICS_ENABLE=true - - CORE_METRICS_PROVIDER=prometheus - working_dir: /opt/gopath/src/github.com/hyperledger/fabric - command: peer node start - ports: - - 7051:7051 - volumes: - - /var/run/:/host/var/run/ - - ./config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peer - - ./config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/msp/caOrg1 - - ./config/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/msp/caOrg2 - - ./config/crypto-config/ordererOrganizations/example.com/ca/:/etc/hyperledger/msp/caOrderer - depends_on: - - orderer0.example.com - - orderer1.example.com - - couchdb.peer0.org1.example.com - - couchdb.peer0.org1.example.com: - container_name: couchdb.peer0.org1.example.com - image: hyperledger/fabric-couchdb:0.4.14 - ports: - - 5984:5984 - environment: - DB_URL: http://localhost:5984/member_db - - peer0.org2.example.com: - container_name: peer0.org2.example.com - image: hyperledger/fabric-peer:1.4.8 - environment: - - FABRIC_LOGGING_SPEC=info - - CORE_CHAINCODE_LOGGING_LEVEL=INFO - - CORE_CHAINCODE_LOGGING_SHIM=INFO - - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - - CORE_PEER_ID=peer0.org2.example.com - - CORE_PEER_ENDORSER_ENABLED=true - - CORE_PEER_LOCALMSPID=Org2MSP - - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/msp/ - - CORE_PEER_ADDRESS=peer0.org2.example.com:7051 - - CORE_PEER_GOSSIP_USELEADERELECTION=true - - CORE_PEER_GOSSIP_ORGLEADER=false - - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051 - - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=caliper_default - # CouchDB - - CORE_LEDGER_STATE_STATEDATABASE=CouchDB - - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb.peer0.org2.example.com:5984 - # TLS - - CORE_PEER_TLS_ENABLED=true - - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/msp/peer/tls/server.key - - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/msp/peer/tls/server.crt - - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/msp/peer/tls/ca.crt - # Mutual TLS - - CORE_PEER_TLS_CLIENTAUTHREQUIRED=true - - 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 - # setting up metrics - - CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9000 - - CORE_OPERATIONS_TLS_ENABLED=false - - CORE_METRICS_ENABLE=true - - CORE_METRICS_PROVIDER=prometheus - working_dir: /opt/gopath/src/github.com/hyperledger/fabric - command: peer node start - ports: - - 8051:7051 - volumes: - - /var/run/:/host/var/run/ - - ./config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peer - - ./config/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/msp/caOrg1 - - ./config/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/msp/caOrg2 - - ./config/crypto-config/ordererOrganizations/example.com/ca/:/etc/hyperledger/msp/caOrderer - depends_on: - - orderer0.example.com - - orderer1.example.com - - couchdb.peer0.org2.example.com - - couchdb.peer0.org2.example.com: - container_name: couchdb.peer0.org2.example.com - image: hyperledger/fabric-couchdb:0.4.14 - ports: - - 6984:5984 - environment: - DB_URL: http://localhost:5984/member_db diff --git a/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/ccp-org1.yaml b/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/ccp-org1.yaml deleted file mode 100644 index 32851f2a8..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/ccp-org1.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: test-network-org1 -version: 1.0.0 -client: - organization: Org1 - connection: - timeout: - peer: - endorser: '300' - -organizations: - Org1: - mspid: Org1MSP - peers: - - peer0.org1.example.com - -orderers: - orderer0.example.com: - url: grpcs://localhost:7050 - grpcOptions: - ssl-target-name-override: orderer0.example.com - tlsCACerts: - path: ./fabric/config/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem - orderer1.example.com: - url: grpcs://localhost:8050 - grpcOptions: - ssl-target-name-override: orderer1.example.com - tlsCACerts: - path: ./fabric/config/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/tlscacerts/tlsca.example.com-cert.pem - -peers: - peer0.org1.example.com: - url: grpcs://localhost:7051 - grpcOptions: - ssl-target-name-override: peer0.org1.example.com - grpc.keepalive_time_ms: 600000 - tlsCACerts: - path: ./fabric/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem - - peer0.org2.example.com: - url: grpcs://localhost:8051 - grpcOptions: - ssl-target-name-override: peer0.org2.example.com - grpc.keepalive_time_ms: 600000 - tlsCACerts: - path: ./fabric/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem - -channels: - mychannel: - orderers: - - orderer0.example.com - - orderer1.example.com - peers: - peer0.org1.example.com: - eventSource: true - peer0.org2.example.com: - eventSource: true - yourchannel: - orderers: - - orderer0.example.com - - orderer1.example.com - peers: - peer0.org1.example.com: - eventSource: true - peer0.org2.example.com: - eventSource: true diff --git a/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/ccp-org2.yaml b/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/ccp-org2.yaml deleted file mode 100644 index 92d92fbd8..000000000 --- a/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/ccp-org2.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: test-network-org2 -version: 1.0.0 -client: - organization: Org2 - connection: - timeout: - peer: - endorser: '300' - -organizations: - Org2: - mspid: Org2MSP - peers: - - peer0.org2.example.com - -orderers: - orderer0.example.com: - url: grpcs://localhost:7050 - grpcOptions: - ssl-target-name-override: orderer0.example.com - tlsCACerts: - path: ./fabric/config/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem - orderer1.example.com: - url: grpcs://localhost:8050 - grpcOptions: - ssl-target-name-override: orderer1.example.com - tlsCACerts: - path: ./fabric/config/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp/tlscacerts/tlsca.example.com-cert.pem - -peers: - peer0.org1.example.com: - url: grpcs://localhost:7051 - grpcOptions: - ssl-target-name-override: peer0.org1.example.com - grpc.keepalive_time_ms: 600000 - tlsCACerts: - path: ./fabric/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem - - peer0.org2.example.com: - url: grpcs://localhost:8051 - grpcOptions: - ssl-target-name-override: peer0.org2.example.com - grpc.keepalive_time_ms: 600000 - tlsCACerts: - path: ./fabric/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem - -channels: - mychannel: - orderers: - - orderer0.example.com - - orderer1.example.com - peers: - peer0.org1.example.com: - eventSource: true - peer0.org2.example.com: - eventSource: true - yourchannel: - orderers: - - orderer0.example.com - - orderer1.example.com - peers: - peer0.org1.example.com: - eventSource: true - peer0.org2.example.com: - eventSource: true diff --git a/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/networkconfig.yaml b/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/networkconfig.yaml index 5df6ed798..b5433764b 100644 --- a/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/networkconfig.yaml +++ b/packages/caliper-tests-integration/generator_tests/fabric/myWorkspace/networkconfig.yaml @@ -19,22 +19,11 @@ caliper: blockchain: fabric sutOptions : mutualTls: true - command: - start: docker-compose -p caliper up -d;rm -rf /tmp/hfc-*;sleep 5s - end: docker-compose -p caliper down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q);rm -rf /tmp/hfc-* channels: - channelName: mychannel - create: - prebuiltTransaction: ../config/mychannel.tx contracts: - - id: marbles - contractID: mymarbles - install: - version: v0 - language: node - path: ../src/marbles/node - metadataPath: ../src/marbles/node/metadata + - id: mymarbles organizations: - mspid: Org1MSP @@ -43,12 +32,12 @@ organizations: - name: 'admin.org1.example.com' admin: true clientPrivateKey: - path: ../config/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/key.pem + path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/priv_sk' clientSignedCert: - path: ../config/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem + path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem' connectionProfile: - path: './ccp-org1.yaml' - discover: false + path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml' + discover: true - mspid: Org2MSP identities: @@ -56,10 +45,9 @@ organizations: - name: 'admin.org2.example.com' admin: true clientPrivateKey: - path: ../config/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/key.pem + path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/priv_sk' clientSignedCert: - path: ../config/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem + path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem' connectionProfile: - path: './ccp-org2.yaml' - discover: false - + path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml' + discover: true diff --git a/packages/caliper-tests-integration/generator_tests/fabric/run.sh b/packages/caliper-tests-integration/generator_tests/fabric/run.sh index 8ef764857..b11f11703 100755 --- a/packages/caliper-tests-integration/generator_tests/fabric/run.sh +++ b/packages/caliper-tests-integration/generator_tests/fabric/run.sh @@ -16,47 +16,48 @@ # Print all commands. set -v -# Grab the parent (generator_tests) directory. +# Grab the parent (generator_tests/fabric) directory. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "${DIR}" +if [[ ! -d "fabric-samples" ]]; then + curl -sSL -k https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/bootstrap.sh | bash -s -- 2.4.3 +fi + +TEST_NETWORK_DIR=${DIR}/fabric-samples/test-network + # change default settings (add config paths too) export CALIPER_PROJECTCONFIG=../caliper.yaml dispose () { - ${CALL_METHOD} launch manager --caliper-workspace 'fabric/myWorkspace' --caliper-flow-only-end + pushd ${TEST_NETWORK_DIR} + ./network.sh down + popd + + cd ${DIR} + rm -r myWorkspace/benchmarks } # Install yo npm install --global yo@3.1.1 -# generate the crypto materials -cd ./config -./generate.sh - # back to this dir cd ${DIR} -# needed, since the peer looks for the latest, which is no longer on dockerhub -docker pull hyperledger/fabric-ccenv:1.4.8 -docker image tag hyperledger/fabric-ccenv:1.4.8 hyperledger/fabric-ccenv:latest - # Run benchmark generator using generator defaults (specify invalid values for options) ${GENERATOR_METHOD} -- --workspace 'myWorkspace' --contractId 'mymarbles' --contractVersion 'v0' --contractFunction 'queryMarblesByOwner' --contractArguments '["Alice"]' --workers 'marbles' --benchmarkName 'A name for the marbles benchmark' --benchmarkDescription 'A description for the marbles benchmark' --label 'A label for the round' --rateController 'fixed-rate' --txType 'txDuration' --txDuration 'marbles' # start network and run benchmark test cd ../ # bind the sdk into the packages directory as it will search for it there, this ensures it doesn't contaminate real node_modules dirs (2.2 will work with a 1.4 fabric) pushd $SUT_DIR -${CALL_METHOD} bind --caliper-bind-sut fabric:1.4 +${CALL_METHOD} bind --caliper-bind-sut fabric:2.2 +popd + +pushd ${TEST_NETWORK_DIR} +./network.sh up -s couchdb +./network.sh createChannel -c mychannel +./network.sh deployCC -ccn mymarbles -c mychannel -ccp ${DIR}/src/marbles/node -ccl javascript -ccv v0 -ccep "OR('Org1MSP.member','Org2MSP.member')" popd -${CALL_METHOD} launch manager --caliper-workspace 'fabric/myWorkspace' --caliper-networkconfig 'networkconfig.yaml' --caliper-benchconfig 'benchmarks/config.yaml' --caliper-flow-skip-end -rc=$? -if [[ ${rc} != 0 ]]; then - echo "Failed start network"; - rm -r fabric/myWorkspace/benchmarks - dispose; - exit ${rc}; -fi cd ${DIR} # Run benchmark generator not using generator defaults @@ -75,12 +76,4 @@ if [[ ${rc} != 0 ]]; then fi # dispose network -${CALL_METHOD} launch manager --caliper-workspace 'fabric/myWorkspace' --caliper-networkconfig 'networkconfig.yaml' --caliper-benchconfig 'benchmarks/config.yaml' --caliper-flow-only-end -rc=$? -if [[ ${rc} != 0 ]]; then - echo "Failed end network"; - rm -r fabric/myWorkspace/benchmarks - exit ${rc}; -fi -cd ${DIR} -rm -r myWorkspace/benchmarks +dispose diff --git a/packages/caliper-tests-integration/generator_tests/fabric/src/marbles/node/package.json b/packages/caliper-tests-integration/generator_tests/fabric/src/marbles/node/package.json index d20317283..c48659644 100644 --- a/packages/caliper-tests-integration/generator_tests/fabric/src/marbles/node/package.json +++ b/packages/caliper-tests-integration/generator_tests/fabric/src/marbles/node/package.json @@ -12,6 +12,6 @@ "engine-strict": true, "license": "Apache-2.0", "dependencies": { - "fabric-shim": "1.4.5" + "fabric-shim": "2.4.2" } } diff --git a/packages/caliper-tests-integration/package.json b/packages/caliper-tests-integration/package.json index f6bcf1e67..6910bbd10 100644 --- a/packages/caliper-tests-integration/package.json +++ b/packages/caliper-tests-integration/package.json @@ -87,6 +87,7 @@ "fisco-bcos_tests/config/node2", "fisco-bcos_tests/config/node3", "fisco-bcos_tests/config/sdk", + "generator_tests/.gitignore", "generator_tests/fabric/.gitignore", "generator_tests/fabric/config/.gitignore", "generator_tests/fabric/config/bin", @@ -139,4 +140,4 @@ } } } -} \ No newline at end of file +}