hyperledger / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper/
Apache License 2.0
651 stars 404 forks source link

What I just want to know is that how to test fabric with the Latest version caliper,thank you! #357

Closed dzyand closed 5 years ago

dzyand commented 5 years ago

I have no config.json,fabric.json and so on,how can run 'npm run bench -- -c yourconfig.json -n yournetwork.json' just run an example,i'm just a tiro。

aklenik commented 5 years ago

@dzyand The sample config files are in the benchmark folder, the sample network files are in the network folder. See the documentation page for details, its link is in the description of this repo.

houqinghui commented 5 years ago

@dzyand You can refer to the doc web. It will guide you how to run Cacliper to test the fabric network.

aklenik commented 5 years ago

@dzyand A sample benchmark can be run from the Caliper root directory by the following command (the first two lines install the required Caliper and Fabric SDK dependencies):

npm install
npm run fabric-v1.1-deps
npm run bench -- -c benchmark/simple/config-linear-rate.yaml -n network/fabric-v1.1/dev/fabric-node.json
dzyand commented 5 years ago

@aklenik thank you very much! but error is still..... npm run bench -- -c benchmark/simple/config-linear-rate.yaml -n network/fabric-v1.1/dev/fabric-node.json

caliper@0.1.0 bench /home/dzy/caliper node ./scripts/main.js "-c" "benchmark/simple/config-linear-rate.yaml" "-n" "network/fabric-v1.1/dev/fabric-node.json"

info: [bench-flow.js]: ####### Caliper Test ####### info: [bench-flow.js]: Executing command: docker-compose -f network/fabric-v1.1/dev/docker-compose.yaml up -d;sleep 3s Creating network "dev_default" with the default driver Pulling ca.org1.example.com (hyperledger/fabric-ca:1.1.0)... 1.1.0: Pulling from hyperledger/fabric-ca Digest: sha256:0a81cbc3e8accd8ea6d0b377b3766efbf585c21ef7fe147e2e0f3aa629472e03 Status: Downloaded newer image for hyperledger/fabric-ca:1.1.0 Pulling orderer.example.com (hyperledger/fabric-orderer:1.1.0)... 1.1.0: Pulling from hyperledger/fabric-orderer Digest: sha256:7a0a6ca2bbddff69ddf63615cdddfe46bf5f2fe7c55530a092d597d99bd2a4bb Status: Downloaded newer image for hyperledger/fabric-orderer:1.1.0 Pulling peer0.org1.example.com (hyperledger/fabric-peer:1.1.0)... 1.1.0: Pulling from hyperledger/fabric-peer Digest: sha256:b1d49f180410136f25b3e9283c242cf319f4c8cb27f0ef1d9de532a4dd131afe Status: Downloaded newer image for hyperledger/fabric-peer:1.1.0 Creating ca.org1.example.com ... Creating orderer.example.com ... ### error

ERROR: for orderer.example.com Cannot create container for service orderer.example.com: b'Conflict. The container name "/orderer.example.com" is already in use by container "1bb3c2af4f57c4b81dc47c905b2eb23377f8e9625224148a1a73023e41f94fCreating ca.org1.example.com ... done

e.'

ERROR: for orderer.example.com Cannot create container for service orderer.example.com: b'Conflict. The container name "/orderer.example.com" is already in use by container "1bb3c2af4f57c4b81dc47c905b2eb23377f8e9625224148a1a73023e41f94f1c". You have to remove (or rename) that container to be able to reuse that name.'

Encountered errors while bringing up the project. info: [create-channel.js]: Creating mychannel...

error: [Orderer.js]: sendBroadcast - on error: "Error: 14 UNAVAILABLE: Connect Failed\n at createStatusError (/home/dzy/caliper/node_modules/grpc/src/client.js:64:15)\n at ClientDuplexStream._emitStatusIfDone (/home/dzy/caliper/node_modules/grpc/src/client.js:270:19)\n at ClientDuplexStream._readsDone (/home/dzy/caliper/node_modules/grpc/src/client.js:236:8)\n at readCallback (/home/dzy/caliper/node_modules/grpc/src/client.js:296:12)"

