I am using Hyperledger Fabric 2.1 container in server-1 and node SDK in server-2. My connection-org.json file is given as:
{
"name": "first-network-org2",
"version": "1.0.0",
"client": {
"organization": "Org2",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"organizations": {
"Org2": {
"mspid": "Org2MSP",
"peers": [
"peer0.org2.example.com",
"peer1.org2.example.com"
],
"certificateAuthorities": [
"ca.org2.example.com"
]
}
},
"peers": {
"peer0.org2.example.com": {
"url": "grpcs://192.168.43.233:9051",
"tlsCACerts": {
"pem": "pen file here"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.example.com",
"hostnameOverride": "peer0.org2.example.com"
}
},
"peer1.org2.example.com": {
"url": "grpcs://192.168.43.233:10051",
"tlsCACerts": {
"pem": "pemfile here"
},
"grpcOptions": {
"ssl-target-name-override": "peer1.org2.example.com",
"hostnameOverride": "peer1.org2.example.com"
}
}
},
"certificateAuthorities": {
"ca.org2.example.com": {
"url": "https://192.168.43.233:8054",
"caName": "ca.org2.example.com",
"tlsCACerts": {
"pem": "pem file here"
},
"httpOptions": {
"verify": false
}
}
}
}
When I try to invoke the chaincode from Fabric Node SDK, I get the error below:
2020-07-09T13:12:19.615Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer0.org2.example.com:9051, url:grpcs://peer0.org2.example.com:9051
2020-07-09T13:12:19.615Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer0.org2.example.com:9051 url:grpcs://peer0.org2.example.com:9051 timeout:3000
2020-07-09T13:12:19.615Z - error: [DiscoveryService]: _buildPeer[verificationchannel] - Unable to connect to the discovered peer peer0.org2.example.com:9051 due to Error: Failed to connect before the deadline on Endorser- name: peer0.org2.example.com:9051, url:grpcs://peer0.org2.example.com:9051
What can I do to be able to invoke the chaincode? Is there something that should be changed in the docker-compose configuration?
Related
I have deploy HLF 2.2 fabric-sample's test-network on AWS ec2 instance.
Now I have created connection.json file to connect to network. now things that I can easily connect to org CA, but when I am trying to submit transaction I am getting error. as below
error: [Transaction]: Error: No valid responses from any peers. Errors:
I am trying to connect from local machine to AWS EC2 instance and all port is open on AWS instance still facing error.
Anybody help me to solve issue
My connection profile file
{
"name": "test-network-org2",
"version": "1.0.0",
"client": {
"organization": "Org2",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"organizations": {
"Org2": {
"mspid": "Org2MSP",
"peers": [
"peer0.org2.example.com"
],
"certificateAuthorities": [
"ca.org2.example.com"
]
}
},
"peers": {
"peer0.org2.example.com": {
"url": "grpcs://ec2-19-219-120-22.us-east-2.compute.amazonaws.com:9051",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICHjCCAcWgAwIBAgIUMoOThnI41mAeLtjeOwa5X8Xse7cwCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMTAyMTQxODIyMDBaFw0zNjAyMTExODIyMDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATca5nVOs/3/+D4\nRvptkuN6JsNUl372V0bYr00QVgQq/sFdjt0sJRsyjmqWVgVPAXxuhJjXn7KjgB9I\n7r/g1EOKo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUKALG7rFC4TiiTG/vnDlcK2Zqbd0wCgYIKoZIzj0EAwIDRwAwRAIg\nY1VBoffxDu6Owzyg0xBDJfUwH28+cPWA4DKJMCrXProCIHTK9w0O2xL6/rRsxWRe\nFe94PjvXFGF4djPSyrSbhVcK\n-----END CERTIFICATE-----\n"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.example.com",
"hostnameOverride": "peer0.org2.example.com"
}
}
},
"certificateAuthorities": {
"ca.org2.example.com": {
"url": "https://ec2-19-219-120-22.us-east-2.compute.amazonaws.com:8054",
"caName": "ca-org2",
"tlsCACerts": {
"pem": ["-----BEGIN CERTIFICATE-----\nMIICHjCCAcWgAwIBAgIUMoOThnI41mAeLtjeOwa5X8Xse7cwCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMTAyMTQxODIyMDBaFw0zNjAyMTExODIyMDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATca5nVOs/3/+D4\nRvptkuN6JsNUl372V0bYr00QVgQq/sFdjt0sJRsyjmqWVgVPAXxuhJjXn7KjgB9I\n7r/g1EOKo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUKALG7rFC4TiiTG/vnDlcK2Zqbd0wCgYIKoZIzj0EAwIDRwAwRAIg\nY1VBoffxDu6Owzyg0xBDJfUwH28+cPWA4DKJMCrXProCIHTK9w0O2xL6/rRsxWRe\nFe94PjvXFGF4djPSyrSbhVcK\n-----END CERTIFICATE-----\n"]
},
"httpOptions": {
"verify": false
}
}
}
}
Below is my connection profile for organization-1 trying to connect to hyperledger fabric network v2.0.1using javascript. I am referring to the test network. I have created 5 ordered 2 organisation when I try to query or invoke, I am facing an error as below one. Please help me on this
(node:18278) UnhandledPromiseRejectionWarning: Error: Endorser must be connected
at Channel.addEndorser (/Users/nagaraj/gowork/src/github.com/hyperledger-fabric-2.0/javascript/node_modules/fabric-common/lib/Channel.js:259:10)
at buildChannel (/Users/nagaraj/gowork/src/github.com/hyperledger-fabric-2.0/javascript/node_modules/fabric-network/lib/impl/ccp/networkconfig.js:52:21)
at Function.loadFromConfig (/Users/nagaraj/gowork/src/github.com/hyperledger-fabric-2.0/javascript/node_modules/fabric-network/lib/impl/ccp/networkconfig.js:37:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Gateway.connect (/Users/nagaraj/gowork/src/github.com/hyperledger-fabric-2.0/javascript/node_modules/fabric-network/lib/gateway.js:171:13)
at async main (/Users/nagaraj/gowork/src/github.com/hyperledger-fabric-2.0/javascript/invoke.js:32:9)
(node:18278) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2020-05-14T07:43:29.964Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Committer- name: orderer1.example.com:7050, url:grpcs://localhost:7050
2020-05-14T07:43:29.966Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server orderer1.example.com:7050 url:grpcs://localhost:7050 timeout:3000
2020-05-14T07:43:29.966Z - error: [DiscoveryService]: _buildOrderer[mychannel] - Unable to connect to the discovered orderer orderer1.example.com:7050 due to Error: Failed to connect before the deadline on Committer- name: orderer1.example.com:7050, url:grpcs://localhost:7050
{
"name": "test-network-org1",
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
}
}
}
},
"channels": {
"mychannel": {
"orderers": [
"orderer.example.com",
"orderer1.example.com",
"orderer2.example.com",
"orderer3.example.com",
"orderer4.example.com"
],
"peers": [
"peer0.org1.example.com",
"peer0.org1.example.com"
]
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpcs://localhost:7050",
"grpcOptions": {
"ssl-target-name-override": "orderer.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n -----END CERTIFICATE-----\n"
}
},
"orderer1.example.com": {
"url": "grpcs://localhost:7082",
"grpcOptions": {
"ssl-target-name-override": "orderer1.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n -----END CERTIFICATE-----\n"
}
},
"orderer2.example.com": {
"url": "grpcs://localhost:7084",
"grpcOptions": {
"ssl-target-name-override": "orderer2.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n -----END CERTIFICATE-----\n"
}
},
"orderer3.example.com": {
"url": "grpcs://localhost:7086",
"grpcOptions": {
"ssl-target-name-override": "orderer3.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n -----END CERTIFICATE-----\n"
}
},
"orderer4.example.com": {
"url": "grpcs://localhost:7088",
"grpcOptions": {
"ssl-target-name-override": "orderer4.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n -----END CERTIFICATE-----\n"
}
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://localhost:7051",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END CERTIFICATE-----\n"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com",
"hostnameOverride": "peer0.org1.example.com"
}
},
"peer1.org1.example.com": {
"url": "grpcs://localhost:7062",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END CERTIFICATE-----\n"
},
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com",
"hostnameOverride": "peer1.org1.example.com"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://localhost:7054",
"caName": "ca-org1",
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END CERTIFICATE-----\n"
},
"httpOptions": {
"verify": false
}
}
}
}
The endorsement properties are not defined properly and the peers under the channel block is defined wrong.That's why it is throwing the Endorser issues.Add the highlighted change.
"channels": {
"mychannel": {
"orderers": [
"orderer.example.com",
"orderer1.example.com",
"orderer2.example.com",
"orderer3.example.com",
"orderer4.example.com"
],
"peers": [
"peer0.org1.example.com",
"peer0.org1.example.com" //this should be "peer1.org1.example.com"
]
}
},
And the connection profile should also include the endorsingPeer property and other details like this one given below.
1.4 Fabric Network sample network connection profile
name: "Network"
version: "1.0"
channels:
mychannel:
orderers:
- orderer.example.com
peers:
peer0.org1.example.com:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
peer0.org2.example.com:
endorsingPeer: true
chaincodeQuery: false
ledgerQuery: true
eventSource: false
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
certificateAuthorities:
- ca-org1
adminPrivateKey:
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/keystore/9022d671ceedbb24af3ea69b5a8136cc64203df6b9920e26f48123fcfcb1d2e9_sk
signedCert:
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/signcerts/Admin#org1.example.com-cert.pem
Org2:
mspid: Org2MSP
peers:
- peer0.org2.example.com
certificateAuthorities:
- ca-org2
adminPrivateKey:
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/users/Admin#org2.example.com/keystore/5a983ddcbefe52a7f9b8ee5b85a590c3e3a43c4ccd70c7795bec504e7f74848d_sk
signedCert:
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/users/Admin#org2.example.com/signcerts/Admin#org2.example.com-cert.pem
orderers:
orderer.example.com:
url: grpcs://localhost:7050
grpcOptions:
ssl-target-name-override: orderer.example.com
grpc-max-send-message-length: 4194304
tlsCACerts:
path: test/fixtures/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tlscacerts/example.com-cert.pem
peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tlscacerts/org1.example.com-cert.pem
peer0.org2.example.com:
url: grpcs://localhost:8051
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
tlsCACerts:
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tlscacerts/org2.example.com-cert.pem
certificateAuthorities:
ca-org1:
url: https://localhost:7054
httpOptions:
verify: false
tlsCACerts:
path: test/fixtures/channel/crypto-config/peerOrganizations/org1.example.com/ca/org1.example.com-cert.pem
registrar:
- enrollId: admin
enrollSecret: adminpw
caName: caorg1
ca-org2:
url: https://localhost:8054
httpOptions:
verify: false
tlsCACerts:
path: test/fixtures/channel/crypto-config/peerOrganizations/org2.example.com/ca/org2.example.com-cert.pem
registrar:
- enrollId: admin
enrollSecret: adminpw
caName: caorg2
I am trying to run hyperledger explorer for my fabric 1.3 network.
Hyperledger fabric configuration:
2 orgs
2 peers under each org
2 orderers
4 kafka and 3 zookeeper
These are running under 3 aws VMs using docker swarm and overlay network.
My hyperledger explorer config:
{
"network-configs": {
"network-1": {
"version": "1.0",
"clients": {
"client-1": {
"tlsEnable": true,
"organization": "Org1MSP",
"channel": "mychannel",
"credentialStore": {
"path": "./tmp/credentialStore_Org1/credential",
"cryptoStore": {
"path": "./tmp/credentialStore_Org1/crypto"
}
}
}
},
"channels": {
"mychannel": {
"peers": {
"peer0.org1.example.com": {},
"peer1.org1.example.com": {},
"peer0.org2.example.com": {},
"peer1.org2.example.com": {}
},
"connection": {
"timeout": {
"peer": {
"endorser": "6000",
"eventHub": "6000",
"eventReg": "6000"
}
}
}
}
},
"organizations": {
"Org1MSP": {
"mspid": "Org1MSP",
"fullpath": true,
"adminPrivateKey": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore"
},
"signedCert": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/signcerts"
}
},
"Org2MSP": {
"mspid": "Org2MSP",
"adminPrivateKey": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org2.example.com/users/Admin#org2.example.com/msp/keystore"
}
},
"OrdererMSP": {
"mspid": "OrdererMSP",
"adminPrivateKey": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/ordererOrganizations/example.com/users/Admin#example.com/msp/keystore"
}
}
},
"peers": {
"peer0.org1.example.com": {
"tlsCACerts": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"url": "grpcs://172.31.15.22:7051",
"eventUrl": "grpcs://172.31.15.22:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com"
}
},
"peer1.org1.example.com": {
"tlsCACerts": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"url": "grpcs://172.31.15.22:8051",
"eventUrl": "grpcs://172.31.15.22:8053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com"
}
},
"peer0.org2.example.com": {
"tlsCACerts": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"url": "grpcs://172.31.0.27:9051",
"eventUrl": "grpcs://172.31.0.27:9053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.example.com"
}
},
"peer1.org2.example.com": {
"tlsCACerts": {
"path":
"/home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"url": "grpcs://172.31.0.27:10051",
"eventUrl": "grpcs://172.31.0.27:10053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org2.example.com"
}
}
},
"orderers": {
"orderer0.example.com": {
"url": "grpcs://172.31.15.22:7050"
},
"orderer1.example.com": {
"url": "grpcs://172.31.0.27:8050"
}
}
}
},
"configtxgenToolPath": "/home/ubuntu/efsmount/mynetwork/bin",
"license": "Apache-2.0"
}
Error log:
postgres://hppoc:password#127.0.0.1:5432/fabricexplorer
error: [NetworkConfig101.js]: NetworkConfig101 - problem reading the PEM file :: Error: EISDIR: illegal operation on a directory, read
<<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>
{ Error: EISDIR: illegal operation on a directory, read
at Object.fs.readSync (fs.js:675:18)
at tryReadSync (fs.js:540:20)
at Object.fs.readFileSync (fs.js:583:19)
at readFileSync (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/node_modules/fabric-client/lib/impl/NetworkConfig_1_0.js:418:17)
at getPEMfromConfig (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/node_modules/fabric-client/lib/impl/NetworkConfig_1_0.js:407:13)
at NetworkConfig_1_0.getOrganization (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/node_modules/fabric-client/lib/impl/NetworkConfig_1_0.js:263:18)
at Client._setAdminFromConfig (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/node_modules/fabric-client/lib/Client.js:1221:53)
at Client.loadFromConfig (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/node_modules/fabric-client/lib/Client.js:129:9)
at FabricClient.LoadClientFromConfig (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/app/platform/fabric/FabricClient.js:215:27)
at FabricClient.initialize (/home/ubuntu/fabric/blockchain-explorer/blockchain-explorer/app/platform/fabric/FabricClient.js:53:16) errno: -21, code: 'EISDIR', syscall: 'read' }
(node:26776) DeprecationWarning: grpc.load: Use the #grpc/proto-loader module with grpc.loadPackageDefinition instead
Received kill signal, shutting down gracefully
Closed out connections
I have followed all these steps : https://github.com/hyperledger/blockchain-explorer to configure, build and start the explorer.
Any help would be appreciated.
Found the problem.
I have to pass keys file name in config file i.e. /home/ubuntu/efsmount/mynetwork/certs/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore/{KEY FILE NAME HERE}
I have one error with Explorer 3.7 and fabric version 1.2.0.
The console display error:
Sync process is started for the network : [dev] and client : [client]
>>>>>>>>>>>>>>>>>>>>
Error : [ 'Failed to connect client peer, please check the configuration and peer status' ]
>>>>>>>>>>>>>>>>>>>>
The blockchain-explorer/logs/sync/app/app.log display error
[2018-09-28 13:41:10.692] [DEBUG] FabricClient - Channel genesis hash for channel [mychannel] >> e520121a6edb2794eb85505d5f5319d29286acb43d0280e0f0f75a130e79889c
[2018-09-28 13:41:10.692] [DEBUG] FabricClient - Initialized channel >> mychannel
[2018-09-28 13:41:10.723] [DEBUG] FabricClient - Set client [client-1] default orderer as >> grpcs://orderer.yx.com:7050
[2018-09-28 13:41:10.724] [DEBUG] FabricClient - Admin peer Not found for grpcs://peer0.org1.yx.com:7051
[2018-09-28 13:49:22.980] [DEBUG] Sync - Start synchronizer
My config.json file is :
{
"network-configs": {
"dev": {
"version": "1.0",
"clients": {
"client": {
"tlsEnable": true,
"organization": "Org1MSP",
"channel": "mychannel",
"credentialStore": {
"path": "./tmp/credentialStore_Org1/credential",
"cryptoStore": {
"path": "./tmp/credentialStore_Org1/crypto"
}
}
}
},
"channels": {
"mychannel": {
"peers": {
"peer0.org1.yx.com": {}
},
"connection": {
"timeout": {
"peer": {
"endorser": "6000",
"eventHub": "6000",
"eventReg": "6000"
}
}
}
}
},
"organizations": {
"Org1MSP": {
"mspid": "Org1MSP",
"fullpath": false,
"adminPrivateKey": {
"path":
"/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/users/Admin#org1.yx.com/msp/keystore"
},
"signedCert": {
"path":
"/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/users/Admin#org1.yx.com/msp/signcerts"
}
},
"OrdererMSP": {
"mspid": "OrdererMSP",
"adminPrivateKey": {
"path": "/root/blockchain-explorer/examples/dockerConfig/crypto/ordererOrganizations/yx.com/users/Admin#yx.com/msp/keystore"
}
}
},
"peers": {
"peer0.org1.yx.com": {
"tlsCACerts": {
"path": "/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/peers/peer0.org1.yx.com/tls/ca.crt"
},
"url": "grpcs://peer0.org1.yx.com:7051",
"eventUrl": "grpcs://peer0.org1.yx.com:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.yx.com"
}
}
},
"orderers": {
"orderer.yx.com": {
"url": "grpcs://orderer.yx.com:7050"
}
}
},
"configtxgenToolPath": "/root/blockchain-explorer/bin",
"license": "Apache-2.0"
}
}
hosts file in CentOS7 is
192.168.2.220 orderer.yx.com
192.168.2.221 cli.yx.com
192.168.2.222 peer0.org1.yx.com
192.168.2.223 peer1.org1.yx.com
192.168.2.224 peer0.org2.yx.com
You could try change url, eventUrl of peers, orderer to ip address, like this:
"peer0.org1.yx.com": {
"tlsCACerts": {
"path": "/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/peers/peer0.org1.yx.com/tls/ca.crt"
},
"url": "grpcs://192.168.2.222:7051",
"eventUrl": "grpcs://192.168.2.222:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.yx.com"
}
}
make sure that CORE_PEER_GOSSIP_EXTERNALENDPOINT exists in your docker compose file for peers and also grpc and grpcs configured correctly.
I am trying to run Explorer 3.6 for fabric version 1.2.0.I am using balance-transfer app for testing.My config.json file is as below-
{
"network-configs": {
"network-1": {
"version": "1.0",
"clients": {
"client-1": {
"tlsEnable": true,
"organization": "Org1MSP",
"channel": "mychannel",
"credentialStore": {
"path": "./tmp/credentialStore_Org1/credential",
"cryptoStore": {
"path": "./tmp/credentialStore_Org1/crypto"
}
}
}
},
"channels": {
"mychannel": {
"peers":{ "peer0.org1.example.com":{},
"peer1.org1.example.com": {},
"peer0.org2.example.com":{},
"peer1.org2.example.com": {}
},
"connection": {
"timeout": {
"peer": {
"endorser": "6000",
"eventHub": "6000",
"eventReg": "6000"
}
}
}
}
},
"organizations": {
"Org1MSP": {
"mspid": "Org1MSP",
"fullpath": false,
"adminPrivateKey": {
"path":
"/home/ak/fabric-samples/balance-trasnfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore"
},
"signedCert": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/signcerts"
}
},
"Org2MSP": {
"mspid": "Org2MSP",
"adminPrivateKey": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/users/Admin#org2.example.com/msp/keystore"
}
},
"OrdererMSP": {
"mspid": "OrdererMSP",
"adminPrivateKey": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/ordererOrganizations/example.com/users/Admin#example.com/msp/keystore"
}
}
},
"peers": {
"peer0.org1.example.com": {
"tlsCACerts": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
},
"url": "grpcs://localhost:7051",
"eventUrl": "grpcs://localhost:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com"
}
},
"peer1.org1.example.com": {
"url": "grpcs://localhost:7056",
"tlsCACerts": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"eventUrl": "grpcs://localhost:7053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com"
}
},
"peer0.org2.example.com": {
"url": "grpcs://localhost:9051",
"tlsCACerts": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"eventUrl": "grpcs://localhost:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.example.com"
}
},
"peer1.org2.example.com": {
"url": "grpcs://localhost:8056",
"tlsCACerts": {
"path":
"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"eventUrl": "grpcs://localhost:7053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org2.example.com"
}
}
},
"orderers": {
"orderer.example.com": {
"url": "grpcs://localhost:7050",
"tls_cacerts":"/home/ak/fabric-samples/balance-transfer/artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
}
}
}
},
"configtxgenToolPath": "/home/ak/fabric-samples/bin",
"license": "Apache-2.0"
}
The error I am getting is:-
Sync process is started for the network : [network-1] and client : [client-1]
<<<<<<<<<<<<<<<<<<<<<<<<<< Synchronizer Error >>>>>>>>>>>>>>>>>>>>>
Error : [ 'Failed to connect client peer, please check the configuration and peer status' ]
<<<<<<<<<<<<<<<<<<<<<<<<<< Closing client processor >>>>>>>>>>>>>>>>>>>>>
Following is the error log
[2018-09-27 10:58:14.006] [DEBUG] FabricClient - Admin peer Not found for grpcs://localhost:7051
Can you try changing your peer "url" and "eventUrl" in the following format:
"url": "grpcs://peer0.org1.example.com:7051"
I'm using docker instance to run blockchain explorer and this format works for me.
You must find ip and port of running peers and orderer and make changes in config.json. You can use docker ps to make sure that containers are running and see the ports related to each container.
Also, take a look at to this link about Explorer. The link shows the steps needed to change config.json and run explorer.
I changed the sync in the explorerconfig.json under blockchain-explorer/app
"sync": {
"type": "host",
"platform": "fabric",
"blocksSyncTime": "3"
}
The error is gone.
In my case I was missing the last line (CORE_PEER_GOSSIP_EXTERNALENDPOINT)
peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.org1.example.com
- CORE_LOGGING_PEER=info
- CORE_CHAINCODE_LOGGING_LEVEL=info
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
in the corresponding docker-compose.yml which describes the network.
Without this line, it seems that peer is only visible inside the org.
You need also to ./generate.sh and ./start.sh your network.
Hope it helps.