使用筏式共识在多主机部署的Hyperledger Fabric v1.4.1网络上使用Hyperledger卡尺进行基准测试

时间:2019-05-18 18:08:59

标签: hyperledger-fabric benchmarking raft hyperledger-caliper

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

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

  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"}]]

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

1 个答案:

答案 0 :(得分:0)

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

2)发行版的Caliper由新的Fabric adapter提供了对多订购者网络的更好支持。另外,caliper-benchmarks存储库中提供了一个示例。