1

I want to use the end-2-end scenario to build my first network to invoke certificate authority containers. So, I just replaced the docker compose cli yaml file with the docker compose e2e.

# use this as the default docker-compose yaml definition
#COMPOSE_FILE=docker-compose-cli.yaml
COMPOSE_FILE=docker-compose-e2e.yaml

But when I try to up this network I get the following error:

cli container not found

Why Its invoking CLI container. Can anyone please explain steps need to follow to setup this network with e2e docker compose.

david_k
  • 4,867
  • 2
  • 7
  • 15
Bilal Ahmed Yaseen
  • 1,914
  • 1
  • 19
  • 39
  • docker-compose-e2e.yaml is designed to be used by SDKs and not use the CLI container. The docs tell you how to use e2e -> https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html?highlight=e2e – Paul O'Mahony Mar 06 '19 at 10:19
  • I read this document but this doesn't elaborate this section much. On which container then will we docker compose this e2e yaml file? – Bilal Ahmed Yaseen Mar 06 '19 at 12:12
  • I'm newbie in hyperledger fiber technology. Can you please guide me a bit that (1) what is the difference between cli and e2e? (2) How can I setup network with e2e? (3) why is there no ca container in CLI? How certificates validations and other stuffs being performed then? – Bilal Ahmed Yaseen Mar 06 '19 at 12:53
  • 1
    hi 1) one of the differences is e2e uses CA docker containers for the 2-org setup and the CLI yaml (`docker-compose-cli.yaml`, the default yaml in BYFN) doesn't :-) 2) see last comment below 3) already explained above . To start up the e2e yaml you can simply run (on the command line) something like (from the first-network directory in fabric-samples that you cloned): `./byfn.sh up -c mychannel -f docker-compose-e2e.yaml -s couchdb` (after first following the docs to get the binaries,tools (eg, cryptogen)) then running the cmd – Paul O'Mahony Mar 07 '19 at 13:39

1 Answers1

0

This is the problem with docker-compose-e2e.yaml. To run e2e tests we need cli container, but in docker-compose-e2e.yaml there is no service mentioned to start cli container.

On firing ./byfn.sh up -s couchdb -f docker-compose-e2e.yaml it will start peers, couchdb, orderer containers, but failed to start cli container. Because their is no config for cli container.

To solve this just add cli service configuration in docker-compose-e2e.yaml

  cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    environment:
      - SYS_CHANNEL=$SYS_CHANNEL
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      #- FABRIC_LOGGING_SPEC=DEBUG
      - FABRIC_LOGGING_SPEC=INFO
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
        - /var/run/:/host/var/run/
        - ./../chaincode/:/opt/gopath/src/github.com/chaincode
        - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
        - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
        - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
    depends_on:
      - orderer.example.com
      - peer0.org1.example.com
      - peer1.org1.example.com
      - peer0.org2.example.com
      - peer1.org2.example.com
    networks:
      - byfn

Now on firing ./byfn.sh up -s couchdb -f docker-compose-e2e.yaml. It will run e2e test.

I hope this will help.

Sunil Hirole
  • 239
  • 3
  • 10