error: [create-channel.js]: Failed to create channels: Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/home/dzy/caliper/node_modules/fabric-client/lib/Orderer.js:136:21) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at ClientDuplexStream._emitStatusIfDone (/home/dzy/caliper/node_modules/grpc/src/client.js:271:12) at ClientDuplexStream._readsDone (/home/dzy/caliper/node_modules/grpc/src/client.js:236:8) at readCallback (/home/dzy/caliper/node_modules/grpc/src/client.js:296:12) error: [fabric.js]: Fabric initialization failed: Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/home/dzy/caliper/node_modules/fabric-client/lib/Orderer.js:136:21) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at ClientDuplexStream._emitStatusIfDone (/home/dzy/caliper/node_modules/grpc/src/client.js:271:12) at ClientDuplexStream._readsDone (/home/dzy/caliper/node_modules/grpc/src/client.js:236:8) at readCallback (/home/dzy/caliper/node_modules/grpc/src/client.js:296:12) error: [bench-flow.js]: Error: Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/home/dzy/caliper/node_modules/fabric-client/lib/Orderer.js:136:21)

My configuration is as follows: dzy@dzy:~/caliper$ node -v v8.15.1 dzy@dzy:~/caliper$ npm -v 6.4.1 dzy@dzy:~/caliper$ docker -v Docker version 18.09.3, build 774a1f4 dzy@dzy:~/caliper$ docker-compose --version docker-compose version 1.22.0, build f46880fe

gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

/usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js

aklenik commented 5 years ago

@dzyand A previous network is interfering with the current run. Stop and remove every container first. Execute this from the root Caliper directory:

docker-compose -f network/fabric-v1.1/dev/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)"
dzyand commented 5 years ago

@aklenik The timeout error 1

aklenik commented 5 years ago

@dzyand Try to remove the chaincodes you don't need from the network configuration file. If you test a local network, it can consume some resources, and each chaincode means an extra container per peer.

quangtdn commented 5 years ago

Hi @aklenik , I tried your command and got this error:

info: [bench-flow.js]: ####### Caliper Test ####### error: [scripts/main.js]: Error while executing the benchmark: Error: Failed to load gRPC binary module because it was not installed for the current system Expected directory: node-v64-linux-x64-glibc Found: [node-v57-linux-x64-glibc]

I already tried 'npm rebuild' but it didn't fix it.

I think there is some conflict in version here. Perhaps do you know how to fix it?

Thank you.

Edit: I manage to fix it alr. I downgraded my npm to version 5.6.0 and node to 8.9.4. I hope this may help someone needing it.

aklenik commented 5 years ago

@quangtdn Node.js 10.x is not supported currently, so use 8.x with Caliper (the nvm tools makes it easy to manage multiple Node.js versions).

@dzyand Did you succeed in running your benchmark?

quangtdn commented 5 years ago

Hi @aklenik , I am now trying to benchmark a distributed HP network. I managed to bring up a simple network on 2 computers already, so I am now going to use Caliper to benchmark such network.

As far as I understand, I just need to modify the port endpoints in fabric.json and put the link to my config files in fabric.json (instead of the default link to config directories under the file 'network'). Is it the right approach?

And I notice that for some url/endpoints in the fabric.json file, e.g. "grpc://localhost:7051", there is the 'grpc' here. May I ask what it does? In case I put my port address here, should I still keep that 'grpc' to make it something like "grpc:172.18.0.1"?

Lastly, when I brought up the network on 2 computers (by following some article), I needed to use docker swarm to create an overlay network over the 2 computers. May I ask whether putting the port addresses into the fabric.json is enough for my Caliper to connect to such HP network and run the benchmarking? I think I may also need to let my Caliper computer to join the overlay network mentioned above.

I am sorry for asking quite much, as the doc just mostly covers bringing up a local HP network, and the resource for these things is perhaps quite limited.

Thank you much!

aklenik commented 5 years ago

@quangtdn

As far as I understand, I just need to modify the port endpoints in fabric.json and put the link to my config files in fabric.json (instead of the default link to config directories under the file 'network'). Is it the right approach?

Yes, that approach is correct

And I notice that for some url/endpoints in the fabric.json file, e.g. "grpc://localhost:7051", there is the 'grpc' here. May I ask what it does?

