DEVENDRA MEENA
DEVENDRA MEENA

Reputation: 43

Benchmarking with Hyperledger caliper on multi host deployed Hyperledger fabric v1.4.1 network with raft consensus

My hyperledger fabric network is deployed on a private network on 4 servers. Each server has one peer and one orderer. The network is up and running and i want to do benchmarking with hyperledger caliper on the running network. TLS is enabled in the network, and i have given absolute path everywhere.

I changed the urls with the url of servers in both benchmark and network configuration file of caliper. I don't want to create any channel or enroll any admin or install chaincode because i've already done all of that steps. How does one do benchmarking from here ?

  1. My config.yaml file is as follows :
---
test:
  name: drm
  description: Benchmark for DRM scenario
  clients:
    type: local
    number: 1
  rounds:
  - label: publish
    txNumber:
    - 10
    arguments:
      itemBytes: 2048000
    rateControl:
    - type: fixed-rate
      opts:
        tps: 1
    callback: benchmark/drm/publish.js
  - label: query
    txNumber:
    - 10
    rateControl:
    - type: fixed-rate
      opts:
        tps: 1
    callback: benchmark/drm/query.js
monitor:
  type: docker
  docker:
    name:
    - http://172.28.27.54:7053/peer0.org0.example.com
    - http://172.24.144.39:7053/peer0.org1.example.com
    - http://172.27.27.175:7053/peer0.org2.example.com
    - http://172.27.28.58:7053/peer0.org3.example.com
    - http://172.28.27.54:7050/orderer0.example.com
    - http://172.24.144.39:7050/orderer1.example.com
    - http://172.27.27.175:7050/orderer2.example.com
    - http://172.27.28.58:7050/orderer3.example.com
  interval: 1
  1. My fabric-go-tls.json is as follows :
{
  "caliper": {
    "blockchain": "fabric",
    "command" : {
      "start": "echo 'start' ",
      "end" : "echo 'stop'"
    }
  },
  "fabric": {
    "cryptodir": "/home/devk/hl-demo/artifacts/crypto-config",
    "network": {
      "orderer": {
        "url": "grpcs://172.28.57.54:7050",
        "mspid": "ordererMSP",
        "msp": "/home/devk/hl-demo/artifacts/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/",
        "server-hostname": "orderer.example.com",
        "tls_cacerts": "/home/devk/hl-demo/artifacts/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
      },
      "org0": {
        "name": "org0",
        "mspid": "org0MSP",
        "msp": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org0.example.com/msp/",
        "ca": {
          "url": "https://172.28.57.54:7054",
          "name": "ca.org0.example.com"
        },
        "peer1": {
          "requests": "grpcs://172.28.57.54:7051",
          "events": "grpcs://172.28.57.54:7053",
          "server-hostname": "peer0.org0.example.com",
          "tls_cacerts": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org0.example.com/peers/peer0.org0.example.com/tls/ca.crt"
        }
      },
      "org1": {
        "name": "org2",
        "mspid": "org2MSP",
        "msp": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org1.example.com/msp/",
        "ca": {
          "url": "https://172.24.144.39:7054",
          "name": "ca.org1.example.com"
        },
        "peer1": {
          "requests": "grpcs://172.24.144.39:7051",
          "events": "grpcs://172.24.144.39:7053",
          "server-hostname": "peer0.org1.example.com",
          "tls_cacerts": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
        }
      },
      "org2": {
        "name": "org2",
        "mspid": "org2MSP",
        "msp": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org2.example.com/msp/",
        "ca": {
          "url": "https://172.27.27.175:7054",
          "name": "ca.org2.example.com"
        },
        "peer1": {
          "requests": "grpcs://172.27.27.175:7051",
          "events": "grpcs://172.27.27.175:7053",
          "server-hostname": "peer0.org2.example.com",
          "tls_cacerts": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
        }
      },
    "org3": {
        "name": "org3",
        "mspid": "org3MSP",
        "msp": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org3.example.com/msp/",
        "ca": {
          "url": "https://172.27.28.58:7054",
          "name": "ca.org3.example.com"
        },
        "peer1": {
          "requests": "grpcs://172.27.28.58:7051",
          "events": "grpcs://172.27.28.58:7053",
          "server-hostname": "peer0.org3.example.com",
          "tls_cacerts": "/home/devk/hl-demo/artifacts/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt"
        }
      }
    },
    "channel": [
      {
        "name": "common",
        "deployed": false,
        "config": "/home/devk/hl-demo/artifacts/channel/common.tx",
        "organizations": ["org0", "org1", "org2", "org3"]
      }
    ],
    "chaincodes": [
      {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "common"}
    ],
    "endorsement-policy": {
      "identities": [
        {
          "role": {
            "name": "admin",
            "mspId": "org0MSP"
          }
        },
        {
          "role": {
            "name": "member",
            "mspId": "org2MSP"
          }
        },
        {
          "role": {
            "name": "member",
            "mspId": "org2MSP"
          }
        },
        {
          "role": {
            "name": "member",
            "mspId": "org3MSP"
          }
        }
      ],
      "policy": { "4-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}, {"signed-by": 3}]}
    },
    "context": {
      "query": "common"
    }
  },
  "info" : {
    "Version": "1.4.1",
    "Size": "4 Orgs with 1 Peer",
    "Orderer": "etcdraft",
    "Distribution": "Single Host"
  }
}

Expected : Should just run benchmark without creating channel, installing chaincode and enrolling admin...

Actual Results : Stops at [create-channel.js] .

 error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Enrollment failed with errors [[{"code":19,"message":"CA 'ca.org0.example.com' does not exist"}]], stack=Error: Enrollment failed with errors [[{"code":19,"message":"CA 'ca.org0.example.com' does not exist"}]]

But the network is just running fine!! Can anyone explain me, what am i doing wrong here ?

Upvotes: 1

Views: 520

Answers (1)

Attila Klenik
Attila Klenik

Reputation: 763

1) The error message indicates that the name you set for the CA in the config doesn't match the name of the Fabric-CA server. Note, that Fabric-CA servers have a FABRIC_CA_SERVER_CA_NAME setting, and it matters. The two names must match.

2) The released version of Caliper has better support for multi-orderer networks, provided by the new Fabric adapter. Also, an example is provided in the caliper-benchmarks repo.

Upvotes: 0

Related Questions