From 59433b4189bbfe82be461de98a2b98b472de40fa Mon Sep 17 00:00:00 2001 From: Baohua Yang Date: Tue, 24 Jan 2017 10:24:12 +0800 Subject: [PATCH] Use fabric-ca image to replace fabric-cop --- hyperledger/1.0/README.md | 12 ++++++------ hyperledger/1.0/docker-compose.yml | 20 ++++++++++---------- hyperledger/1.0/setup_fabric_1.0.sh | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hyperledger/1.0/README.md b/hyperledger/1.0/README.md index 961eadfe..976b63e8 100644 --- a/hyperledger/1.0/README.md +++ b/hyperledger/1.0/README.md @@ -19,17 +19,17 @@ If you're not familiar with Docker and Blockchain, can have a look at 2 books (i ### Download Images -Pull necessary images of peer, orderer, cop, and base image. +Pull necessary images of peer, orderer, ca, and base image. ```sh $ docker pull yeasy/hyperledger-fabric-base:latest \ && docker pull yeasy/hyperledger-fabric-peer:latest \ && docker pull yeasy/hyperledger-fabric-orderer:latest \ - && docker pull yeasy/hyperledger-fabric-cop:latest \ + && docker pull yeasy/hyperledger-fabric-ca:latest \ && docker pull yeasy/blockchain-explorer:latest \ && docker tag yeasy/hyperledger-fabric-peer hyperledger/fabric-peer \ && docker tag yeasy/hyperledger-fabric-orderer hyperledger/fabric-orderer \ - && docker tag yeasy/hyperledger-fabric-cop hyperledger/fabric-cop \ + && docker tag yeasy/hyperledger-fabric-ca hyperledger/fabric-ca \ && docker tag yeasy/hyperledger-fabric-base hyperledger/fabric-baseimage \ && docker tag yeasy/hyperledger-fabric-base hyperledger/fabric-ccenv:x86_64-1.0.0-preview ``` @@ -64,7 +64,7 @@ Start a MVE fabric cluster. $ docker-compose up ``` -Check the output log that the peer is connected to the cop and orderer successfully. +Check the output log that the peer is connected to the ca and orderer successfully. There will be 3 running containers. @@ -73,7 +73,7 @@ $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 069427b04bfa hyperledger/fabric-peer "peer node start" 5 minutes ago Up 5 minutes 7050/tcp, 7052-7059/tcp, 0.0.0.0:7051->7051/tcp fabric-vp0 d22c541c68f5 hyperledger/fabric-orderer "orderer" 5 minutes ago Up 5 minutes 0.0.0.0:7050->7050/tcp fabric-orderer -ca046fc3c0e7 hyperledger/fabric-cop "cop server start -ca" 5 minutes ago Up 5 minutes 0.0.0.0:8888->8888/tcp fabric-cop +ca046fc3c0e7 hyperledger/fabric-ca "ca server start -ca" 5 minutes ago Up 5 minutes 0.0.0.0:8888->8888/tcp fabric-ca ``` ### Test chaincode @@ -125,7 +125,7 @@ CONTAINER ID IMAGE f03e586db8c5 dev-vp0-test_cc-0-48baa00e355e6db1648cff44e28f1dbf322523a99ffe283fd99a00348466eb78075559488e372409bb691aab29cfa894645c9c2737781367012e0c816eb227b7 "/opt/gopath/bin/test" About a minute ago Up About a minute dev-vp0-test_cc-0-48baa00e355e6db1648cff44e28f1dbf322523a99ffe283fd99a00348466eb78075559488e372409bb691aab29cfa894645c9c2737781367012e0c816eb227b7 069427b04bfa hyperledger/fabric-peer "peer node start" 9 minutes ago Up 9 minutes 7050/tcp, 7052-7059/tcp, 0.0.0.0:7051->7051/tcp fabric-vp0 d22c541c68f5 hyperledger/fabric-orderer "orderer" 9 minutes ago Up 9 minutes 0.0.0.0:7050->7050/tcp fabric-orderer -ca046fc3c0e7 hyperledger/fabric-cop "cop server start -ca" 9 minutes ago Up 9 minutes 0.0.0.0:8888->8888/tcp fabric-cop +ca046fc3c0e7 hyperledger/fabric-ca "ca server start -ca" 9 minutes ago Up 9 minutes 0.0.0.0:8888->8888/tcp fabric-ca ``` #### Invoke diff --git a/hyperledger/1.0/docker-compose.yml b/hyperledger/1.0/docker-compose.yml index 3ee28b4b..33d3bf18 100644 --- a/hyperledger/1.0/docker-compose.yml +++ b/hyperledger/1.0/docker-compose.yml @@ -1,6 +1,6 @@ # https://github.com/yeasy/docker-compose-files/tree/master/hyperledger # This compose file will start a Hyperledger Fabric 1.0 MVE, including -# * cop +# * ca # * orderer # * peer # * sdk for testing @@ -8,14 +8,14 @@ version: '2.0' services: - cop: - image: hyperledger/fabric-cop - container_name: fabric-cop - hostname: cop - # command: /go/src/github.com/hyperledger/fabric-cop/bin/cop server start -ca testdata/ec.pem -ca-key testdata/ec-key.pem -config testdata/testconfig.json + ca: + image: hyperledger/fabric-ca + container_name: fabric-ca + hostname: ca + # command: /go/src/github.com/hyperledger/fabric-ca/bin/ca server start -ca testdata/ec.pem -ca-key testdata/ec-key.pem -config testdata/testconfig.json ports: - "8888:8888" - command: cop server start -ca testdata/ec.pem -ca-key testdata/ec-key.pem -config testdata/cop.json -address="0.0.0.0" + command: fabric-ca server start -ca testdata/ec.pem -ca-key testdata/ec-key.pem -config testdata/testconfig.json -address="0.0.0.0" orderer: image: hyperledger/fabric-orderer @@ -43,15 +43,15 @@ services: - CORE_PEER_ID=vp0 - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 links: - - cop + - ca - orderer ports: - 7051:7051 depends_on: - - cop + - ca - orderer #networks: # default: # external: -# name: hyperledger_fabric \ No newline at end of file +# name: hyperledger_fabric diff --git a/hyperledger/1.0/setup_fabric_1.0.sh b/hyperledger/1.0/setup_fabric_1.0.sh index afeb91a4..05a13a9d 100644 --- a/hyperledger/1.0/setup_fabric_1.0.sh +++ b/hyperledger/1.0/setup_fabric_1.0.sh @@ -22,11 +22,11 @@ docker-compose --version docker pull yeasy/hyperledger-fabric-base:latest \ && docker pull yeasy/hyperledger-fabric-peer:latest \ && docker pull yeasy/hyperledger-fabric-orderer:latest \ - && docker pull yeasy/hyperledger-fabric-cop:latest \ + && docker pull yeasy/hyperledger-fabric-ca:latest \ && docker pull yeasy/blockchain-explorer:latest \ && docker tag yeasy/hyperledger-fabric-peer hyperledger/fabric-peer \ && docker tag yeasy/hyperledger-fabric-orderer hyperledger/fabric-orderer \ - && docker tag yeasy/hyperledger-fabric-cop hyperledger/fabric-cop \ + && docker tag yeasy/hyperledger-fabric-ca hyperledger/fabric-ca \ && docker tag yeasy/hyperledger-fabric-base hyperledger/fabric-baseimage \ && docker tag yeasy/hyperledger-fabric-base hyperledger/fabric-ccenv:x86_64-1.0.0-preview