2

I'm new to Hyperledger and trying to use Hyperledger Caliper v0.3.2 as benchmark tool to test Fabric v1.3. I followed two official tutorials: https://hyperledger-fabric.readthedocs.io/en/release-1.3/build_network.html and https://hyperledger.github.io/caliper/v0.3.2/fabric-tutorial/tutorials-fabric-existing/

Now I have successfully instantiated fabcar chaincode and the query is successful in peer0.org1 as follows

peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'

However when I run caliper, it gives me error [Channel.js]: Channel:mychannel received discovery error:access denied and details are as follows:

2021-03-17T10:34:45.736Z - error: [Channel.js]: Channel:mychannel received discovery error:access denied
2021-03-17T10:34:45.737Z - error: [Channel.js]: Error: Channel:mychannel Discovery error:access denied
2021-03-17T10:34:45.737Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
2021.03.17-18:34:45.737 info  [caliper] [caliper-local-client]  Client[1] encountered an error during prepare test phase: Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
    at Network._initializeInternalChannel (/usr/local/lib/node_modules/fabric-network/lib/network.js:119:12)
    at <anonymous>
2021.03.17-18:34:45.738 info  [caliper] [caliper-local-client]  Info: client 1 prepare test :Template callbackphase complete
2021.03.17-18:34:45.739 error [caliper] [round-orchestrator]    Failed round 1 (queryAsset): Error: Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
    at WorkerOrchestrator.updateWorkerPhase (/usr/local/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:211:61)
    at WorkerOrchestrator.processWorkerUpdate (/usr/local/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/worker-orchestrator.js:124:18)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/common/messaging/process-master.js:51:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at emit (internal/child_process.js:772:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
2021.03.17-18:34:45.739 info  [caliper] [report-builder]    ### All test results ###
2021.03.17-18:34:45.740 error [caliper] [report-builder]    No data within test result; implies error within configuration files
2021.03.17-18:34:45.740 error [caliper] [round-orchestrator]    Error while finalizing the report: Error: unrecognized report table
    at ReportBuilder.setSummaryTable (/usr/local/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/master/report/report-builder.js:142:19)
    at Report.printResultsByRound (/usr/local/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/master/report/report.js:254:28)
    at RoundOrchestrator.run (/usr/local/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/master/orchestrators/round-orchestrator.js:221:25)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
2021.03.17-18:34:45.741 info  [caliper] [monitor.js]    Stopping all monitors
2021.03.17-18:34:45.741 info  [caliper] [worker-orchestrator]   Sending exit message to connected workers
2021.03.17-18:34:45.741 info  [caliper] [round-orchestrator]    Benchmark finished in 7.58 seconds. Total rounds: 1. Successful rounds: 0. Failed rounds: 1.
2021.03.17-18:34:45.741 info  [caliper] [caliper-engine]    Skipping end command due to benchmark flow conditioning
2021.03.17-18:34:45.742 info  [caliper] [cli-launch-master]     Benchmark successfully finished
2021.03.17-18:34:45.743 error [caliper] [message-handler]   Handled unsuccessful "prepare" message for worker 1 and test round 0 with error Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:mychannel Discovery error:access denied
    at Network._initializeInternalChannel (/usr/local/lib/node_modules/fabric-network/lib/network.js:119:12)
    at <anonymous>
2021.03.17-18:34:45.743 info  [caliper] [message-handler]   Handling "exit" message
2021.03.17-18:34:45.743 info  [caliper] [message-handler]   Handled "exit" message for worker 1, exiting process
zch@zch:~/go/src/caliper-workspace$ 2021.03.17-18:34:45.793 info  [caliper] [message-handler]   Handling "exit" message
2021.03.17-18:34:45.794 info  [caliper] [message-handler]   Handled "exit" message for worker 0, exiting process

I built the network with my-config.yaml using ./byfn.sh generate -f my-config.yaml and ./byfn.sh up -f my-config.yaml:

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

version: '2'

volumes:
  orderer.example.com:
  peer0.org1.example.com:
  peer1.org1.example.com:
  peer0.org2.example.com:
  peer1.org2.example.com:

networks:
  byfn:
services:
  ca0:
    image: hyperledger/fabric-ca:$IMAGE_TAG
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca-org1
      - FABRIC_CA_SERVER_TLS_ENABLED=true
      - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
      # change the corresponding sk file name! {hash}_sk -> CA1_PRIVATE_KEY
      - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY
    ports:
      - "7054:7054"
    command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/CA1_PRIVATE_KEY -b admin:adminpw -d'
    volumes:
      - ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
    container_name: ca_peerOrg1
    networks:
      - byfn

  ca1:
    image: hyperledger/fabric-ca:$IMAGE_TAG
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca-org2
      - FABRIC_CA_SERVER_TLS_ENABLED=true
      - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
      # change the corresponding sk file name! {hash}_sk -> CA2_PRIVATE_KEY
      - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA2_PRIVATE_KEY
    ports:
      - "8054:7054"
    command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/CA2_PRIVATE_KEY -b admin:adminpw -d'
    volumes:
      - ./crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
    container_name: ca_peerOrg2
    networks:
      - byfn

  orderer.example.com:
    extends:
      file:   base/docker-compose-base.yaml
      service: orderer.example.com
    container_name: orderer.example.com
    networks:
      - byfn
    environment:
      - GODEBUG=netdns=go

  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.org1.example.com
    networks:
      - byfn
    environment:
      - GODEBUG=netdns=go

  peer1.org1.example.com:
    container_name: peer1.org1.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer1.org1.example.com
    networks:
      - byfn
    environment:
      - GODEBUG=netdns=go

  peer0.org2.example.com:
    container_name: peer0.org2.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.org2.example.com
    networks:
      - byfn
    environment:
      - GODEBUG=netdns=go

  peer1.org2.example.com:
    container_name: peer1.org2.example.com
    extends:
      file:  base/docker-compose-base.yaml
      service: peer1.org2.example.com
    networks:
      - byfn
    environment:
      - GODEBUG=netdns=go

  cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    environment:
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      #- CORE_LOGGING_LEVEL=DEBUG
      - CORE_LOGGING_LEVEL=INFO
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
      - GODEBUG=netdns=go
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
        - /var/run/:/host/var/run/
        - ./../chaincode/:/opt/gopath/src/github.com/chaincode
        - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
        - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
        - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
    depends_on:
      - orderer.example.com
      - peer0.org1.example.com
      - peer1.org1.example.com
      - peer0.org2.example.com
      - peer1.org2.example.com
    networks:
      - byfn

and the docker status is like below after I deploy fabcar manually:

zch@zch:~/go/src/fabric-samples/first-network$ docker ps -a
CONTAINER ID   IMAGE                                                                                                    COMMAND                  CREATED          STATUS          PORTS                                              NAMES
4fcb496b031f   dev-peer0.org1.example.com-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba   "chaincode -peer.add…"   14 minutes ago   Up 14 minutes                                                      dev-peer0.org1.example.com-fabcar-1.0
d10866fc9da4   dev-peer0.org2.example.com-fabcar-1.0-264b0a1cb5efbecaac5cf8990339c24474dc8435c6e10f10f2be565d555d0e94   "chaincode -peer.add…"   14 minutes ago   Up 14 minutes                                                      dev-peer0.org2.example.com-fabcar-1.0
da7d865f96f6   dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab     "chaincode -peer.add…"   16 minutes ago   Up 16 minutes                                                      dev-peer1.org2.example.com-mycc-1.0
1a3f4cca5662   dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9     "chaincode -peer.add…"   16 minutes ago   Up 16 minutes                                                      dev-peer0.org1.example.com-mycc-1.0
e7c307b3adfc   dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b     "chaincode -peer.add…"   16 minutes ago   Up 16 minutes                                                      dev-peer0.org2.example.com-mycc-1.0
c288f83482b5   hyperledger/fabric-tools:latest                                                                          "/bin/bash"              17 minutes ago   Up 17 minutes                                                      cli
3f49cc3ff53d   hyperledger/fabric-peer:latest                                                                           "peer node start"        17 minutes ago   Up 17 minutes   0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp   peer1.org2.example.com
986e2c96a8e7   hyperledger/fabric-ca:latest                                                                             "sh -c 'fabric-ca-se…"   17 minutes ago   Up 17 minutes   0.0.0.0:7054->7054/tcp                             ca_peerOrg1
b64e2b93d37f   hyperledger/fabric-peer:latest                                                                           "peer node start"        17 minutes ago   Up 17 minutes   0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp     peer0.org1.example.com
befd47bd74be   hyperledger/fabric-peer:latest                                                                           "peer node start"        17 minutes ago   Up 17 minutes   0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp     peer1.org1.example.com
550b37ba6cf7   hyperledger/fabric-ca:latest                                                                             "sh -c 'fabric-ca-se…"   17 minutes ago   Up 17 minutes   0.0.0.0:8054->7054/tcp                             ca_peerOrg2
167406b02860   hyperledger/fabric-peer:latest                                                                           "peer node start"        17 minutes ago   Up 17 minutes   0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp     peer0.org2.example.com
8cb72ecb0c9a   hyperledger/fabric-orderer:latest                                                                        "orderer"                17 minutes ago   Up 17 minutes   0.0.0.0:7050->7050/tcp                             orderer.example.com

I think it may be some config error. So I paste my network_config.json here:

{
    "caliper": {
        "blockchain": "fabric"
    },
    "clients": {
        "Admin@org1.example.com": {
            "client": {
                "credentialStore": {
                    "path": "tmp/hfc-kvs/org1",
                    "cryptoStore": {
                        "path": "tmp/hfc-kvs/org1"
                    }
                },
                "organization": "Org1",
                "clientPrivateKey": {
                    "path": "../fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/key.pem"
                },
                "clientSignedCert": {
                    "path": "../fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"
                },
                "connection": {
                    "timeout": {
                        "peer": {
                            "endorser": "300"
                        }
                    }
                }

            }
        }
    },
    "channels": {
        "mychannel": {
            "created" : true,
            "chaincodes": [
                {
                    "id":"fabcar",
                    "version":"1.0"
                }
            ]
        }
    },
    "name": "test-network-org1",
    "organizations":{
        "Org1": {
            "mspid": "Org1MSP",
            "peers": [
                "peer0.org1.example.com"
            ],
            "certificateAuthorities": [
                "ca.org1.example.com"
            ],
            "adminPrivateKey": {
                "path": "../fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/key.pem"
            },
            "signedCert": {
                "path": "../fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"
            }
        }
    },
    "peers": {
        "peer0.org1.example.com": {
            "url": "grpcs://localhost:7051",
            "tlsCACerts": {
                "path":"../fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem"
            },
            "grpcOptions": {
                "ssl-target-name-override": "peer0.org1.example.com",
                "hostnameOverride": "peer0.org1.example.com"
            }
        }
    },
    "certificateAuthorities": {
        "ca.org1.example.com": {
            "url": "https://localhost:7054",
            "caName": "ca-org1",
            "tlsCACerts": {
                "path":"../fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem"
            },
            "httpOptions": {
                "verify": false
            }
        }
    },
    "version": "1.0"
}

my crypto-congig directory:

zch@zch:~/go/src/fabric-samples/first-network/crypto-config$ tree
.
├── ordererOrganizations
│   └── example.com
│       ├── ca
│       │   ├── ca.example.com-cert.pem
│       │   └── key.pem
│       ├── msp
│       │   ├── admincerts
│       │   │   └── Admin@example.com-cert.pem
│       │   ├── cacerts
│       │   │   └── ca.example.com-cert.pem
│       │   └── tlscacerts
│       │       └── tlsca.example.com-cert.pem
│       ├── orderers
│       │   └── orderer.example.com
│       │       ├── msp
│       │       │   ├── admincerts
│       │       │   │   └── Admin@example.com-cert.pem
│       │       │   ├── cacerts
│       │       │   │   └── ca.example.com-cert.pem
│       │       │   ├── keystore
│       │       │   │   └── key.pem
│       │       │   ├── signcerts
│       │       │   │   └── orderer.example.com-cert.pem
│       │       │   └── tlscacerts
│       │       │       └── tlsca.example.com-cert.pem
│       │       └── tls
│       │           ├── ca.crt
│       │           ├── server.crt
│       │           └── server.key
│       ├── tlsca
│       │   ├── key.pem
│       │   └── tlsca.example.com-cert.pem
│       └── users
│           └── Admin@example.com
│               ├── msp
│               │   ├── admincerts
│               │   │   └── Admin@example.com-cert.pem
│               │   ├── cacerts
│               │   │   └── ca.example.com-cert.pem
│               │   ├── keystore
│               │   │   └── key.pem
│               │   ├── signcerts
│               │   │   └── Admin@example.com-cert.pem
│               │   └── tlscacerts
│               │       └── tlsca.example.com-cert.pem
│               └── tls
│                   ├── ca.crt
│                   ├── client.crt
│                   └── client.key
└── peerOrganizations
    ├── org1.example.com
    │   ├── ca
    │   │   ├── CA1_PRIVATE_KEY
    │   │   └── ca.org1.example.com-cert.pem
    │   ├── msp
    │   │   ├── admincerts
    │   │   │   └── Admin@org1.example.com-cert.pem
    │   │   ├── cacerts
    │   │   │   └── ca.org1.example.com-cert.pem
    │   │   ├── config.yaml
    │   │   └── tlscacerts
    │   │       └── tlsca.org1.example.com-cert.pem
    │   ├── peers
    │   │   ├── peer0.org1.example.com
    │   │   │   ├── msp
    │   │   │   │   ├── admincerts
    │   │   │   │   │   └── Admin@org1.example.com-cert.pem
    │   │   │   │   ├── cacerts
    │   │   │   │   │   └── ca.org1.example.com-cert.pem
    │   │   │   │   ├── config.yaml
    │   │   │   │   ├── keystore
    │   │   │   │   │   └── key.pem
    │   │   │   │   ├── signcerts
    │   │   │   │   │   └── peer0.org1.example.com-cert.pem
    │   │   │   │   └── tlscacerts
    │   │   │   │       └── tlsca.org1.example.com-cert.pem
    │   │   │   └── tls
    │   │   │       ├── ca.crt
    │   │   │       ├── server.crt
    │   │   │       └── server.key
    │   │   └── peer1.org1.example.com
    │   │       ├── msp
    │   │       │   ├── admincerts
    │   │       │   │   └── Admin@org1.example.com-cert.pem
    │   │       │   ├── cacerts
    │   │       │   │   └── ca.org1.example.com-cert.pem
    │   │       │   ├── config.yaml
    │   │       │   ├── keystore
    │   │       │   │   └── key.pem
    │   │       │   ├── signcerts
    │   │       │   │   └── peer1.org1.example.com-cert.pem
    │   │       │   └── tlscacerts
    │   │       │       └── tlsca.org1.example.com-cert.pem
    │   │       └── tls
    │   │           ├── ca.crt
    │   │           ├── server.crt
    │   │           └── server.key
    │   ├── tlsca
    │   │   ├── key.pem
    │   │   └── tlsca.org1.example.com-cert.pem
    │   └── users
    │       ├── Admin@org1.example.com
    │       │   ├── msp
    │       │   │   ├── admincerts
    │       │   │   │   └── Admin@org1.example.com-cert.pem
    │       │   │   ├── cacerts
    │       │   │   │   └── ca.org1.example.com-cert.pem
    │       │   │   ├── keystore
    │       │   │   │   └── key.pem
    │       │   │   ├── signcerts
    │       │   │   │   └── Admin@org1.example.com-cert.pem
    │       │   │   └── tlscacerts
    │       │   │       └── tlsca.org1.example.com-cert.pem
    │       │   └── tls
    │       │       ├── ca.crt
    │       │       ├── client.crt
    │       │       └── client.key
    │       └── User1@org1.example.com
    │           ├── msp
    │           │   ├── admincerts
    │           │   │   └── User1@org1.example.com-cert.pem
    │           │   ├── cacerts
    │           │   │   └── ca.org1.example.com-cert.pem
    │           │   ├── keystore
    │           │   │   └── key.pem
    │           │   ├── signcerts
    │           │   │   └── User1@org1.example.com-cert.pem
    │           │   └── tlscacerts
    │           │       └── tlsca.org1.example.com-cert.pem
    │           └── tls
    │               ├── ca.crt
    │               ├── client.crt
    │               └── client.key
    └── org2.example.com
        ├── ca
        │   ├── CA2_PRIVATE_KEY
        │   └── ca.org2.example.com-cert.pem
        ├── msp
        │   ├── admincerts
        │   │   └── Admin@org2.example.com-cert.pem
        │   ├── cacerts
        │   │   └── ca.org2.example.com-cert.pem
        │   ├── config.yaml
        │   └── tlscacerts
        │       └── tlsca.org2.example.com-cert.pem
        ├── peers
        │   ├── peer0.org2.example.com
        │   │   ├── msp
        │   │   │   ├── admincerts
        │   │   │   │   └── Admin@org2.example.com-cert.pem
        │   │   │   ├── cacerts
        │   │   │   │   └── ca.org2.example.com-cert.pem
        │   │   │   ├── config.yaml
        │   │   │   ├── keystore
        │   │   │   │   └── key.pem
        │   │   │   ├── signcerts
        │   │   │   │   └── peer0.org2.example.com-cert.pem
        │   │   │   └── tlscacerts
        │   │   │       └── tlsca.org2.example.com-cert.pem
        │   │   └── tls
        │   │       ├── ca.crt
        │   │       ├── server.crt
        │   │       └── server.key
        │   └── peer1.org2.example.com
        │       ├── msp
        │       │   ├── admincerts
        │       │   │   └── Admin@org2.example.com-cert.pem
        │       │   ├── cacerts
        │       │   │   └── ca.org2.example.com-cert.pem
        │       │   ├── config.yaml
        │       │   ├── keystore
        │       │   │   └── key.pem
        │       │   ├── signcerts
        │       │   │   └── peer1.org2.example.com-cert.pem
        │       │   └── tlscacerts
        │       │       └── tlsca.org2.example.com-cert.pem
        │       └── tls
        │           ├── ca.crt
        │           ├── server.crt
        │           └── server.key
        ├── tlsca
        │   ├── key.pem
        │   └── tlsca.org2.example.com-cert.pem
        └── users
            ├── Admin@org2.example.com
            │   ├── msp
            │   │   ├── admincerts
            │   │   │   └── Admin@org2.example.com-cert.pem
            │   │   ├── cacerts
            │   │   │   └── ca.org2.example.com-cert.pem
            │   │   ├── keystore
            │   │   │   └── key.pem
            │   │   ├── signcerts
            │   │   │   └── Admin@org2.example.com-cert.pem
            │   │   └── tlscacerts
            │   │       └── tlsca.org2.example.com-cert.pem
            │   └── tls
            │       ├── ca.crt
            │       ├── client.crt
            │       └── client.key
            └── User1@org2.example.com
                ├── msp
                │   ├── admincerts
                │   │   └── User1@org2.example.com-cert.pem
                │   ├── cacerts
                │   │   └── ca.org2.example.com-cert.pem
                │   ├── keystore
                │   │   └── key.pem
                │   ├── signcerts
                │   │   └── User1@org2.example.com-cert.pem
                │   └── tlscacerts
                │       └── tlsca.org2.example.com-cert.pem
                └── tls
                    ├── ca.crt
                    ├── client.crt
                    └── client.key

109 directories, 107 files

Are my configuration correct? Especially the two tlsCACerts? Hope you guys can point out where I'm wrong, or instruct me to find specific errors. I'll appreciate that.

zch
  • 21
  • 5
  • 1) look if u already ve wallet folder(dont look like), if u ve, delete it 2) be care about ports 3)be care about paths – Luis Bote Mar 17 '21 at 11:26
  • @LuisBote Thanks for your comment. I'm sure I didn't use wallet, however, I'm not sure about the ports and paths, especially two `tlsCACerts` paths in `certificateAuthorities` and `peers` :( So could you please point out wheter my config is correct based on the tree of `crypto-config`? Thank you in advance – zch Mar 18 '21 at 15:47
  • 1)Where its your network_config.json located 2) Did u change something on configs files? 3)Can u bring us your commnads steps to wake up your blockchain? @zch – Luis Bote Mar 18 '21 at 16:38
  • @LuisBote 1) the file is in `networks/network_config.json` 2) I copied form https://hyperledger.github.io/caliper/v0.3.2/fabric-tutorial/tutorials-fabric-existing/#step-3---network-configuration-file changed the certificates' location and chaincode's version. I didn't change other settings. 3) I use this command to bring up caliper test `caliper launch master --caliper-benchconfig benchmarks/myAssetBenchmark.yaml --caliper-networkconfig networks/network_config.json --caliper-workspace ./ --caliper-flow-only-test --caliper-fabric-gateway-usegateway --caliper-fabric-gateway-discovery` – zch Mar 19 '21 at 01:03
  • @LuisBote As for bring up the fabric network, I use `./byfn.sh up -f my-config.yaml` as I mentioned in the question. The I wrote a bash script to setup `fabcar` chaincode, which can be found in https://paste.ubuntu.com/p/ZHSthCmg9Q/ – zch Mar 19 '21 at 01:08
  • I checked the logs in my peer0.org1 container, There are two types of errors: 1)`ERRO 0a4 TLS handshake failed with error EOF {"server": "PeerServer", "remote address": "172.21.0.1:48624"}` 2) `ERRO 0a5 Principal deserialization failure (the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com")) for identity ...` – zch Mar 19 '21 at 01:11
  • That its getting me some ideas, you can invoke but u cant querys? – Luis Bote Mar 19 '21 at 07:14

