1

我的超级账本结构网络部署在 4 台服务器上的专用网络上。每个服务器都有一个 peer 和一个 orderer。网络已启动并正在运行,我想在正在运行的网络上使用 hyperledger caliper 进行基准测试。网络中启用了 TLS,我在任何地方都给出了绝对路径。

我在 caliper 的基准和网络配置文件中使用服务器的 url 更改了 url。我不想创建任何频道或注册任何管理员或安装链代码,因为我已经完成了所有这些步骤。如何从这里进行基准测试?

  1. 我的 config.yaml 文件如下:
---
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. 我的 fabric-go-tls.json 如下:
{
  "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"
  }
}

预期:应该只运行基准测试而不创建通道、安装链代码和注册管理员...

实际结果:停在 [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"}]]

但是网络运行正常!!谁能解释一下,我在这里做错了什么?

4

1 回答 1

0

1)错误信息表明name您在配置中为CA设置的名称与Fabric-CA服务器的名称不匹配。请注意,Fabric-CA 服务器有一个FABRIC_CA_SERVER_CA_NAME设置,这很重要。这两个名称必须匹配。

2) Caliper 的发布版本对多阶网络有更好的支持,由新的Fabric 适配器提供。此外, caliper-benchmarks repo中提供了一个示例。

于 2019-10-21T20:18:01.763 回答