当前位置:网站首页>HyperLeger Fabric安装
HyperLeger Fabric安装
2022-06-10 22:27:00 【嘿-零一】
安装curl、git
yum -y install curl
yum -y install git
安装docker
下载fabric
mkdir hyperledgerFabric
cd hyperledgerFabric
git clone https://github.com/hyperledger/fabric.git

安装fabric-samples示例
cd fabric/scripts
git clone -b main https://github.com/hyperledger/fabric-samples.git

安装二进制文件,解压后将自动安装到fabric-samples目录下的bin和config目录下
wget https://github.com/hyperledger/fabric/releases/download/v2.4.2/hyperledger-fabric-linux-amd64-2.4.2.tar.gz
tar -xzvf hyperledger-fabric-linux-amd64-2.4.2.tar.gz -C fabric-samples
制作成docker镜像
修改bootstrap.sh文件内容并运行即可成功制作成docker镜像
cd fabric/scripts
vim bootstrap.sh
BINARIES=false # 将136行的BINARIES的true改为false
./bootstrap.sh # 运行安装脚本
成功运行后查看docker容器
启动测试网络
创建一个由两个对等节点和一个排序节点组成的Fabric网络
cd /fabric-samples/test-network
./network.sh up
如果报错可以运行下面的命令
curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

创建一个通道
./network.sh createChannel
遇见如下问题的解决方法
Error: failed to normalize chaincode path: failed to determine module root: exec: “go”: executable file not found in $PATH
Chaincode packaging has failed
Deploying chaincode failed
安装go
cd ~
mkdir go
cd go
wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
tar -C /usr/local -zxf go1.14.2.linux-amd64.tar.gz
vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$HOME/go/bin
更新配置文件
source /etc/profile
go version

遇见如下问题解决方法
Error: failed to normalize chaincode path: ‘go list’ failed with: go: github.com/golang/[email protected]: Get “https://proxy.golang.org/github.com/golang/protobuf/@v/v1.3.2.mod”: dial tcp 142.251.43.17:443: i/o timeout: exit status 1
Chaincode packaging has failed
Deploying chaincode failed
go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on
链码测试
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
出现一下问题
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of ‘InstallChaincode’: chaincode already successfully installed (package ID ‘basic_1.0:dee2d612e15f5059478b9048fa4b3c9f792096554841d642b9b59099fa0e04a4’)
Chaincode installation on peer0.org1 has failed
Deploying chaincode failed

解决
go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on
go mod vendor
或者重新启动镜像
./network.sh down
./network.sh up createChannel
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
成功后如下
与网络交互
export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
export CORE_PEER_ADDRESS=localhost:7051
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"InitLedger","Args":[]}'
peer chaincode query -C mychannel -n basic -c '{"Args":["GetAllAssets"]}'
peer channel list
.crt -c '{"function":"InitLedger","Args":[]}'
peer chaincode query -C mychannel -n basic -c '{"Args":["GetAllAssets"]}'
peer channel list
边栏推荐
- Openvp* integrated LDAP authentication
- Executor - Shutdown、ShutdownNow、awaitTermination 詳解與實戰
- redis列表list常用命令大全
- Project training 10 - backup of specific databases
- How to search keywords in Oracle tables
- 数据文件 Insurance csv包含1338条观测,即目前已经登记过的保险计划受益者以及表示病人特点和历年计划入的总的医疗费用的特征。这些特征是
- Data file nc6oa Txt consists of 6830 gene expression data from 33 cancer cell lines, each of which is a type of cancer cell. Please cluster the 33 cell lines according to the gene expression data (the
- Dell R730 raid5 安装Server 2016(解决磁盘大于2T)
- mysql 表机制
- Development and implementation of AI intelligent video analysis easycvr platform device channel batch deletion function
猜你喜欢
![[QPSK if] Verilog design of QPSK IF signal generation module based on FPGA](/img/7d/b021790f1fde266ff9aa360261d581.png)
[QPSK if] Verilog design of QPSK IF signal generation module based on FPGA

Ride the storm and explore the secret behind the open source of flyfish, a data visualization development platform!

Ma8601 pin √ pin replaces Tang Ming fe1.1s without changing the circuit board | perfectly replaces fe1.1s scheme

项目实训10——对特定数据库的备份

Developers changing the world - Yao Guang teenagers playing Tetris
![[Video] kmeans mean clustering and hierarchical clustering: R language analysis life happiness index visualization | data sharing](/img/d5/d544ab0c14ba22946219feafdc3392.png)
[Video] kmeans mean clustering and hierarchical clustering: R language analysis life happiness index visualization | data sharing

【视频】KMEANS均值聚类和层次聚类:R语言分析生活幸福指数可视化|数据分享

VS 番茄助手添加头注释 以及使用方式

Executor - Shutdown、ShutdownNow、awaitTermination 詳解與實戰

The time (in minutes) required for a group of workers to cooperate to complete the assembly process of a part are as follows:
随机推荐
Developers changing the world - Yao Guang teenagers playing Tetris
Redis data structure
mysql 表机制
Redis list list common commands
软件测试入门之软件测试的概念与过程(精辟内容)
期货开户有什么限制嘛?哪里最安全?
Creating dynamic two-dimensional array with C language
Interview questions - written examination
集度夏一平:不是所有事都向李彦宏汇报,靠产品跟小米华为竞争
MySQL学习之子查询
The shell script of pagoda plan task regularly deletes all files under a directory [record]
云图说|每个成功的业务系统都离不开APIG的保驾护航
C语言创建动态二维数组
[paper sharing] pata: fuzzing with path aware Taint Analysis
一 组工人合作完成某一部件的装配工序所需的时间(单位:分钟)分别如下:
1. open the R program, and use the apply function to calculate the sum of 1 to 12 in the sequence of every 3 numbers. That is, calculate 1+4+7+10=? 2+5+8+11=?, 3+6+9+12=?
LeetCode+ 16 - 20
30 frequently asked questions of 2022 latest software test interview questions [continuous update ~]
数据文件nc6oa.txt由33个癌细胞系得6830个基因表达数据构成,每一个细胞系都是某种类型的癌细胞的类型。请按照基因表达数据对33个细胞系进行聚类(聚类类别数划是癌细胞的类型个数,比如乳腺癌、肺
Data file nc6oa Txt consists of 6830 gene expression data from 33 cancer cell lines, each of which is a type of cancer cell. Please cluster the 33 cell lines according to the gene expression data (the