Merge pull request #98 from qiang0723/master

Add download official images script
pull/108/head
Baohua Yang 2017-08-23 12:47:24 +08:00 committed by GitHub
commit ccad9dbd55
4 changed files with 59 additions and 5 deletions

View File

@ -3,13 +3,22 @@
## Start a network base on kafka
```bash
$ docker-compose -f orderer-kafka.yaml up
$ cd ~/docker-compose-files/tree/master/hyperledger/1.0/kafka
$ docker-compose -f orderer-kafka.yaml up (-d)
```
When the fabric-network fully started, it takes about 15-20s.
### Chaincode
## Test chaincode
```bash
$ docker exec -it fabric-cli bash
$ bash ./scripts/initialize.sh
$ bash ./scripts/initialize.sh # initialize the fabric network
$ bash ./scripts/test_4peers.sh
```
>(Optional) If you want to use official images, you can run the following command first
>
> ```bash
> $ cd ~/docker-compose-files/tree/master/hyperledger/1.0
> $ bash ./scripts/download_official_images.sh
> ```

View File

@ -27,6 +27,9 @@ services:
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_VERBOSE=true
expose:
- "7050" #
command: orderer start

View File

@ -187,7 +187,7 @@ services:
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
volumes:
#- ./e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples
- ../e2e_cli/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples # only need when you use official images
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ../scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts

View File

@ -0,0 +1,42 @@
#!/bin/bash
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f scripts/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
echo_b "===Download official images from https://hub.docker.com/u/hyperledger/"
# pull fabric images
ARCH=x86_64
BASEIMAGE_RELEASE=0.3.1
PROJECT_VERSION=1.0.0
IMG_TAG=1.0.0
echo_b "===Pulling fabric images... with tag = ${IMG_TAG}"
docker pull hyperledger/fabric-peer:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-tools:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-orderer:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-ca:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-ccenv:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE
docker pull hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
docker pull hyperledger/fabric-couchdb:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-kafka:$ARCH-$IMG_TAG
docker pull hyperledger/fabric-zookeeper:$ARCH-$IMG_TAG
echo_b "===Re-tagging images to *latest* tag"
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca
docker tag hyperledger/fabric-zookeeper:$ARCH-$IMG_TAG hyperledger/fabric-zookeeper
docker tag hyperledger/fabric-kafka:$ARCH-$IMG_TAG hyperledger/fabric-kafka
docker tag hyperledger/fabric-couchdb:$ARCH-$IMG_TAG hyperledger/fabric-couchdb
echo_b "Done, now can startup the network using docker-compose..."