It specifies the protocol to use for the communication. Peer and orderer nodes expose GRPC endpoints (or GRPCs if using TLS) while CAs expose HHTP/HTTPs endpoints. The endpoint protocol in your config file must match what is configured on the server-side.

I think I may also need to let my Caliper computer to join the overlay network mentioned above.

Yes, the machine running Caliper must be able to reach the endpoints specified in the config file. You can ensure this in numerous ways: using public IPs, putting the machines on the same private subnetwork, or any other network magic :)

quangtdn commented 5 years ago

Thanks @aklenik , I will try to work it out.

quangtdn commented 5 years ago

Hi @aklenik , I was trying to modify the port addresses and use the link to my HP config files (i.e. crypto-config, and channel-artifacts). I brought up a HP network separately by myself (instead of docker-compose.yaml up) and ran Caliper to benchmark it. Then I got this error: (the program successfully installed the chaincodes, but then failed to instantiate chaincodes)

info: [bench-flow.js]: ####### Caliper Test ####### info: [create-channel.js]: Creating mychannel... info: [create-channel.js]: Created mychannel successfully info: [create-channel.js]: Sleeping 5s... info: [join-channel.js]: Joining channels... info: [join-channel.js]: Joining organization org1 to channel mychannel... info: [join-channel.js]: Successfully joined peerOrg1's peers to mychannel info: [join-channel.js]: Successfully joined mychannel info: [install-chaincode.js]: installing all chaincodes...... info: [install-chaincode.js]: Installing chaincode marbles... info: [packager/Node.js]: packaging Node from /home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/contract/fabric/marbles-norichquery/node info: [install-chaincode.js]: Installed chaincode marbles successfully in all peers info: [install-chaincode.js]: Installing chaincode simple... info: [packager/Node.js]: packaging Node from /home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/contract/fabric/simple/node info: [install-chaincode.js]: Installed chaincode simple successfully in all peers info: [instantiate-chaincode.js]: Instantiating chaincodes... error: [e2eUtils.js]: Failed to send instantiate transaction and get notifications within the timeout period. error: [instantiate-chaincode.js]: Failed to instantiate chaincodes: Error: The event hub has not been connected to the event source at EventHub._checkConnection (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:487:11) at EventHub.registerTxEvent (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:721:8) at Promise (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:595:20) at new Promise () at eventhubs.forEach (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:592:29) at Array.forEach () at instantiateLegacy (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:591:19) at error: [fabric.js]: Fabric chaincode install failed: Error: The event hub has not been connected to the event source at EventHub._checkConnection (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:487:11) at EventHub.registerTxEvent (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:721:8) at Promise (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:595:20) at new Promise () at eventhubs.forEach (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:592:29) at Array.forEach () at instantiateLegacy (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:591:19) at error: [bench-flow.js]: Error: Error: The event hub has not been connected to the event source at EventHub._checkConnection (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:487:11) at EventHub.registerTxEvent (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:721:8) at Promise (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:595:20) at new Promise () at eventhubs.forEach (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:592:29) at Array.forEach () at instantiateLegacy (/home/nguyenminhquang/go-1.11.5/src/github.com/hyperledger/caliper/src/adapters/fabric/e2eUtils.js:591:19) at info: [demo.js]: [Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0 info: [bench-flow.js]:

#######################################

Test summary: 0 succeeded, 0 failed

#######################################

info: [scripts/main.js]: Benchmark run successfully

Do you have any idea about this?

aklenik commented 5 years ago

@quangtdn Can you check the peer logs to see what caused the event hubs to disconnect?

quangtdn commented 5 years ago

@aklenik I have 2 peers in this network. I look at all the logs and it seems that there is no error pop-up in any log. Anyway, here is the log of one of the peer (the other seems similar):