2 Answers2

0

try it:

    export CORE_PEER_ADDRESS=localhost:7051

edit 1:

As you post error and your sh code, look like peer adrees its badly, so export it to your peer adrees, in your case, 7051

edit 2: Why are u running builds on sudo and server without sudo? this would be probelm, try to run both without sudo, if u cant run without sudo cause u havent acces denied, run:

sudo chmod +x *

You can change it to *.sh or some like that for not grants permissions to all your files

Luis Bote
  • 169
  • 2
  • 13
  • Sorry, I didn't get it. When and where to `export CORE_PEER_ADDRESS=localhost:7051`? Before I `./byfn.sh up -f my-config.yaml` or `caliper launch master --caliper-benchconfig benchmarks/myAssetBenchmark.yaml --caliper-networkconfig networks/network_config.json --caliper-workspace ./ --caliper-flow-only-test --caliper-fabric-gateway-usegateway --caliper-fabric-gateway-discovery`? – zch Mar 19 '21 at 09:33
  • Is there any possible to contact you and we can communicate in real-time? – zch Mar 19 '21 at 09:47
  • Use it before all on your console, to get that var, im not secure that your problem, but could be, try and paste output there – Luis Bote Mar 19 '21 at 09:59
  • This shows whole procedure of 1)generate crypto material 2)bring up fabric network 3)deploy `fabcar` chaincode 4)`cd` to caliper worksapce and begin caliper test: https://paste.ubuntu.com/p/cRGTKSJJT9/ – zch Mar 19 '21 at 10:22
0

Finally I found the problem. I created several Fabric networks, however, the path <caliper-workspace>/tmp stores the earliest crypto configs, so it reports access denied error. To solve it, remove <caliper-workspace>/tmp everytime you run the caliper

zch
  • 21
  • 5