Running Hyperledger Composer with multiple organization on different host machines

@navdevl what are the versions of fabric and composer did you used my fabric version is 1.04 and composer version is 16.3 in link https://github.com/hyperledger/composer/releases its given composer v16.3 is compatible with fabric v1.0

@abhi119 Yes. I had it running successfully with following configurations.

  • Fabric 1.04 with Composer 16.x

  • Fabric 1.1-preview with Composer 17.x

Both these combination of configuration worked fine.

What is the problem you are facing currently?

1 Like

@navdevl I am getting error ⠹

⠙ Installing runtime for business network sample-network. This may take a minute...E0201 07:39:55.309004271   22516 ssl_transport_security.c:921] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number.
✖ Installing runtime for business network sample-network. This may take a minute...
Error: Error trying install composer runtime. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: Connect Failed

I have disabled my TLS except for orderer . I have checked the logs and it looks both machines detect each other

Every-time are you updating the docker-compose files after generating the cypto-config and artifacts? If so, how are you doing it? Manually or do you have any script for it?

@navdevl i am updating it manually.

@abhi119 Can you try to convert the operation to a bash script. Replacing the _sk keys, and the certs, generating them etc.

P.S. Also add command to delete the already-generated files. This causes problem in most cases.

@navdevl I think we have to generate the keys only once and then we can use is again if we shared the crypto-config in both the host machine

I am asking you to generate the key once. Like a fresh-start. I wanted you to write a script to start(initiate the network for the first time)

@navdevl done… created the script

Are you still facing the same issue?

@navdevl Yes I am getting the same error

E0202 05:32:33.491918451    3106 ssl_transport_security.c:921] Handshake fail                                                                                        ed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:w                                                                                        rong version number.

I have also disabled the TLS for now . after creating a BNA file i am following the following steps mention in this link (from step 3): https://hyperledger.github.io/composer/tutorials/developer-tutorial

@abhi119 Share your docker-compose.yml file if possible

version: '2'

networks:
  innovation:
services:
  ca0:
    image: hyperledger/fabric-ca
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca-org1
      - FABRIC_CA_SERVER_TLS_ENABLED=false
      - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.police.gov.uk-cert.pem
      - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/_sk
      - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.police.gov.uk-cert.pem
      - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/_sk
    ports:
      - "7054:7054"
    command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.police.gov.uk-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/_sk -b admin:adminpw -d'
    volumes:
      - ./crypto-config/peerOrganizations/police.gov.uk/ca/:/etc/hyperledger/fabric-ca-server-config
    container_name: ca_peerOrg1
    networks:
      - innovation

  ca1:
    image: hyperledger/fabric-ca
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca-org2
      - FABRIC_CA_SERVER_TLS_ENABLED=false
      - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.defence.gov.uk-cert.pem
      - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/_sk
      - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.defence.gov.uk-cert.pem
      - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/_sk
    ports:
      - "8054:7054"
    command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.defence.gov.uk-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/_sk -b admin:adminpw -d'
    volumes:
      - ./crypto-config/peerOrganizations/defence.gov.uk/ca/:/etc/hyperledger/fabric-ca-server-config
    container_name: ca_peerOrg2
    networks:
      - innovation

  orderer.gov.uk:
    extends:
      file:   base/docker-compose-base.yaml
      service: orderer.gov.uk
    container_name: orderer.gov.uk
    networks:
      - innovation

  peer0.police.gov.uk:
    container_name: peer0.police.gov.uk
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.police.gov.uk
    networks:
      - innovation

  peer0.defence.gov.uk:
    container_name: peer0.defence.gov.uk
    extends:
      file:  base/docker-compose-base.yaml
      service: peer0.defence.gov.uk
    networks:
      - innovation

If we want the two organizations to be hosted on 2 physical machines, should we have two separate docker-compose.yml files? one for each machine?

I am also trying to modify the [Building Your First Network tutorial] to run on two physical machines. one represent one organization. Have someone already done this successfully?

Yep, you need separate docker files for running in corresponding machines. Also if you want the orderer alone in a separate machine, you need to have that on a separate machine other than this two.

https://github.com/suryalnvs/multihost_swarm_1.0.1 here is something you can use it as a reference. Remember to have the recommended versions for docker, docker-compose and fabric.

Hi,

As mentioned i have added all these environment variables to my container and running CA1+orderer+2Peers+2couchDBs+NSDK1 in machine1 and running CA1+2Peers+2CouchDBs in machine 2. Created a sample my-net overlay network(swarm) between both the machines. all the containers were up and running. in the second machine, i can see continuos warning message

**"[gossip/discovery] func1 -> WARN 249 Could not connect to {peer0.org1.example.com:7051 [] [] peer0.org1.example.com:7051 <nil>} : x509: certificate signed by unknown authority"**

But, i tried to create my channel and join the peers to the channel using the node sdk. i create the channel. while trying to add the peers to my channel i am facing the error,

**"[ERROR] Join-Channel - Failed to join all peers to channel. cause:Error: Problem setting up the event hub :Error: 14 UNAVAILABLE: Connect Failed**
**(node:5026) UnhandledPromiseRejectionWarning: Error: Failed to join all peers to channel. cause:Error: Problem setting up the event hub :Error: 14 UNAVAILABLE: Connect Failed"**

if i try to try to execute things in command line i can able to post my transaction also able to query from all the peers. When it is coming to an node SDK i am facing problems. If possible can you help on this. and also if you have idea to publish multihost tutorial that would be great.

Thanks
Kumar M

Hi abhi,

Have you successfully deployed Bna file on multiple host Fabric network. Can you please share the code

hello Ishan , , ,have you tried again to deploy bna to multiple host ??? if you got success then please share info with me .

How did you do it. Can you guide me,Please?

Do you need to execute tasks with percision and accuracy?

Grow and scale your organization easily by automating business crucial functions with Robotic Process Automation (RPA).