2019-03-14 19:46:04.075 UTC [ledgermgmt] initialize -> INFO 003 Initializing ledger mgmt 2019-03-14 19:46:04.075 UTC [kvledger] NewProvider -> INFO 004 Initializing ledger provider 2019-03-14 19:46:04.198 UTC [kvledger] NewProvider -> INFO 005 ledger provider Initialized 2019-03-14 19:46:04.418 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 006 Created state database replicator 2019-03-14 19:46:04.419 UTC [ledgermgmt] initialize -> INFO 007 ledger mgmt initialized 2019-03-14 19:46:04.420 UTC [peer] func1 -> INFO 008 Auto-detected peer address: 10.0.0.9:7051 2019-03-14 19:46:04.420 UTC [peer] func1 -> INFO 009 Host is 0.0.0.0 , falling back to auto-detected address: 10.0.0.9:7051 2019-03-14 19:46:04.421 UTC [peer] func1 -> INFO 00a Auto-detected peer address: 10.0.0.9:7051 2019-03-14 19:46:04.421 UTC [peer] func1 -> INFO 00b Host is 0.0.0.0 , falling back to auto-detected address: 10.0.0.9:7051 2019-03-14 19:46:04.425 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00c Entering computeChaincodeEndpoint with peerHostname: 10.0.0.9 2019-03-14 19:46:04.426 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00d Exit with ccEndpoint: 10.0.0.9:7052 2019-03-14 19:46:04.427 UTC [nodeCmd] createChaincodeServer -> WARN 00e peer.chaincodeListenAddress is not set, using 10.0.0.9:7052 2019-03-14 19:46:04.429 UTC [sccapi] registerSysCC -> INFO 00f system chaincode lscc(github.com/hyperledger/fabric/core/scc/lscc) registered 2019-03-14 19:46:04.430 UTC [sccapi] registerSysCC -> INFO 010 system chaincode cscc(github.com/hyperledger/fabric/core/scc/cscc) registered 2019-03-14 19:46:04.430 UTC [sccapi] registerSysCC -> INFO 011 system chaincode qscc(github.com/hyperledger/fabric/core/scc/qscc) registered 2019-03-14 19:46:04.431 UTC [sccapi] registerSysCC -> INFO 012 system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle,true) disabled 2019-03-14 19:46:04.434 UTC [gossip.service] func1 -> INFO 013 Initialize gossip with endpoint 10.0.0.9:7051 and bootstrap set [peer0.org1.example.com:7051] 2019-03-14 19:46:04.446 UTC [gossip.gossip] NewGossipService -> INFO 014 Creating gossip service with self membership of Endpoint: peer1.org1.example.com:7051, InternalEndpoint: 10.0.0.9:7051, PKI-ID: ab4abf1d7cbf206b37d3673e368d579f038c1086d5164a5f567a806e50aca995, Metadata: 2019-03-14 19:46:04.447 UTC [gossip.gossip] start -> INFO 015 Gossip instance 10.0.0.9:7051 started 2019-03-14 19:46:04.454 UTC [sccapi] deploySysCC -> INFO 016 system chaincode lscc/(github.com/hyperledger/fabric/core/scc/lscc) deployed 2019-03-14 19:46:04.455 UTC [cscc] Init -> INFO 017 Init CSCC 2019-03-14 19:46:04.455 UTC [sccapi] deploySysCC -> INFO 018 system chaincode cscc/(github.com/hyperledger/fabric/core/scc/cscc) deployed 2019-03-14 19:46:04.455 UTC [qscc] Init -> INFO 019 Init QSCC 2019-03-14 19:46:04.455 UTC [sccapi] deploySysCC -> INFO 01a system chaincode qscc/(github.com/hyperledger/fabric/core/scc/qscc) deployed 2019-03-14 19:46:04.455 UTC [sccapi] deploySysCC -> INFO 01b system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle) disabled 2019-03-14 19:46:04.455 UTC [nodeCmd] serve -> INFO 01c Deployed system chaincodes 2019-03-14 19:46:04.459 UTC [discovery] NewService -> INFO 01d Created with config TLS: false, authCacheMaxSize: 1000, authCachePurgeRatio: 0.750000 2019-03-14 19:46:04.459 UTC [nodeCmd] registerDiscoveryService -> INFO 01e Discovery service activated 2019-03-14 19:46:04.459 UTC [nodeCmd] serve -> INFO 01f Starting peer with ID=[name:"peer1.org1.example.com" ], network ID=[peer1.org1.example.com], address=[10.0.0.9:7051] 2019-03-14 19:46:04.459 UTC [nodeCmd] serve -> INFO 020 Started peer with ID=[name:"peer1.org1.example.com" ], network ID=[peer1.org1.example.com], address=[10.0.0.9:7051] 2019-03-14 19:46:04.460 UTC [nodeCmd] func8 -> INFO 021 Starting profiling server with listenAddress = 0.0.0.0:6060 2019-03-14 19:47:58.308 UTC [endorser] callChaincode -> INFO 022 [][ca327164] Entry chaincode: name:"cscc" 2019-03-14 19:47:58.309 UTC [ledgermgmt] CreateLedger -> INFO 023 Creating ledger [mychannel] with genesis block 2019-03-14 19:47:58.313 UTC [fsblkstorage] newBlockfileMgr -> INFO 024 Getting block information from block storage 2019-03-14 19:47:58.389 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 025 Created state database mychannel 2019-03-14 19:47:58.635 UTC [kvledger] CommitWithPvtData -> INFO 026 [mychannel] Committed block [0] with 1 transaction(s) in 237ms (state_validation=0ms block_commit=35ms state_commit=196ms) 2019-03-14 19:47:58.641 UTC [ledgermgmt] CreateLedger -> INFO 027 Created ledger [mychannel] with genesis block 2019-03-14 19:47:58.681 UTC [gossip.gossip] JoinChan -> INFO 028 Joining gossip network of channel mychannel with 1 organizations 2019-03-14 19:47:58.681 UTC [gossip.gossip] learnAnchorPeers -> INFO 029 No configured anchor peers of Org1MSP for channel mychannel to learn about 2019-03-14 19:47:58.709 UTC [gossip.state] NewGossipStateProvider -> INFO 02a Updating metadata information, current ledger sequence is at = 0, next expected block is = 1 2019-03-14 19:47:58.718 UTC [sccapi] deploySysCC -> INFO 02b system chaincode lscc/mychannel(github.com/hyperledger/fabric/core/scc/lscc) deployed 2019-03-14 19:47:58.719 UTC [cscc] Init -> INFO 02c Init CSCC 2019-03-14 19:47:58.719 UTC [sccapi] deploySysCC -> INFO 02d system chaincode cscc/mychannel(github.com/hyperledger/fabric/core/scc/cscc) deployed 2019-03-14 19:47:58.719 UTC [qscc] Init -> INFO 02e Init QSCC 2019-03-14 19:47:58.719 UTC [sccapi] deploySysCC -> INFO 02f system chaincode qscc/mychannel(github.com/hyperledger/fabric/core/scc/qscc) deployed 2019-03-14 19:47:58.720 UTC [sccapi] deploySysCC -> INFO 030 system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle) disabled 2019-03-14 19:47:58.722 UTC [endorser] callChaincode -> INFO 031 [][ca327164] Exit chaincode: name:"cscc" (414ms) 2019-03-14 19:47:58.722 UTC [comm.grpc.server] 1 -> INFO 032 unary call completed {"grpc.start_time": "2019-03-14T19:47:58.287Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "192.168.1.109:37348", "grpc.code": "OK", "grpc.call_duration": "434.981225ms"} 2019-03-14 19:47:58.835 UTC [endorser] callChaincode -> INFO 033 [][f6771c1d] Entry chaincode: name:"lscc" 2019-03-14 19:47:58.906 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 034 Created state database mychannel_lscc 2019-03-14 19:47:58.937 UTC [lscc] executeInstall -> INFO 035 Installed Chaincode [marbles] Version [v1] to peer 2019-03-14 19:47:58.938 UTC [endorser] callChaincode -> INFO 036 [][f6771c1d] Exit chaincode: name:"lscc" (102ms) 2019-03-14 19:47:58.938 UTC [comm.grpc.server] 1 -> INFO 037 unary call completed {"grpc.start_time": "2019-03-14T19:47:58.835Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "192.168.1.109:37348", "grpc.code": "OK", "grpc.call_duration": "103.185404ms"} 2019-03-14 19:47:58.991 UTC [endorser] callChaincode -> INFO 038 [][3d198ae8] Entry chaincode: name:"lscc" 2019-03-14 19:47:58.995 UTC [lscc] executeInstall -> INFO 039 Installed Chaincode [simple] Version [v0] to peer 2019-03-14 19:47:58.995 UTC [endorser] callChaincode -> INFO 03a [][3d198ae8] Exit chaincode: name:"lscc" (4ms) 2019-03-14 19:47:58.995 UTC [comm.grpc.server] 1 -> INFO 03b unary call completed {"grpc.start_time": "2019-03-14T19:47:58.988Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "192.168.1.109:37354", "grpc.code": "OK", "grpc.call_duration": "6.812779ms"} 2019-03-14 19:47:59.131 UTC [endorser] callChaincode -> INFO 03c [mychannel][1425efc0] Entry chaincode: name:"lscc" 2019-03-14 19:48:02.873 UTC [endorser] callChaincode -> INFO 03d [mychannel][1425efc0] Exit chaincode: name:"lscc" (3743ms) 2019-03-14 19:48:02.874 UTC [comm.grpc.server] 1 -> INFO 03e unary call completed {"grpc.start_time": "2019-03-14T19:47:59.129Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "192.168.1.109:37354", "grpc.code": "OK", "grpc.call_duration": "3.744665343s"} 2019-03-14 19:48:03.681 UTC [gossip.channel] reportMembershipChanges -> INFO 03f Membership view has changed. peers went online: [[peer0.org1.example.com:7051 10.0.0.6:7051]] , current view: [[peer0.org1.example.com:7051 10.0.0.6:7051]]

