Hyperledger Fabric Samples 下载安装

下载 Hyperledger Fabric Samples 源码

git clone https://github.com/hyperledger/fabric-samples.git
cd fabric-samples

下载平台特定的二进制文件

curl -sSL https://goo.gl/byy2Qj | bash -s 1.0.5

下载二进制文件速度非常慢,如何解决

离线下载的网址

https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/

mac 下载 hyperledger-fabric-darwin-amd64-1.0.5.tar.gz

https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/darwin-amd64-1.0.5/

将 hyperledger-fabric-darwin-amd64-1.0.5.tar.gz 解压到 fabric-samples

fabric-samples 解压生成 bin

Ubuntu 下载 hyperledger-fabric-linux-amd64-1.0.5.tar.gz

https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.0.5/

将 hyperledger-fabric-linux-amd64-1.0.5.tar.gz 解压到 fabric-samples

fabric-samples 解压生成 bin

由于需要安装docker images ,可以将sh 拷贝到项目中

https://goo.gl/byy2Qj

注释掉 Downloading platform binaries

#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# current version of fabric released
export VERSION=${1:-1.0.5}
# current version of fabric-ca released
export CA_VERSION=${2:-$VERSION}
export ARCH=$(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 couchdb ccenv javaenv kafka zookeeper tools; do
      echo "==> FABRIC IMAGE: $IMAGES"
      echo
      docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
      docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
  done
}

dockerCaPull() {
      local CA_TAG=$1
      echo "==> FABRIC CA IMAGE"
      echo
      docker pull hyperledger/fabric-ca:$CA_TAG
      docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
}

: ${CA_TAG:="$MARCH-$CA_VERSION"}
: ${FABRIC_TAG:="$MARCH-$VERSION"}

# echo "===> Downloading platform binaries"
# curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz

echo "===> Pulling fabric Images"
dockerFabricPull ${FABRIC_TAG}

echo "===> Pulling fabric ca Image"
dockerCaPull ${CA_TAG}
echo
echo "===> List out hyperledger docker images"
docker images | grep hyperledger*

运行 ./init.sh

$ ./init.sh 1.0.5
-bash: ./init.sh: Permission denied

init.sh 权限不够,init.sh 赋权限,然后就可以运行 init.sh,就可以下载 docker image

$ chmod -R 777 init.sh
$ ./init.sh 1.0.5

docker image 下载速度慢,配置代理

可以 DaoCloud, 配置docker 加速器

在DaoCloud注册并登录。

https://www.daocloud.io/

登录到后台点击加速器

results matching ""

    No results matching ""