How to deploy .bna file on Hyperledger Fabric on Multiple Hosts - hyperledger-fabric

I have followed the tutorial for Hyperledger Fabric on Multiple Hosts
by Wahab https://medium.com/#wahabjawed/hyperledger-fabric-on-multiple-hosts-a33b08ef24f.
Now, I am trying to deploy my own .bna file instead of chaincode. can anybody help how to deploy that. I am unable to install the card.
Connection.json
{
"name": "fabric-network",
"x-type": "hlfv1",
"version": "1.0.0",
"peers": {
"peer0.org1.example.com": {
"url": "grpc://localhost:7051",
"eventUrl": "grpc://localhost:7053"
},
"peer1.org1.example.com": {
"url": "grpc://192.168.64.82:7051",
"eventUrl": "grpc://192.168.64.82:7053"
}
},
"certificateAuthorities": {
"ca.example.com": {
"url": "http://localhost:7054",
"caName": "ca.example.com"
}
},
"orderers": {
"orderer.example.com": {
"url": "grpc://localhost:7050"
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com",
"peer1.org1.example.com"
],
"certificateAuthorities": [
"ca.example.com"
]
}
},
"channels": {
"mychannel": {
"orderers": [
"orderer.example.com"
],
"peers": {
"peer0.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
},
"peer1.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
}
}
}
},
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300",
"eventHub": "300",
"eventReg": "300"
},
"orderer": "300"
}
}
}
}

I suggest you to follow the official tutorial of Hyperledger Composer.
It is also explained how to configure the connection profile for the cards.

I've been working on the same issue, used the same tutorial. Well I have managed to configure connection profile so that it connects, but got other problems with authorization and stuff.
I think your ports aren't right try these (that worked for me):
"peer0.org1.example.com": {
"url": "grpc://localhost:8051",
"eventUrl": "grpc://localhost:8053"
},
"peer1.org1.example.com": {
"url": "grpc://192.168.64.82:9051",
"eventUrl": "grpc://192.168.64.82:9053"

Related

Hyperledger - Explorer : Not all peers are shown in explorer

I have successfully set up and run my 3 orderers, 3 orgs - 9 peers hyperledger fabric network. Although hyperledger explorer seems to be running in the standardized way (no docker) without error, it only shows peers specified in CORE_PEER_GOSSIP_EXTERNALENDPOINT protocol of organization "org1MSP", found in line 10 of config.json file.
Please find below the config.json file.
{
"name": "test-network",
"version": "1.0.0",
"license": "Apache-2.0",
"client": {
"tlsEnable": true,
"adminUser": "admin",
"adminPassword": "adminpw",
"enableAuthentication": false,
"organization": "org1MSP",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
},
"orderer": "300"
}
}
},
"channels": {
"mychannel": {
"orderers": [
"orderer1.test.com",
"orderer2.test.com",
"orderer2.test.com"
],
"peers": {
"peer0.org1.test.com": {},
"peer1.org1.test.com": {},
"peer2.org1.test.com": {},
"peer0.org2.test.com": {},
"peer1.org2.test.com": {},
"peer2.org2.test.com": {},
"peer0.org3.test.com": {},
"peer1.org3.test.com": {},
"peer2.org3.test.com": {}
},
"connection": {
"timeout": {
"peer": {
"endorser": "6000",
"eventHub": "6000",
"eventReg": "6000"
}
}
}
}
},
"organizations": {
"org1MSP": {
"mspid": "org1MSP",
"peers": [
"peer0.org1.test.com",
"peer1.org1.test.com",
"peer2.org1.test.com"
],
"fullpath": true,
"adminPrivateKey": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org1.test.com/users/Admin#org1.test.com/msp/keystore/7f7056172b7d3667783dfa1567e8a8617512ded3e7ace54d04ce49e4d66882f1_sk"
},
"signedCert": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org1.test.com/users/Admin#org1.test.com/msp/signcerts/Admin#org1.test.com-cert.pem"
}
},
"org2MSP": {
"mspid": "org2MSP",
"peers": [
"peer0.org2.test.com",
"peer1.org2.test.com",
"peer2.org2.test.com"
],
"fullpath": true,
"adminPrivateKey": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org2.test.com/users/Admin#org2.test.com/msp/keystore/9b1c877670442b629bc2512f96f2b4e5f534cbe97c47657dcfcfa3e3a1d13a5f_sk"
},
"signedCert": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org2.test.com/users/Admin#org2.test.com/msp/signcerts/Admin#org2.test.com-cert.pem"
}
},
"org3MSP": {
"mspid": "org3MSP",
"peers": [
"peer0.org3.test.com",
"peer1.org3.test.com",
"peer2.org3.test.com"
],
"fullpath": true,
"adminPrivateKey": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org3.test.com/users/Admin#org3.test.com/msp/keystore/a1d310fc74eea57d6242dcbeced092e8c89076683f4b83266d51264a8121ab5c_sk"
},
"signedCert": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org3.test.com/users/Admin#org3.test.com/msp/signcerts/Admin#org3.test.com-cert.pem"
}
}
},
"peers": {
"peer0.org1.test.com": {
"name": "org1",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org1.test.com/peers/peer0.org1.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:7051",
"eventUrl": "grpcs://localhost:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.test.com"
}
},
"peer1.org1.test.com": {
"name": "org1",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org1.test.com/peers/peer1.org1.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:8051",
"eventUrl": "grpcs://localhost:8053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.test.com"
}
},
"peer2.org1.test.com": {
"name": "org1",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org1.test.com/peers/peer2.org1.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:9051",
"eventUrl": "grpcs://localhost:9053",
"grpcOptions": {
"ssl-target-name-override": "peer2.org1.test.com"
}
},
"peer0.org2.test.com": {
"name": "org2",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org2.test.com/peers/peer0.org2.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:10051",
"eventUrl": "grpcs://localhost:10053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.test.com"
}
},
"peer1.org2.test.com": {
"name": "org2",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org2.test.com/peers/peer1.org2.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:11051",
"eventUrl": "grpcs://localhost:11053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org2.test.com"
}
},
"peer2.org2.test.com": {
"name": "org2",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org2.test.com/peers/peer2.org2.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:12051",
"eventUrl": "grpcs://localhost:12053",
"grpcOptions": {
"ssl-target-name-override": "peer2.org2.test.com"
}
},
"peer0.org3.test.com": {
"name": "org3",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org3.test.com/peers/peer0.org3.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:13051",
"eventUrl": "grpcs://localhost:13053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org3.test.com"
}
},
"peer1.org3.test.com": {
"name": "org3",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org3.test.com/peers/peer1.org3.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:14051",
"eventUrl": "grpcs://localhost:14053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org3.test.com"
}
},
"peer2.org3.test.com": {
"name": "org3",
"tlsCACerts": {
"path": "/home/xarhs/hyperledger/fabric-samples/test-network/crypto-config/peerOrganizations/org3.test.com/peers/peer2.org3.test.com/tls/ca.crt"
},
"url": "grpcs://localhost:15051",
"eventUrl": "grpcs://localhost:15053",
"grpcOptions": {
"ssl-target-name-override": "peer2.org3.test.com"
},
"orderers": {
"orderer1.test.com": {
"url": "grpcs://localhost:7050"
},
"orderer2.test.com": {
"url": "grpcs://localhost:8050"
},
"orderer3.test.com": {
"url": "grpcs://localhost:9050"
}
}
}
}
}
I have tried changing org1MSP to org2MSP etc. and explorer successfully show only relevant peers. I am having a hard time trying to figure out why explorer can not parse successfully all orgs.
Any leads would be appreciated!

BNA network start failure