dzyand commented 5 years ago

@quangtdn Node.js 10.x is not supported currently, so use 8.x with Caliper (the nvm tools makes it easy to manage multiple Node.js versions).

@dzyand Did you succeed in running your benchmark? @aklenik Yes!Thank you very much! And I’m trying to run a built network.By the way,can I test and improve the Gossip protocol?

quangtdn commented 5 years ago

@aklenik I think I found my problem already. Because I create an overlay network called "my-net" for inter-connection between computers, any command that wants to touch my Hyperledger Fabric network should have the tag --network="my-net". For example:

docker run --rm -it --network="my-net" --link orderer.example.com:orderer.example.com .........

Maybe as the commands within the testing engine of Caliper are not provided with such tag, Caliper cannot connect to the overlay network but it can still touch the ports.

May I ask if there is anyway that may help here?

Thank you!

aklenik commented 5 years ago

@dzyand Great! If you mean the gossip protocol in Fabric, that's not Caliper-related. Maybe you could measure it's performance somehow, but that's not the goal of Caliper.

@quangtdn Caliper doesn't use docker commands to interact with the network, just IPs and ports. The correct routing must be ensured by you. Could you check whether this error also occurs with the Fabric CCP adapter? Here are the docs, should be quite similar: https://hyperledger.github.io/caliper/docs/Fabric_Ccp_Configuration.html

