Running Hyperledger Composer with multiple organization on different host machines


(Naveen Honest Raj) #21

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?


#22

@navdevl i am updating it manually.


(Naveen Honest Raj) #23

@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.


#24

@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


(Naveen Honest Raj) #25

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)


#26

@navdevl done… created the script


(Naveen Honest Raj) #27

Are you still facing the same issue?


#28

@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


(Naveen Honest Raj) #29

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


#30
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

(Haoxue Song) #31

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?


(Varun Raj) #32

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.


(VK Blue) #33

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.


(Kumar Mohanaraman) #34

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


(Ishan Walawalkar) #35

Hi abhi,

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