当前位置:网站首页>Hyperleger fabric installation
Hyperleger fabric installation
2022-06-10 23:53:00 【Hey. - zero one】
install curl、git
yum -y install curl
yum -y install git
install docker
download fabric
mkdir hyperledgerFabric
cd hyperledgerFabric
git clone https://github.com/hyperledger/fabric.git

install fabric-samples Example
cd fabric/scripts
git clone -b main https://github.com/hyperledger/fabric-samples.git

Install binaries , Automatically install to fabric-samples In the catalog bin and config Under the table of contents
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
Made into docker Mirror image
modify bootstrap.sh The contents of the file can be successfully created by running docker Mirror image
cd fabric/scripts
vim bootstrap.sh
BINARIES=false # take 136 Yes BINARIES Of true Change it to false
./bootstrap.sh # Run the installation script
View after successful operation docker Containers 
Start the test network
Create a that consists of two peer nodes and a sort node Fabric The Internet
cd /fabric-samples/test-network
./network.sh up
If an error is reported, you can run the following command
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

Create a channel
./network.sh createChannel
Solutions to the following problems
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
install 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
Update profile
source /etc/profile
go version

Solutions to the following problems
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
Chain code test
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
There's a problem
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

solve
go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on
go mod vendor
Or restart the image
./network.sh down
./network.sh up createChannel
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
The success is as follows 
Interact with the network
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
边栏推荐
- [new version] new pseudo personal homepage v2.0- starze V Club
- MySQL learning child query
- PHP实现iframe跨站替换文字/替换iframe网站文字的方法
- LabVIEW获取IMAQ Get Last Event坐标
- LabVIEW用高速数据流盘
- Vs tomato assistant add header comments and usage
- LabVIEW change the shape or color of point ROI overlay
- 判等问题:如何确定程序的判断是正确的?
- Developers changing the world - Yao Guang teenagers playing Tetris
- Chapter 6 - branch and bound method
猜你喜欢

IGBT and third generation semiconductor SiC double pulse test scheme

Data and information resource sharing platform (VII)

LabVIEW打开其他EXE程序

LabVIEW phase locked loop (PLL)

HyperLeger Fabric安装

Dark horse headlines - Tencent's salary system reform has caused controversy; Intel expanded the recruitment of female engineers nationwide; Black horse is 100% employed really

Self made app connected to onenet --- realize data monitoring and distribution control (mqtt)

LabVIEW prohibits other multi-core processing applications from executing on all cores

LabVIEW获取IMAQ Get Last Event坐标

PHP实现iframe跨站替换文字/替换iframe网站文字的方法
随机推荐
vtk. VTP download in JS
LabVIEW在波形图或波形图表上显示时间和日期
[paper sharing] pata: fuzzing with path aware Taint Analysis
Deepin20菜单启动选项后自检到iwlwifi停机
IGBT与三代半导体SiC双脉冲测试方案
LeetCode+ 21 - 25
Basic introduction and core components of kubernetes
LabVIEW图片在从16位强制转换为8位后看起来要亮或暗
Unity 脚本无法显示C#源码的中文注释 或者VS创建的脚本没有C#源码的注释
LabVIEW 禁止其他可多核心处理的应用程序在所有核心上执行
How to handle the database query error with Emoji expression in Typecho- Xingze V Club
LabVIEW打开其他EXE程序
Fiddler simulates low-speed network environment
LabVIEW prohibits other multi-core processing applications from executing on all cores
Two debugging techniques in embedded software development
LabVIEW获取IMAQ Get Last Event坐标
HyperLeger Fabric安装
LabVIEW open other exe programs
LabVIEW error "memory full - Application stopped on node"
黑马头条丨腾讯薪酬制度改革引争议;英特尔全国扩招女工程师;黑马100%就业真的吗......