concept startup in category hyperledger

This is an excerpt from Manning's book Programming Hyperledger Fabric: Creating Permissioned Blockchains.
Table 4.4. Settings to start Biotor peer
Setting Value Explanation FABRIC_CFG_PATH $PWD All peer commands require a core.yaml file under FABRIC_CFG_PATH CORE_CHAINCODE_MODE dev Dev mode is useful in development phase of the project when you want to be able to debug etc. CORE_PEER_ID peer0.biotor.com Name of the peer CORE_PEER_ADDRESS The address by which this peer is known to other peers in the same organization. Since we don’t have other peers in same organization we can set this to empty string. CORE_PEER_LISTENADDRESS 0.0.0.0:8051 Address and port at which peer will listen for communication from other peers and applications but not the chaincode CORE_PEER_GOSSIP_BOOTSTRAP A list of other peers in the same org that this peer reaches out to at startup to initialize the gossip protocol. As we don’t have any other peer in same org, we can set this to be empty. CORE_PEER_GOSSIP_EXTERNALENDPOINT 127.0.0.1:8051 The address by which this peer is known to peers of other organizations. CORE_PEER_CHAINCODEADDRESS We don’t need to set chaincode address in dev mode. So you can set it to empty or skip the setting. CORE_PEER_CHAINCODELISTENADDRESS 0.0.0.0:8052 Address and port at which peer will listen for messages from chaincode. CORE_PEER_LOCALMSPID BiotorMSP Must match with what you declared in configtx.yaml CORE_PEER_MSPCONFIGPATH $PWD/crypto-config/peerOrganizations/biotor.com/peers/peer0.biotor.com/msp Directory containing the identity of the peer. CORE_PEER_TLS_ENABLED false TLS must be disabled in dev mode according to Fabric docs. CORE_PEER_TLS_CLIENTAUTHREQUIRED false CORE_PEER_FILESYSTEMPATH $PWD/peer0.biotor.com Directory where peer will store all its data. CORE_LEDGER_STATE_STATEDATABASE CouchDB We use CouchDB for the world state. That way we can inspect the world state independently using a UI or CLI that comes with CouchDB. CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS 127.0.0.1:17055 Address and port where the CouchDB can be reached. CORE_OPERATIONS_LISTENADDRESS 0.0.0.0:9433 The operations service can be considered as a black-box but we do need to provide a unique address for it. GODEBUG netdns=go Use Go’s library for DNS name resolution instead of relying on C library routines.
We mentioned in Section 4.5 that the
ordererreads a file namedorderer.yamlon startup and looks for it under theFABRIC_CFG_PATHdirectory. In Section 4.5 we provided anorderer.yamlunder the$/three-org-networkdirectory to theorderer. If you have been observant, you would have noticed we did not copy over anyorderer.yamlin Listing 9.4. Thefabric-ordererDocker image comes pre-installed with a defaultorderer.yamllocated at/etc/hyperledger/fabric. To help theordererfind this file we setFABRIC_CFG_PATH=/etc/hyperledger/fabricin Listing 9.4. This is also the default value ofFABRIC_CFG_PATHinside the container anyway so in a way setting it was redundant in Listing 9.4. The lesson here is that if you are relying on the orderer to use a customorderer.yaml, then you need todocker cpit to the right location prior to starting the container.
9.3.7. Debugging containers that crash on startup
Sometimes (or rather definitely at some point as your Docker usage increases) you will run into issues when a container immediately crashes on startup. Running
docker pswill show the container has exited or it might not even show the container in the listing - usedocker ps -ain that case to list all running as well as stopped containers. If the container is removed, then its logs will also be lost. How do you debug such a scenario? We have seen that all a container does when its started is to execute theCmdorEntrypoint. If theCmdorEntrypointcrashes, it will also crash the container. So we want to be able to get inside the container before theCmdorEntrypointstarts and monitor the execution of theCmdorEntrypoint. Take the case of thefabric-orderer. When the container starts, it will start executing theordererbinary. But for theordererbinary to work it expects a properorderer.yamlfile, a proper MSP directory and so on. We would like to make sure these exist and are as expected. How can we do this? We have already seen in Section 9.3.6 that theCmdorEntrypointcan be overridden by specifying a different value on the command line. A common newbie mistake is to specify/bin/bashfor theCmdorEntrypointwith the intent that this would allow you to log into the container so that you can do ad-hoc tasks such as verifying theorderer.yamlor MSP directory for errors before starting the orderer. For example: