Skip to content

Commit

Permalink
Use microfab for fabric integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: CaptainIRS <[email protected]>
  • Loading branch information
CaptainIRS committed Feb 22, 2023
1 parent 943ab2a commit 151dddf
Show file tree
Hide file tree
Showing 21 changed files with 433 additions and 176 deletions.
5 changes: 5 additions & 0 deletions packages/caliper-tests-integration/fabric_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
**/*.log
*.tar.gz
_cfg
bin
config
report.html
fabric-samples
vendor
microfab
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- 8080:8080
- 8888:8080
restart: always

###############
Expand All @@ -68,8 +68,3 @@ services:
- "9001:9001"
volumes:
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf

networks:
default:
name: fabric_test
external: true
2 changes: 1 addition & 1 deletion packages/caliper-tests-integration/fabric_tests/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MarblesInitWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractFunction: 'initMarble',
contractArguments: [marbleName, marbleColor, marbleSize, marbleOwner],
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 5,
readOnly: false
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class MarblesInitByChannelWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractVersion: 'v0',
contractFunction: 'initMarble',
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
channel: this.txIndex % 2 === 0 ? 'mychannel' : 'yourchannel',
contractArguments: [marbleName, marbleColor, marbleSize, marbleOwner],
timeout: 5,
timeout: 10,
readOnly: false
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,43 @@ organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
- org1peer-api.127-0-0-1.nip.io:8080

orderers:
orderer.example.com:
url: grpcs://localhost:7050
grpcOptions:
ssl-target-name-override: orderer.example.com
orderer-api.127-0-0-1.nip.io:8080:
url: grpcs://orderer-api.127-0-0-1.nip.io:8080
tlsCACerts:
path: ./fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
path: './_cfg/uf/_msp/tls/orderer/tlsca-orderer-cert.pem'

peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
org1peer-api.127-0-0-1.nip.io:8080:
url: grpcs://org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
path: './_cfg/uf/_msp/tls/org1peer/tlsca-org1peer-cert.pem'

peer0.org2.example.com:
url: grpcs://localhost:9051
org2peer-api.127-0-0-1.nip.io:8080:
url: grpcs://org2peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem
path: './_cfg/uf/_msp/tls/org2peer/tlsca-org2peer-cert.pem'

channels:
mychannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
yourchannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,43 @@ organizations:
Org2:
mspid: Org2MSP
peers:
- peer0.org2.example.com
- org2peer-api.127-0-0-1.nip.io:8080

orderers:
orderer.example.com:
url: grpcs://localhost:7050
grpcOptions:
ssl-target-name-override: orderer.example.com
orderer-api.127-0-0-1.nip.io:8080:
url: grpcs://orderer-api.127-0-0-1.nip.io:8080
tlsCACerts:
path: ./fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
path: './_cfg/uf/_msp/tls/orderer/tlsca-orderer-cert.pem'

peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
org1peer-api.127-0-0-1.nip.io:8080:
url: grpcs://org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
path: './_cfg/uf/_msp/tls/org1peer/tlsca-org1peer-cert.pem'

peer0.org2.example.com:
url: grpcs://localhost:9051
org2peer-api.127-0-0-1.nip.io:8080:
url: grpcs://org2peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem
path: './_cfg/uf/_msp/tls/org2peer/tlsca-org2peer-cert.pem'

channels:
mychannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
yourchannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/cert.pem'
connectionProfile:
path: './ccp-org1.yaml'
discover: false

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/cert.pem'
connectionProfile:
path: './ccp-org2.yaml'
discover: false
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ monitors:
- module: docker
options:
interval: 4
containers: ['peer0.org1.example.com', 'peer0.org2.example.com', 'orderer0.example.com', 'orderer1.example.com']
containers: ['microfab']
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/cert.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml'
path: '../_cfg/uf/_gateways/org1gateway.json'
discover: true

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/cert.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml'
path: '../_cfg/uf/_gateways/org2gateway.json'
discover: true
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/cert.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml'
path: '../_cfg/uf/_gateways/org1gateway.json'
discover: true

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/cert.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml'
path: '../_cfg/uf/_gateways/org2gateway.json'
discover: true
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ monitors:
- module: docker
options:
interval: 4
containers: ['peer0.org1.example.com', 'peer0.org2.example.com', 'orderer0.example.com', 'orderer1.example.com']
containers: ['org1peer-api.127-0-0-1.nip.io:8080', 'org2peer-api.127-0-0-1.nip.io:8080', 'orderer-api.127-0-0-1.nip.io:8080']

Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,29 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/cert.pem'
peers:
- endpoint: localhost:7051
- endpoint: org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem
path: '../_cfg/uf/_msp/tls/org1peer/tlsca-org1peer-cert.pem'

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]cert.pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/cert.pem'
peers:
- endpoint: localhost:9051
- endpoint: org2peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem
path: '../_cfg/uf/_msp/tls/org2peer/tlsca-org2peer-cert.pem'
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MarblesQueryByChannelWorkload extends WorkloadModuleBase {
channel: this.txIndex % 2 === 0 ? 'mychannel' : 'yourchannel',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 10
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MarblesQueryWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 10
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ scrape_configs:
- job_name: 'prometheus'
honor_labels: true # Retain labels, as within PushGateway use
static_configs:
- targets: ['prometheus:9090', 'pushGateway:9091','peer0.org1.example.com:9000', 'peer0.org2.example.com:9000']
- targets: ['prometheus:9090', 'pushGateway:9091','org1peer-api.127-0-0-1.nip.io:8080', 'org2peer-api.127-0-0-1.nip.io:8080']

- job_name: cadvisor
scrape_interval: 1s
static_configs:
- targets: ['cadvisor:8080']
- targets: ['cadvisor:8888']
4 changes: 2 additions & 2 deletions packages/caliper-tests-integration/fabric_tests/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class MarblesQueryWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
targetPeers: ['peer0.org1.example.com'],
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
targetPeers: ['org1peer-api.127-0-0-1.nip.io:8080'],
timeout: 10
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class MarblesQueryByChannelWorkload extends WorkloadModuleBase {
channel: this.txIndex % 2 === 0 ? 'mychannel' : 'yourchannel',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
targetPeers: ['peer0.org1.example.com'],
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
targetPeers: ['org1peer-api.127-0-0-1.nip.io:8080'],
timeout: 10
};

Expand Down
Loading

0 comments on commit 151dddf

Please sign in to comment.