"docker-compose up" Command - Start the Network

Q

How to run "docker-compose up" command to deploy and start containers to run BYFN (Build Your First Network)?

✍: FYIcenter.com

A

You can follow this tutorial to run "docker-compose up" command to deploy and start containers to run BYFN.

$ cd hyperledger-binaries/fabric-samples/first-network

$ docker-compose -f docker-compose-cli.yaml up --detach
Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Creating orderer.example.com    ... done
Creating peer1.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating peer1.org1.example.com ... done
Creating peer0.org2.example.com ... done
Creating cli                    ... done

Verify BYFN Docker containers:

$ docker ps -a 

IMAGE                               COMMAND             STATUS          NAMES

hyperledger/fabric-tools:latest     "/bin/bash"         Up 10 minutes   cli
hyperledger/fabric-peer:latest      "peer node start"   Exited (1)      peer0.org1.example.com
hyperledger/fabric-peer:latest      "peer node start"   Exited (1)      peer0.org2.example.com
hyperledger/fabric-peer:latest      "peer node start"   Exited (1)      peer1.org1.example.com
hyperledger/fabric-peer:latest      "peer node start"   Exited (1)      peer1.org2.example.com
hyperledger/fabric-orderer:latest   "orderer"           Exited (1)      orderer.example.com

As you can see, all 5 orderer and peer containers started and stopped with an error code of 1. But the "cli" container is still running.

To find out why, re-run the command without the "--detach" option. This will kill your terminal window attached to the "cli" container process to receive console output. You need to press Ctrl-C to terminate the "cli" container process.

$ docker-compose -f docker-compose-cli.yaml up

Starting peer1.org2.example.com ... done
Starting peer1.org1.example.com ... done
Starting peer0.org2.example.com ... done
Starting orderer.example.com    ... done
Starting peer0.org1.example.com ... done
cli is up-to-date

Attaching to peer1.org1.example.com, peer0.org2.example.com, 
   peer1.org2.example.com, orderer.example.com, peer0.org1.example.com, cli

peer1.org1.example.com | [main] InitCmd -> ERRO 001 Cannot run peer 
   because error when setting up MSP of type bccsp from directory 
   /etc/hyperledger/fabric/msp: could not load a valid signer certificate 
   from directory /etc/hyperledger/fabric/msp/signcerts: stat 
   /etc/hyperledger/fabric/msp/signcerts: no such file or directory
peer0.org2.example.com | [main] InitCmd -> ERRO 001 Cannot run peer 
   ...
peer1.org2.example.com | [main] InitCmd -> ERRO 001 Cannot run peer 
   ...
peer0.org1.example.com | [main] InitCmd -> ERRO 001 Cannot run peer 
   ...
peer1.org1.example.com exited with code 1
peer0.org2.example.com exited with code 1
peer1.org2.example.com exited with code 1
peer0.org1.example.com exited with code 1

orderer.example.com    | [localconfig] completeInitialization -> INFO 001 
   Kafka.Version unset, setting to 0.10.2.0
orderer.example.com    | [orderer.common.server] initializeLocalMsp -> 
   FATA 002 Failed to initialize local MSP: could not load a valid signer 
   certificate from directory /var/hyperledger/orderer/msp/signcerts: stat 
   /var/hyperledger/orderer/msp/signcerts: no such file or directory
orderer.example.com exited with code 1

^C
Gracefully stopping... (press Ctrl+C again to force)
Stopping cli                    ... done

As you can see all 4 peer container processes failed because of missing certificate file: /etc/hyperledger/fabric/msp/signcerts. The orderer container process also failed because of missing certificate file: /var/hyperledger/orderer/msp/signcerts. See next tutorial on how to fix the issue.

 

"docker start/stop" - Start and Stop Docker Containers

BYFN docker-compose-cli.yaml Configuration File

Hyperledger Fabric Sample Networks

⇑⇑ Hyperledger Tutorials

2020-10-20, 337👍, 0💬