From e91addc31f454b554a85ab9264d6db86e910f6d1 Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Thu, 21 Sep 2017 16:01:38 +0800 Subject: [PATCH] Minor update --- hyperledger/1.0.2/Makefile | 8 ++++---- hyperledger/1.0.2/base.yaml | 9 ++++++--- hyperledger/1.0.2/docker-compose-dev.yaml | 1 + hyperledger/1.0.2/scripts/func.sh | 8 ++++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/hyperledger/1.0.2/Makefile b/hyperledger/1.0.2/Makefile index 7609f3c0..10edc256 100644 --- a/hyperledger/1.0.2/Makefile +++ b/hyperledger/1.0.2/Makefile @@ -50,7 +50,7 @@ dev: dev_ready: @echo "Restart and init network for dev mode..." make dev_restart - sleep 30 + sleep 35 make dev_init sleep 2 @@ -80,6 +80,9 @@ dev_download: # download required images docker pull hyperledger/fabric-baseos:x86_64-0.4.1 docker tag yeasy/hyperledger-fabric:latest hyperledger/fabric-ccenv:x86_64-1.1.0 +dev_logs: # show dev logs + docker-compose -f ${COMPOSE_DEV_FILE} logs -f --tail 200 + ################## Couchdb testing ################ couch: @echo "Please make sure u have setup Docker and pulled images by 'make setup'." @@ -155,9 +158,6 @@ ps: # show existing docker images logs: # show logs docker-compose -f ${COMPOSE_FILE} logs -f --tail 200 -dev_logs: # show dev logs - docker-compose -f ${COMPOSE_DEV_FILE} logs -f --tail 200 - logs_check: logs_save logs_view logs_save: # save logs diff --git a/hyperledger/1.0.2/base.yaml b/hyperledger/1.0.2/base.yaml index c3d20c92..843bfaf0 100644 --- a/hyperledger/1.0.2/base.yaml +++ b/hyperledger/1.0.2/base.yaml @@ -105,7 +105,7 @@ services: #- CORE_PEER_ID=peer0 - CORE_PEER_ADDRESSAUTODETECT=false - CORE_LOGGING_LEVEL=DEBUG - - CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s} %{message}%{color:reset} + - CORE_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message} - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=102_default # uncomment this to use specific network #- CORE_PEER_NETWORKID=dev - CORE_PEER_GOSSIP_USELEADERELECTION=true @@ -136,6 +136,7 @@ services: #image: hyperledger/fabric-orderer:x86_64-1.0.2 environment: - ORDERER_GENERAL_LOGLEVEL=DEBUG + - ORDERER_GENERAL_LOGFORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{longpkg}] %{callpath} -> %{level:.4s}%{color:reset} %{message} - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - ORDERER_GENERAL_GENESISMETHOD=file - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block @@ -154,8 +155,10 @@ services: - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt] expose: - "7050" # + volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT + - $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric #command: bash -c 'bash /tmp/orderer_build.sh; orderer start' # use this if to debug orderer - command: bash -c 'orderer start' + command: bash -c 'bash /tmp/orderer_build.sh; orderer start' cli-base-dev: image: yeasy/hyperledger-fabric:latest @@ -176,4 +179,4 @@ services: - ./e2e_cli/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto - ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: bash -c 'while true; do sleep 20170910; done' + command: bash -c 'cd /tmp; bash scripts/func.sh; while true; do sleep 20170910; done' diff --git a/hyperledger/1.0.2/docker-compose-dev.yaml b/hyperledger/1.0.2/docker-compose-dev.yaml index b9a8e6b5..31ab5b9b 100644 --- a/hyperledger/1.0.2/docker-compose-dev.yaml +++ b/hyperledger/1.0.2/docker-compose-dev.yaml @@ -41,6 +41,7 @@ services: - 7051:7051 - 7052:7052 - 7053:7053 + command: bash -c 'peer node start' #command: bash -c 'bash /tmp/peer_build.sh; peer node start' cli: diff --git a/hyperledger/1.0.2/scripts/func.sh b/hyperledger/1.0.2/scripts/func.sh index 2f43c1fd..fb50bf94 100644 --- a/hyperledger/1.0.2/scripts/func.sh +++ b/hyperledger/1.0.2/scripts/func.sh @@ -97,6 +97,14 @@ createChannel() { fi res=$? cat log.txt + if [ $res -ne 0 -a $COUNTER -lt $MAX_RETRY ]; then + COUNTER=` expr $COUNTER + 1` + echo_b "PEER$1 failed to create the channel, Retry after 2 seconds" + sleep 2 + createChannel + else + COUNTER=1 + fi verifyResult $res "Channel creation failed" echo_g "===================== Channel \"$CHANNEL_NAME\" is created successfully ===================== " echo