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

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

相关内容

热门资讯

宏远股份:6月29日获融资买入... 6月29日,宏远股份跌0.94%,成交额1823.91万元。两融数据显示,当日宏远股份获融资买入额1...
金证股份信息披露事务管理制度 金证股份发布《信息披露事务管理制度》(2026年6月修订),该制度经公司董事会审议批准后生效,旨在加...
北矿检测:6月29日获融资买入... 6月29日,北矿检测跌2.54%,成交额1381.02万元。两融数据显示,当日北矿检测获融资买入额3...
精创电气:6月29日获融资买入... 6月29日,精创电气跌5.30%,成交额5549.59万元。两融数据显示,当日精创电气获融资买入额1...
通宝光电:6月29日获融资买入... 6月29日,通宝光电跌2.23%,成交额995.59万元。两融数据显示,当日通宝光电获融资买入额8....