I am trying to implement a multi-organization network with fabric kafka with TLS enabled mode. I added currently one organization with Kafka multi orderer mode. The network starts well and peers are joined to channel. I am having .bna file which and trying to install its working fine. After that, I am trying to start a network it fails.
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: Failed to receive commit notification from localhost:7051 for transaction '76d7dfd29df7c65442c6fe8ea87898f53604c539910b985c2bb89b3fea0f10a0' within the timeout period
My connection profile JSON is given below
{
"name": "example",
"x-type": "hlfv1",
"x-commitTimeout": 300,
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "1500",
"eventHub": "1500",
"eventReg": "1500"
},
"orderer": "1500"
}
}
},
"channels": {
"mychannel": {
"orderers": [
"orderer0.example.com",
"orderer1.example.com",
"orderer2.example.com"
],
"peers": {
"peer0.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
},
"peer1.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com",
"peer1.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"orderers": {
"orderer0.example.com": {
"url": "grpcs://localhost:7050",
"eventUrl": "grpcs://localhost:7053",
"grpcOptions": {
"ssl-target-name-override": "orderer0.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICNTCCAdugAwIBAgIQLin25y/L/T+Sxt70ly8EiDAKBggqhkjOPQQDAjBsMQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4\nYW1wbGUuY29tMB4XDTE4MTEyNjA0NTMwMFoXDTI4MTEyMzA0NTMwMFowbDELMAkG\nA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu\nY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt\ncGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPztNJPGPaHwTh0eqUpx\nEqIyG5H3gqcuyTyMXra7AvLklgnUaz8gjylBqYkgX/aWe45Ct2DhOF+kOVd4LcSa\nUOajXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB\n/wQFMAMBAf8wKQYDVR0OBCIEIPTcirmpxvqGwramOon7IAwRcqwnra3M1g244gXX\nwIG7MAoGCCqGSM49BAMCA0gAMEUCIQDypo+APwuqv23mosPcLnz4W+BW4C26Vk75\nt1iRSc8h2QIgL8vMHTB7Q+FQDaZDDw+dEv2I+utGLkSoDxTbeZ8taZA=\n-----END CERTIFICATE-----\n"
}
},
"orderer1.example.com": {
"url": "grpcs://localhost:8050",
"eventUrl": "grpcs://localhost:8053",
"grpcOptions": {
"ssl-target-name-override": "orderer1.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICNTCCAdugAwIBAgIQLin25y/L/T+Sxt70ly8EiDAKBggqhkjOPQQDAjBsMQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4\nYW1wbGUuY29tMB4XDTE4MTEyNjA0NTMwMFoXDTI4MTEyMzA0NTMwMFowbDELMAkG\nA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu\nY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt\ncGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPztNJPGPaHwTh0eqUpx\nEqIyG5H3gqcuyTyMXra7AvLklgnUaz8gjylBqYkgX/aWe45Ct2DhOF+kOVd4LcSa\nUOajXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB\n/wQFMAMBAf8wKQYDVR0OBCIEIPTcirmpxvqGwramOon7IAwRcqwnra3M1g244gXX\nwIG7MAoGCCqGSM49BAMCA0gAMEUCIQDypo+APwuqv23mosPcLnz4W+BW4C26Vk75\nt1iRSc8h2QIgL8vMHTB7Q+FQDaZDDw+dEv2I+utGLkSoDxTbeZ8taZA=\n-----END CERTIFICATE-----\n"
}
},
"orderer2.example.com": {
"url": "grpcs://localhost:9050",
"eventUrl": "grpcs://localhost:9053",
"grpcOptions": {
"ssl-target-name-override": "orderer2.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICNTCCAdugAwIBAgIQLin25y/L/T+Sxt70ly8EiDAKBggqhkjOPQQDAjBsMQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEUMBIGA1UEChMLZXhhbXBsZS5jb20xGjAYBgNVBAMTEXRsc2NhLmV4\nYW1wbGUuY29tMB4XDTE4MTEyNjA0NTMwMFoXDTI4MTEyMzA0NTMwMFowbDELMAkG\nA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFu\nY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5leGFt\ncGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPztNJPGPaHwTh0eqUpx\nEqIyG5H3gqcuyTyMXra7AvLklgnUaz8gjylBqYkgX/aWe45Ct2DhOF+kOVd4LcSa\nUOajXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMA8GA1UdEwEB\n/wQFMAMBAf8wKQYDVR0OBCIEIPTcirmpxvqGwramOon7IAwRcqwnra3M1g244gXX\nwIG7MAoGCCqGSM49BAMCA0gAMEUCIQDypo+APwuqv23mosPcLnz4W+BW4C26Vk75\nt1iRSc8h2QIgL8vMHTB7Q+FQDaZDDw+dEv2I+utGLkSoDxTbeZ8taZA=\n-----END CERTIFICATE-----\n"
}
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://localhost:7051",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICSTCCAe+gAwIBAgIQVg6y1pfoW5wzXozRJ5waKTAKBggqhkjOPQQDAjB2MQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz\nY2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xODExMjYwNDUzMDBaFw0yODExMjMwNDUz\nMDBaMHYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH\nEw1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMR8wHQYD\nVQQDExZ0bHNjYS5vcmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0D\nAQcDQgAEnhEe2AtGf1n3oF9DuI9+3404z2K8nZRTn237rbYXduM1QVsmoPJvGIqW\nZREkP39mpFnF1lDm0zhCYM1T1CcAQKNfMF0wDgYDVR0PAQH/BAQDAgGmMA8GA1Ud\nJQQIMAYGBFUdJQAwDwYDVR0TAQH/BAUwAwEB/zApBgNVHQ4EIgQgOEZjfxZF2IF6\nOqWQUhV7h9BTDLLhE99ZrOZLj5C6LOEwCgYIKoZIzj0EAwIDSAAwRQIhALSE+Fx3\nJI+sBYFvEKM/5bbrABRVzNPv1mLfUiDXHVnMAiBAFa5svqMimJPzfp4/sUWho3Aa\nnbxNC5sUyTCqvxWhfw==\n-----END CERTIFICATE-----\n"
}
},
"peer1.org1.example.com": {
"url": "grpcs://localhost:8051",
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com"
},
"tlsCACerts": {
"pem": "-----BEGIN CERTIFICATE-----\nMIICSTCCAe+gAwIBAgIQVg6y1pfoW5wzXozRJ5waKTAKBggqhkjOPQQDAjB2MQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz\nY2Eub3JnMS5leGFtcGxlLmNvbTAeFw0xODExMjYwNDUzMDBaFw0yODExMjMwNDUz\nMDBaMHYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH\nEw1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMR8wHQYD\nVQQDExZ0bHNjYS5vcmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0D\nAQcDQgAEnhEe2AtGf1n3oF9DuI9+3404z2K8nZRTn237rbYXduM1QVsmoPJvGIqW\nZREkP39mpFnF1lDm0zhCYM1T1CcAQKNfMF0wDgYDVR0PAQH/BAQDAgGmMA8GA1Ud\nJQQIMAYGBFUdJQAwDwYDVR0TAQH/BAUwAwEB/zApBgNVHQ4EIgQgOEZjfxZF2IF6\nOqWQUhV7h9BTDLLhE99ZrOZLj5C6LOEwCgYIKoZIzj0EAwIDSAAwRQIhALSE+Fx3\nJI+sBYFvEKM/5bbrABRVzNPv1mLfUiDXHVnMAiBAFa5svqMimJPzfp4/sUWho3Aa\nnbxNC5sUyTCqvxWhfw==\n-----END CERTIFICATE-----\n"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://localhost:7054",
"caName": "ca.org1.example.com",
"httpOptions": {
"verify": false
}
}
}
}
I am getting error as follows in newly created container.
If anyone knows please help me
Link for exact replica of project: Karthik-Venkatesh/Hyperledger-Multi-Organisation-Network
For the above question, the issue found in the configuration of the following environment variables in peer containers of the organization.
CORE_PEER_GOSSIP_ORGLEADER
CORE_PEER_GOSSIP_USELEADERELECTION
Default it uses the configuration CORE_PEER_GOSSIP_USELEADERELECTION=true, I removed the environment variable.
If you want manually define CORE_PEER_GOSSIP_ORGLEADER, please correctly configure the above environment variables.

