unable to test hyperledger/fabric-samples/first-network using this tool #40
Description
how and which files do i need to edit to run the benchmark test for hyperledger/fabric-samples/first-network can you please update?
i have edited caliper/benchmark/simple/config.json like below,
"command" : {
"start": "command to start the first-network test",
"end": "command to stop"
},
and when i run the test, i got error as below
#node benchmark/simple/main.js
****create channels ****
__dirname: /opt/caliper/src/fabric: caRootsPath: ./fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
channels: before new Client creation
create channel......
org name: org1
error: [Orderer.js]: sendBroadcast - on error: "Error: Endpoint read failed\n at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:255:19)\n at ClientDuplexStream._receiveStatus (/opt/caliper/node_modules/grpc/src/client.js:233:8)\n at /opt/caliper/node_modules/grpc/src/client.js:757:12"
not ok 1 Failed to create channels Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:128:21) at emitOne (events.js:96:13) at ClientDuplexStream.emit (events.js:188:7) at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:258:12) at ClientDuplexStream._receiveStatus (/opt/caliper/node_modules/grpc/src/client.js:233:8) at /opt/caliper/node_modules/grpc/src/client.js:757:12
operator: fail
at: channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:168:19)
stack: |-
Error: Failed to create channels Error: SERVICE_UNAVAILABLE
at ClientDuplexStream.<anonymous> (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:128:21)
at emitOne (events.js:96:13)
at ClientDuplexStream.emit (events.js:188:7)
at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:258:12)
at ClientDuplexStream._receiveStatus (/opt/caliper/node_modules/grpc/src/client.js:233:8)
at /opt/caliper/node_modules/grpc/src/client.js:757:12
at Test.assert [as _assert] (/opt/caliper/node_modules/tape/lib/test.js:212:54)
at Test.bound [as _assert] (/opt/caliper/node_modules/tape/lib/test.js:64:32)
at Test.fail (/opt/caliper/node_modules/tape/lib/test.js:277:10)
at Test.bound [as fail] (/opt/caliper/node_modules/tape/lib/test.js:64:32)
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:168:19)
at process._tickCallback (internal/process/next_tick.js:103:7)
...
fabric.init() failed, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:170:31)
at process._tickCallback (internal/process/next_tick.js:103:7)
unexpected error, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:170:31)
at process._tickCallback (internal/process/next_tick.js:103:7)
1..1
Activity
haojun commentedon Dec 7, 2017
SERVICE_UNAVAILABLE means the client couldn't connect to the Orderer. Please check the orderer was started properly and the address was correct.
The address should be configured in benchmark/simple/fabric.json (if you have not changed the blockchain config file name, which is defined by blockchain.config parameter in config.json ) .
I've tested the first-network before, here is some of my config for reference(I copied the /crypto-config into caliper/network/fabric/firstnetwork folder).
BTW, I disabled TLS in the first-network, if you are using TLS, you should use 'grpcs' instead of 'grpc' in the configuration.
"network": {
"orderer": {
"url": "grpc://localhost:7050",
"mspid": "OrdererMSP",
"msp": "network/fabric/firstnetwork/crypto-config/ordererOrganizations/example.com/msp/",
"server-hostname": "orderer.example.com",
"tls_cacerts": "network/fabric/firstnetwork/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
},
"org1": {
"name": "peerOrg1",
"mspid": "Org1MSP",
"msp": "network/fabric/firstnetwork/crypto-config/peerOrganizations/org1.example.com/msp/",
"ca": {
"url": "https://localhost:7054",
"name": "ca-org1"
},
"peer1": {
"requests": "grpc://localhost:7051",
"events": "grpc://localhost:7053",
"server-hostname": "peer0.org1.example.com",
"tls_cacerts": "network/fabric/firstnetwork/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"peer2": {
"requests": "grpc://localhost:8051",
"events": "grpc://localhost:8053",
"server-hostname": "peer1.org1.example.com",
"tls_cacerts": "network/fabric/firstnetwork/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
}
},
......
sourav977 commentedon Dec 8, 2017
what BAD_REQUEST indicates ??
node benchmark/simple/main.js
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml up -d
Creating network "simplenetwork_default" with the default driver
Creating orderer.example.com ...
Creating ca_peerOrg2 ...
Creating ca_peerOrg1 ...
Creating couchdb ...
Creating orderer.example.com
Creating ca_peerOrg2
Creating couchdb
Creating orderer.example.com ... done
Creating peer0.org1.example.com ...
Creating peer0.org2.example.com ...
Creating couchdb ... done
Creating peer0.org1.example.com
Creating peer0.org2.example.com
Creating peer0.org2.example.com ... done
Creating peer1.org2.example.com ... done
Creating peer1.org1.example.com ... done
TAP version 13
***** create channels *****
create mychannel......
error: [Orderer.js]: sendBroadcast - reject with BAD_REQUEST
not ok 1 Failed to create channels Error: BAD_REQUEST at ClientDuplexStream. (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:106:21) at emitOne (events.js:96:13) at ClientDuplexStream.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at ClientDuplexStream.Readable.push (_stream_readable.js:134:10) at readCallback (/opt/caliper/node_modules/grpc/src/client.js:299:14)
...
fabric.init() failed, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:160:31)
at process._tickCallback (internal/process/next_tick.js:103:7)
unexpected error, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:160:31)
at process._tickCallback (internal/process/next_tick.js:103:7)
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq)
Stopping peer1.org1.example.com ... done
Stopping peer1.org2.example.com ... done
Stopping peer0.org2.example.com ... done
Stopping peer0.org1.example.com ... done
Stopping ca_peerOrg1 ... done
Stopping couchdb ... done
Stopping ca_peerOrg2 ... done
Stopping orderer.example.com ... done
Removing peer1.org1.example.com ... done
Removing peer1.org2.example.com ... done
Removing peer0.org2.example.com ... done
Removing peer0.org1.example.com ... done
Removing ca_peerOrg1 ... done
Removing couchdb ... done
Removing ca_peerOrg2 ... done
Removing orderer.example.com ... done
Removing network simplenetwork_default
"docker rm" requires at least 1 argument(s).
See 'docker rm --help'.
Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
Remove one or more containers
1..1
tests 1
pass 0
fail 1
haojun commentedon Dec 8, 2017
What's the version of your fabric images? V1.1.0-preview?
Now caliper only supports v1.0.0, not sure if this is the cause of the error.
sourav977 commentedon Dec 8, 2017
@haojun my HLF reference version is 1.0.3, so i am using v1.0.3 fabric images.
Thanks for your update on HLF v1.0.0 , i will consider this now .
and one more question.
can caliper point to an existing HLF network(consisting of peers, orderer etc) and test benchmark for that ? if that so, then how it could be, can you please update ?
because as i saw , it is creating a new network of HLF and testing that ....
VemiReddyN commentedon Dec 8, 2017
@haojun, yes I enabled TLS in The first-network and also I used grpc in a configuaration but still i am facing the same error
***** create channels *****
__dirname: /opt/caliper/src/fabric: caRootsPath: network/fabric/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
channels: before new Client creation
create channel......
org name: org1
error: [Orderer.js]: sendBroadcast - on error: "Error: Endpoint read failed\n at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:255:19)\n at ClientDuplexStream._receiveStatus (/opt/caliper/node_modules/grpc/src/client.js:233:8)\n at /opt/caliper/node_modules/grpc/src/client.js:757:12"
not ok 1 Failed to create channels Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:128:21) at emitOne (events.js:96:13) at ClientDuplexStream.emit (events.js:188:7) at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:258:12) at ClientDuplexStream._receiveStatus (/opt/caliper/node_modules/grpc/src/client.js:233:8) at /opt/caliper/node_modules/grpc/src/client.js:757:12
...
fabric.init() failed, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:170:31)
at process._tickCallback (internal/process/next_tick.js:103:7)
unexpected error, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/opt/caliper/src/fabric/create-channel.js:170:31)
at process._tickCallback (internal/process/next_tick.js:103:7)
1..1
tests 1
haojun commentedon Dec 11, 2017
@Souravpatnaik You can point to an existing HLF network, just remove the 'start' & 'end' object in the configuration file (config.json as default) and specify the endpoints of orderers & peers in fabric's configuration file (fabric.json as default).
haojun commentedon Dec 11, 2017
@VemiReddyN you should use grpcs since the TLS is enabled ( change all urls start with 'grpc://' to 'grpcs://')