dzyand commented 5 years ago

@dzyand Great! If you mean the gossip protocol in Fabric, that's not Caliper-related. Maybe you could measure it's performance somehow, but that's not the goal of Caliper.

@quangtdn Caliper doesn't use docker commands to interact with the network, just IPs and ports. The correct routing must be ensured by you. Could you check whether this error also occurs with the Fabric CCP adapter? Here are the docs, should be quite similar: https://hyperledger.github.io/caliper/docs/Fabric_Ccp_Configuration.html

@aklenik OK!I'll give it a try.Thank you again for your help.

quangtdn commented 5 years ago

@aklenik After lots of time and trials, I figure out that in short docker swarm hinders Caliper from accessing the computer's ports. In normal settings without such docker swarm, Caliper should work fine. I tried a simple experiment that I should have done much earlier: I brought up a Fabric network on PC1 (I used the 2org1peergoleveldb), then ran Caliper on PC2 to benchmark the network on PC1. Caliper just worked perfectly fine.

I guess I have to find another way to bring up fabric network on multiple PCs.

Anyway, thank you very much and have nice weekend :) !

aklenik commented 5 years ago

@quangtdn Someone also brought this problem to our attention. Could you describe the exact limitations and whether you found a workaround?

quangtdn commented 5 years ago

@aklenik I don't remember exactly everything, but I got a bunch of relating errors: error instantiating after successful installation of chaincodes, or error running the test after successful instantiation of chaincodes. If the person you mentioned just deployed on localhost, then probably (s)he may mis-configure something in fabric.json file (forget to modify the 'context' field after adding/removing chaincodes in fabric.json). For many times, I got such errors just because of misconfiguring fabric.json.

Edit: If (s)he deploys it on distributed fabric network, it can be potentially the conflicts in port mappings.