Hyperledger Fabric 1.1安装部署-Fabric Samples

Fabric Samples源码下载:
我下载到了和fabric同一个目录下了,
git clone -b master https://github.com/hyperledger/fabric-samples.git
下载完成后进入到fabric-samples目录;
cd fabric-samples
使用git tag命令查看版本列表,根据个人需要将源码切换到对应的版本,本次使用的是1.1版。
git checkout -b v1.1.0
下载二进制文件:
二进制文件官方给出两种方式
curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0(这个方式需要FQ)
或者直接访问下面的网址,访问二进制文件
https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh
也可以新建bootstrap.sh文件,拷贝下面的脚本并执行。
#!/bin/bash

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

if version not passed in, default to latest released version

export VERSION=${1:-1.1.0}

if ca version not passed in, default to latest released version

export CA_VERSION=KaTeX parse error: Expected '}', got 'EOF' at end of input: {2:-VERSION}

current version of thirdparty images (couchdb, kafka and zookeeper) released

export THIRDPARTY_IMAGE_VERSION=0.4.6
export ARCH= ( e c h o " (echo " (echo"(uname -s|tr ‘[:upper:]’ ‘[:lower:]’|sed ‘s/mingw64_nt.*/windows/’)-$(uname -m | sed ‘s/x86_64/amd64/g’)" | awk ‘{print tolower($0)}’)
#Set MARCH variable i.e ppc64le,s390x,x86_64,i386
MARCH=uname -m

dockerFabricPull() {
local FABRIC_TAG=$1
for IMAGES in peer orderer ccenv javaenv tools; do
echo "==> FABRIC IMAGE: I M A G E S " e c h o d o c k e r p u l l h y p e r l e d g e r / f a b r i c − IMAGES" echo docker pull hyperledger/fabric- IMAGES"echodockerpullhyperledger/fabricIMAGES: F A B R I C T A G d o c k e r t a g h y p e r l e d g e r / f a b r i c − FABRIC_TAG docker tag hyperledger/fabric- FABRICTAGdockertaghyperledger/fabricIMAGES: F A B R I C T A G h y p e r l e d g e r / f a b r i c − FABRIC_TAG hyperledger/fabric- FABRICTAGhyperledger/fabricIMAGES
done
}

dockerThirdPartyImagesPull() {
local THIRDPARTY_TAG=$1
for IMAGES in couchdb kafka zookeeper; do
echo "==> THIRDPARTY DOCKER IMAGE: I M A G E S " e c h o d o c k e r p u l l h y p e r l e d g e r / f a b r i c − IMAGES" echo docker pull hyperledger/fabric- IMAGES"echodockerpullhyperledger/fabricIMAGES: T H I R D P A R T Y T A G d o c k e r t a g h y p e r l e d g e r / f a b r i c − THIRDPARTY_TAG docker tag hyperledger/fabric- THIRDPARTYTAGdockertaghyperledger/fabricIMAGES: T H I R D P A R T Y T A G h y p e r l e d g e r / f a b r i c − THIRDPARTY_TAG hyperledger/fabric- THIRDPARTYTAGhyperledger/fabricIMAGES
done
}

dockerCaPull() {
local CA_TAG= 1 e c h o " = = > F A B R I C C A I M A G E " e c h o d o c k e r p u l l h y p e r l e d g e r / f a b r i c − c a : 1 echo "==> FABRIC CA IMAGE" echo docker pull hyperledger/fabric-ca: 1echo"==>FABRICCAIMAGE"echodockerpullhyperledger/fabricca:CA_TAG
docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
}

: KaTeX parse error: Expected '}', got 'EOF' at end of input: {CA_TAG:="MARCH-$CA_VERSION"}
KaTeX parse error: Expected '}', got 'EOF' at end of input: {FABRIC_TAG:="MARCH-$VERSION"}
KaTeX parse error: Expected '}', got 'EOF' at end of input: …IRDPARTY_TAG:="MARCH-$THIRDPARTY_IMAGE_VERSION"}

echo “===> Downloading platform specific fabric binaries”
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/ A R C H − {ARCH}- ARCH{VERSION}/hyperledger-fabric- A R C H − {ARCH}- ARCH{VERSION}.tar.gz | tar xz

echo “===> Downloading platform specific fabric-ca-client binary”
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/ A R C H − {ARCH}- ARCH{VERSION}/hyperledger-fabric-ca- A R C H − {ARCH}- ARCH{VERSION}.tar.gz | tar xz
if [ $? != 0 ]; then
echo
echo "------> KaTeX parse error: Expected 'EOF', got '&' at position 118: … which docker >&̲ /dev/null NODO…?
if [ “${NODOCKER}” == 0 ]; then

echo “===> Pulling fabric Images”
dockerFabricPull ${FABRIC_TAG}

echo “===> Pulling fabric ca Image”
dockerCaPull ${CA_TAG}

echo “===> Pulling thirdparty docker images”
dockerThirdPartyImagesPull ${THIRDPARTY_TAG}
echo

echo “=> List out hyperledger docker images"
docker images | grep hyperledger*
else
echo "
="
echo “Docker not installed, bypassing download of Fabric images”
echo "
===”
fi
这个脚本将下载网络所需的特定二进制文件和镜像。执行成功后会生成bin和config,和镜像,可能二进制下载会失败,直接下载镜像,让他下载,等他下载完镜像之后,你可以通过https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric下载你需要的二进制文件,然后上传到虚拟机。解压到fabcar目录下。然后可以进行测试fabric-samples

你可能感兴趣的:(区块链)