0

I am trying to setup the balance-transfer network on multiple computers.

This is similar to the query at

unable to Instantiate any chaincodes on peers of newly Added org

However, there was no resolution to that question

My approach is described below:

1 Org1, Orderer, CA1 on 1st computer 2.Org2, CA2 on 2nd computer 3.Split the docker-compose file accordingly 4.Added the IP's in the network-config file

I was able to register users of both Orgs and install chain code on both the hosts. However, I am not able to instantiate the chain code on Org 2 (ie. the second computer)

I get the following error :

[2018-07-19 11:20:31.401] [ERROR] instantiate-chaincode - REQUEST_TIMEOUT:10.228.27.96:8051 [2018-07-19 11:20:31.402] [ERROR] instantiate-chaincode - Error: ChannelEventHub has been shutdown at ChannelEventHub.disconnect (/Users/digital3/Desktop/Final/balance-transfer/node_modules/fabric-client/lib/ChannelEventHub.js:444:21) at Timeout.setTimeout (/Users/digital3/Desktop/Final/balance-transfer/app/instantiate-chaincode.js:101:10) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) [2018-07-19 11:20:31.403] [ERROR] instantiate-chaincode - Error: ChannelEventHub has been shutdown at ChannelEventHub.disconnect (/Users/digital3/Desktop/Final/balance-transfer/node_modules/fabric-client/lib/ChannelEventHub.js:444:21) at Timeout.setTimeout (/Users/digital3/Desktop/Final/balance-transfer/app/instantiate-chaincode.js:101:10) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) [2018-07-19 11:20:31.403] [ERROR] instantiate-chaincode - Failed to instantiate. cause:Error: ChannelEventHub has been shutdown (node:3837) UnhandledPromiseRejectionWarning: Error: Failed to instantiate. cause:Error: ChannelEventHub has been shutdown

From what I understand, the proposal is sent to orderer but fails there.

The peer logs suggest the same: Failed connecting to orderer.example.com:7050 Could not connect to any of the endpoints

Could someone help me with this? Should I add any extra-hosts parameter in the docker-compose file for ORG2. I have only included the IP's in the network-config files for now.

Docker compose for ORG 2 is shown below

ca.org2.example.com:
image: hyperledger/fabric-ca
environment:
  - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
  - FABRIC_CA_SERVER_CA_NAME=ca-org2
  - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
  - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/a7d47efa46a6ba07730c850fed2c1375df27360d7227f48cdc2f80e505678005_sk
  - FABRIC_CA_SERVER_TLS_ENABLED=true
  - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
  - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/a7d47efa46a6ba07730c850fed2c1375df27360d7227f48cdc2f80e505678005_sk
ports:
  - "8054:7054"
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
  - ./channel/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca_peerOrg2

peer0.org2.example.com: container_name: peer0.org2.example.com

extends:
  file:   base.yaml
  service: peer-base
environment:
  - CORE_PEER_ID=peer0.org2.example.com
  - CORE_PEER_LOCALMSPID=Org2MSP
  - CORE_PEER_ADDRESS=peer0.org2.example.com:7051
ports:
  - 8051:7051
  - 8053:7053
volumes:
  - ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/crypto/peer

peer1.org2.example.com: container_name: peer1.org2.example.com

extends:
  file:   base.yaml
  service: peer-base
environment:
  - CORE_PEER_ID=peer1.org2.example.com
  - CORE_PEER_LOCALMSPID=Org2MSP
  - CORE_PEER_ADDRESS=peer1.org2.example.com:7051
ports:
  - 8056:7051
  - 8058:7053
volumes:
  - ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/:/etc/hyperledger/crypto/peer
  • How are you trying to set it up on multiple hosts what are the tools that you are using? – Darshu Bc Jul 19 '18 at 14:59
  • I added a extra hosts parameter in the docker containers of ORG 2. This points to the orderer sitting in the first computer. Is there anything else i should do? – Surya Suresh Jul 23 '18 at 02:41
  • There has to be an overlay network established between your hosts is that done? – Darshu Bc Jul 23 '18 at 02:43
  • @SuryaSuresh Please post your instantiate command and the output of "printenv" command from a peer of 2nd Org – kpratihast Nov 14 '18 at 06:51

0 Answers0