Fabric 基础
创始人
2024-04-01 14:40:50
0

Hyperledger Fabric是一个企业级的分布式账本框架,用于开发解决方案和应用程序。它的模块化和多功能设计满足广泛的工业用例。它提供了一种独特的达成共识的方法,可以在保持隐私的同时实现大规模性能。
github
doc

一、安装

Prerequisites

Git client
Go version 1.14.x
Docker version 18.03 or later
(macOS) Xcode Command Line Tools
SoftHSM
jq

1.1 安装 SoftHSMv2

SoftHSMv2

cp /etc/softhsm2.conf $HOME/.config/softhsm2/softhsm2.conf
export SOFTHSM2_CONF=/root/.config/softhsm2/softhsm2.conf

在配置SoftHSM之后,可以使用以下命令初始化单元测试所需的令牌:

softhsm2-util --init-token --slot 0 --label "ForFabric" --so-pin 1234 --pin 98765432
export PKCS11_LIB="/usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so"
export PKCS11_PIN=98765432
export PKCS11_LABEL="ForFabric"

1.2 Clone the Hyperledger Fabric source

首先导航到https://github.com/hyperledger/fabric,并使用右上角的fork按钮对fabric存储库进行分叉。在分叉之后,克隆存储库。

mkdir -p github.com/
cd github.com/
git clone https://github.com//fabric# 编译
make gotools# 验证
1、make basic-checks integration-test-prereqs>=== RUN   TestArugments
=== RUN   TestArugments/toofew
=== RUN   TestArugments/twomany
--- PASS: TestArugments (0.90s)--- PASS: TestArugments/toofew (0.01s)--- PASS: TestArugments/twomany (0.01s)
=== RUN   TestGoodPath
--- PASS: TestGoodPath (0.56s)
=== RUN   TestMissingConnection
--- PASS: TestMissingConnection (0.45s)
PASS
ok  	github.com/hyperledger/fabric/ccaas_builder/cmd/release	1.922s2、ginkgo -r ./integration/nwo>Ran 2 of 2 Specs in 120.185 seconds
SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 0 Skipped
PASSGinkgo ran 1 suite in 2m9.866682768s
Test Suite Passed

1.3 安装Samples, Binaries, and Docker Images

1、手动创建脚本,安装Samples, Docker
https://github.com/hyperledger/fabric/blob/main/scripts/bootstrap.sh文件复制下来修改binaries=false,表示不用此脚本安装binaries

chmod u+x bootstrap.sh
./bootstrap.sh

2、安装Binaries

wget https://github.com/hyperledger/fabric/releases/download/v2.2.9/hyperledger-fabric-linux-amd64-2.2.9.tar.gz
wget https://github.com/hyperledger/fabric-ca/releases/download/v1.5.5/hyperledger-fabric-ca-linux-amd64-1.5.5.tar.gz
tar -xvzf 压缩包名 -C 目的地 #解压到fabric-samples里

检验是否安装成功

cd test-network # 进入fabric-samples/test-network目录
./network.sh up # 检验网络
./network.sh down # 关闭网络
cd ../fabcar
./startFabric.sh

相关内容

热门资讯

中证A500ETF摩根(560... 8月22日,截止午间收盘,中证A500ETF摩根(560530)涨1.19%,报1.106元,成交额...
A500ETF易方达(1593... 8月22日,截止午间收盘,A500ETF易方达(159361)涨1.28%,报1.104元,成交额1...
何小鹏斥资约2.5亿港元增持小... 每经记者|孙磊    每经编辑|裴健如 8月21日晚间,小鹏汽车发布公告称,公司联...
中证500ETF基金(1593... 8月22日,截止午间收盘,中证500ETF基金(159337)涨0.94%,报1.509元,成交额2...
中证A500ETF华安(159... 8月22日,截止午间收盘,中证A500ETF华安(159359)涨1.15%,报1.139元,成交额...
科创AIETF(588790)... 8月22日,截止午间收盘,科创AIETF(588790)涨4.83%,报0.760元,成交额6.98...
创业板50ETF嘉实(1593... 8月22日,截止午间收盘,创业板50ETF嘉实(159373)涨2.61%,报1.296元,成交额1...
港股异动丨航空股大幅走低 中国... 港股航空股大幅下跌,其中,中国国航跌近7%表现最弱,中国东方航空跌近5%,中国南方航空跌超3%,美兰...
电网设备ETF(159326)... 8月22日,截止午间收盘,电网设备ETF(159326)跌0.25%,报1.198元,成交额409....
红利ETF国企(530880)... 8月22日,截止午间收盘,红利ETF国企(530880)跌0.67%,报1.034元,成交额29.0...