From 64f6a033fbd6a890ab145b35c03e7fbc2b4bb6cf Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Thu, 31 Aug 2017 15:59:37 +0800 Subject: [PATCH] Add dev env for 1.0.0 --- hyperledger/1.0/Makefile | 10 +++++----- hyperledger/1.0/docker-compose-base.yaml | 9 +++++---- hyperledger/1.0/docker-compose-dev.yaml | 18 ++++++++++-------- hyperledger/1.0/peer-base-dev.yaml | 3 +-- hyperledger/1.0/scripts/initialize_all.sh | 1 + hyperledger/1.0/scripts/test_lscc.sh | 2 +- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/hyperledger/1.0/Makefile b/hyperledger/1.0/Makefile index 2123ffe1..1a5dface 100644 --- a/hyperledger/1.0/Makefile +++ b/hyperledger/1.0/Makefile @@ -62,21 +62,21 @@ start: # bootup the fabric network init: # initialize the fabric network @echo "Install and instantiate cc example02 on the fabric network" - docker exec -it fabric-cli bash ./scripts/initialize_all.sh + docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/initialize_all.sh" test_cc: # test chaincode @echo "Invoke and query cc example02 on all peers" - docker exec -it fabric-cli bash ./scripts/test_cc_all.sh + docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_all.sh" test_peer0: # test single peer @echo "Invoke and query cc example02 on single peer0" - docker exec -it fabric-cli bash ./scripts/test_cc_peer0.sh + docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_peer0.sh" qscc: # test qscc quries - docker exec -it fabric-cli bash ./scripts/test_qscc.sh + docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_qscc.sh" lscc: # test lscc quries - docker exec -it fabric-cli bash ./scripts/test_lscc.sh + docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_lscc.sh" stop: # stop the fabric network @echo "Stop the fabric network" diff --git a/hyperledger/1.0/docker-compose-base.yaml b/hyperledger/1.0/docker-compose-base.yaml index c2f0ca24..716f75f0 100644 --- a/hyperledger/1.0/docker-compose-base.yaml +++ b/hyperledger/1.0/docker-compose-base.yaml @@ -54,12 +54,13 @@ services: - CHANNEL_NAME:="businesschannel" - ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem volumes: - - ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples - - ./e2e_cli/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ - - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/ - - ./e2e_cli/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts + #- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/ + - ./scripts:/tmp/scripts + - ./e2e_cli/channel-artifacts:/tmp/channel-artifacts - ./e2e_cli/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml - ./e2e_cli/crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml + - ./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 20170504; done' diff --git a/hyperledger/1.0/docker-compose-dev.yaml b/hyperledger/1.0/docker-compose-dev.yaml index 338f944e..d3021700 100644 --- a/hyperledger/1.0/docker-compose-dev.yaml +++ b/hyperledger/1.0/docker-compose-dev.yaml @@ -35,7 +35,7 @@ services: #extends: # file: peer-base-dev.yaml # service: peer-base - image: hyperledger/fabric-tools + image: yeasy/hyperledger-fabric:1.0.0 container_name: fabric-cli hostname: fabric-cli tty: true @@ -52,13 +52,15 @@ services: - CHANNEL_NAME:="businesschannel" - ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem volumes: - - ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples - - ./e2e_cli/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ - - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/ - - ./e2e_cli/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts + #- $GOPATH/src/github.com/hyperledger/:/go/src/github.com/hyperledger/ + - ./scripts:/tmp/scripts + - ./e2e_cli/channel-artifacts:/tmp/channel-artifacts - ./e2e_cli/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml - ./e2e_cli/crypto-config.yaml:/etc/hyperledger/fabric/crypto-config.yaml - #- $GOPATH/src/github.com/hyperledger/:/go/src/github.com/hyperledger/ + - ./e2e_cli/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto + - ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples + - $GOPATH/src/github.com/hyperledger/fabric:/opt/gopath/src/github.com/hyperledger/fabric + - /tmp/:/tmp/ working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer command: bash -c 'while true; do sleep 20170504; done' @@ -82,8 +84,8 @@ services: - 7051:7051 - 7052:7052 - 7053:7053 - #command: bash -c 'bash /tmp/peer_build.sh; peer node start' - command: peer node start + command: bash -c 'bash /tmp/peer_build.sh; peer node start' + #command: peer node start #networks: # default: diff --git a/hyperledger/1.0/peer-base-dev.yaml b/hyperledger/1.0/peer-base-dev.yaml index e65ee82c..9891adf3 100644 --- a/hyperledger/1.0/peer-base-dev.yaml +++ b/hyperledger/1.0/peer-base-dev.yaml @@ -8,7 +8,7 @@ version: '2' services: peer-base: - image: yeasy/hyperledger-fabric + image: yeasy/hyperledger-fabric:1.0.0 environment: #- CORE_PEER_ID=peer0 - CORE_PEER_ADDRESSAUTODETECT=false @@ -35,7 +35,6 @@ services: - "7059" # tlsCAA volumes: # docker.sock is mapped as the default CORE_VM_ENDPOINT - /var/run/docker.sock:/var/run/docker.sock - - $GOPATH/src/github.com/hyperledger/:/go/src/github.com/hyperledger/ #volumes: # - /var/run/:/host/var/run/ command: bash -c 'bash /tmp/peer_build.sh; peer node start' diff --git a/hyperledger/1.0/scripts/initialize_all.sh b/hyperledger/1.0/scripts/initialize_all.sh index 4bf626e5..28cd7e76 100644 --- a/hyperledger/1.0/scripts/initialize_all.sh +++ b/hyperledger/1.0/scripts/initialize_all.sh @@ -23,6 +23,7 @@ createChannel echo_b "Having all peers join the channel..." joinChannel + ## Set the anchor peers for each org in the channel echo_b "Updating anchor peers for org1..." updateAnchorPeers 0 diff --git a/hyperledger/1.0/scripts/test_lscc.sh b/hyperledger/1.0/scripts/test_lscc.sh index ce4f2753..14b6b371 100644 --- a/hyperledger/1.0/scripts/test_lscc.sh +++ b/hyperledger/1.0/scripts/test_lscc.sh @@ -26,7 +26,7 @@ echo_b "LSCC testing" #--tls "true" \ #--cafile ${ORDERER_CA} \ -echo_b "Get cc name" +echo_b "Get id" peer chaincode query \ -C "${CHANNEL_NAME}" \ -n lscc \