while Deploying the Hyperledger composer into fabric for multiple Organization where i need to paste the CA certificate for org1 and org2

Open byfn-network.json and replace all instances of the text INSERT_ORG1_CA_CERT with the CA certificate for the peer nodes for Org1: - use the following command to get the certificate from the .pem file so that it can be embedded into the above connection profile.
Copy
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt > /tmp/composer/org1/ca-org1.txt
But i am totally confused which content i need to copy and where to paste
Basically, an organization needs a connection profile. This connection profile has details of all the peers connected in the network as shown below:
{
"name": "byfn-network",
"x-type": "hlfv1",
"version": "1.0.0",
"channels": {
"mychannel": {
"orderers": [
"orderer.example.com"
],
"peers": {
"peer0.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
},
"peer1.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
},
"peer0.org2.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
},
"peer1.org2.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"eventSource": true
}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com",
"peer1.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
},
"Org2": {
"mspid": "Org2MSP",
"peers": [
"peer0.org2.example.com",
"peer1.org2.example.com"
],
"certificateAuthorities": [
"ca.org2.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpcs://localhost:7050",
"grpcOptions": {
"ssl-target-name-override": "orderer.example.com"
},
"tlsCACerts": {
"pem": "INSERT_ORDERER_CA_CERT"
}
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpcs://localhost:7051",
"grpcOptions": {
"ssl-target-name-override": "peer0.org1.example.com"
},
"tlsCACerts": {
"pem": "INSERT_ORG1_CA_CERT"
}
},
"peer1.org1.example.com": {
"url": "grpcs://localhost:8051",
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com"
},
"tlsCACerts": {
"pem": "INSERT_ORG1_CA_CERT"
}
},
"peer0.org2.example.com": {
"url": "grpcs://localhost:9051",
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.example.com"
},
"tlsCACerts": {
"pem": "INSERT_ORG2_CA_CERT"
}
},
"peer1.org2.example.com": {
"url": "grpcs://localhost:10051",
"grpcOptions": {
"ssl-target-name-override": "peer1.org2.example.com"
},
"tlsCACerts": {
"pem": "INSERT_ORG2_CA_CERT"
}
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "https://localhost:7054",
"caName": "ca-org1",
"httpOptions": {
"verify": false
}
},
"ca.org2.example.com": {
"url": "https://localhost:8054",
"caName": "ca-org2",
"httpOptions": {
"verify": false
}
}
}
}
As you can see, this file has the connection endpoints for each of the peer of the network. If you want to enable the TLS in the network, you also need to provide the TLS-CA certificates here. This cert goes into "tlsCACerts" section of the json.
So considering your question, byfn-network.json should be your connection profile. And when you run the following command:
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt > /tmp/composer/org1/ca-org1.txt
It will copy the tls-ca cert of peer0.org1 and paste it into a text file at /tmp/composer/org1/ca-org1.txt.
You'll need to copy the content of this text file and paste it into "tlsCACerts" section of the byfn-network.json file.
There's a quite comprehensive tutorial for the same. You can find the references here.

Hyperledger Fabric Explorer config.json error

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.

Error trying to ping. Error: 2 UNKNOWN: could not find chaincode with name <NetworkName>

Here is what I try to do :
VM1 : CA, Orderer, Peer0, NodeServer1
VM2 : Peer1, NodeServer2
If I create a card with server1 and a connection profile including only orderer, CA and Peer1 , the card is able to ping the network.
If I create a card with server2 and a connection profile including only orderer, CA and Peer2, I am able to create the card but unable to ping the network with this card.
More info :
1) My VM are able to communication on any port. Internet link is not the pb.
2) If I use a connection.json including Ca, Orderer, Peer1 and Peer0, the card created on VM2 is working.
Any idea ?
You can ask if you need more info.
thx
Connection.json on VM1 :
{
"name": "hlfv1",
"x-type": "hlfv1",
"x-commitTimeout": 300,
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300",
"eventHub": "300",
"eventReg": "300"
},
"orderer": "300"
}
}
},
"channels": {
"composerchannel": {
"orderers": [
"orderer.example.com"
],
"peers": {
"peer0.org1.example.com": {}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer0.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpc://<IP1>:7050"
}
},
"peers": {
"peer0.org1.example.com": {
"url": "grpc://<IP1>:7051",
"eventUrl": "grpc://<IP1>:7053"
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "http://<IP1>:7054",
"caName": "ca.org1.example.com"
}
}
}
Connection.json on VM2 :
{
"name": "hlfv1",
"x-type": "hlfv1",
"x-commitTimeout": 300,
"version": "1.0.0",
"client": {
"organization": "Org1",
"connection": {
"timeout": {
"peer": {
"endorser": "300",
"eventHub": "300",
"eventReg": "300"
},
"orderer": "300"
}
}
},
"channels": {
"composerchannel": {
"orderers": [
"orderer.example.com"
],
"peers": {
"peer1.org1.example.com": {}
}
}
},
"organizations": {
"Org1": {
"mspid": "Org1MSP",
"peers": [
"peer1.org1.example.com"
],
"certificateAuthorities": [
"ca.org1.example.com"
]
}
},
"orderers": {
"orderer.example.com": {
"url": "grpc://<IP1>:7050"
}
},
"peers": {
"peer1.org1.example.com": {
"url": "grpc://<IP2>:7051",
"eventUrl": "grpc://<IP2>:7053"
}
},
"certificateAuthorities": {
"ca.org1.example.com": {
"url": "http://<IP1>:7054",
"caName": "ca.org1.example.com"
}
}
}
docker network ls
NETWORK ID NAME DRIVER SCOPE
bad3e19266c6 bridge bridge local
bb28a60f158b composer_default bridge local
8002ff68da75 host host local
f5c9ac2997e5 none null local
docker inspect composer_default
[
{
"Name": "composer_default",
"Id": "bb28a60f158b4c61438b3792c0c2cd5c13d1aa3bbbd6c1cfe8dff88a0232efc1",
"Created": "2018-05-31T13:56:28.314975468+02:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "<IP2>",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"868f282e3ae67ed3861e9e4729292019b220b3f04dfcf300395251223ba14b68": {
"Name": "peer1.org1.example.com",
"EndpointID": "1141dd4d1aa0ed6a4ec1e5dd103a3affa90a8344600969111af433f5ad396d59",
"MacAddress": "<MACAddress>",
"IPv4Address": "<IP2>",
"IPv6Address": ""
},
"aa6579c58c1bd2bfde2491a083fc731f7fbc0ec44d609c2105ff6628be14bf15": {
"Name": "couchdb1",
"EndpointID": "dddb99538f49524ce5d68fb768cb73c0d96608f57e6fe743ddfc0023a63c6a3e",
"MacAddress": "<MACAddress>",
"IPv4Address": "<IP2>",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]

Resources