Hyperledger Fabric 2.x 环境搭建

Hyperledger Fabric 是一个开源的企业级许可分布式账本技术(Distributed Ledger Technology,DLT)平台,专为在企业环境中使用而设计,与其他流行的分布式账本或区块链平台相比,它有一些主要的区别。

环境准备:

Git 客户端

Golang 1.17.5以上版本

Docker 18.03以上版本

版本查看

docker -v

go version

git version

创建目录

mkdir -p Fabric

cd Fabric

git clone fabric: Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing s

github 网络太卡

修改安装脚本

将github 改为https://download.fastgit.org/镜像网站

执行fabric/scripts/

./bootstrap.sh

下载完后执行

fabric/scripts/fabric-samples/test-network

./network.sh up

peer channel create -o orderer.example.com:7050 -c channel2 -f ./channel-artifacts/channel2.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

peer lifecycle chaincode package basic.tar.gz --path ../asset-transfer-basic/chaincode-java/ --lang node --label basic_1.0

export CC_PACKAGE_ID=basic_1.0:59d13dab46150edf68f615887fce411300e25d71c286e645a4c8ae4bd27f2079

2023-01-13 01:24:51.110 PST cli.lifecycle.chaincode submitInstallProposal -> INFO 001 Installed remotely: response:

2023-01-13 01:24:51.111 PST cli.lifecycle.chaincode submitInstallProposal -> INFO 002 Chaincode code package identifier: basic_1.0:59d13dab46150edf68f615887fce411300e25d71c286e645a4c8ae4bd27f2079

2023-01-13 01:25:45.043 PST cli.lifecycle.chaincode submitInstallProposal -> INFO 001 Installed remotely: response:

2023-01-13 01:25:45.043 PST cli.lifecycle.chaincode submitInstallProposal -> INFO 002 Chaincode code package identifier: basic_1.0:59d13dab46150edf68f615887fce411300e25d71c286e645a4c8ae4bd27f2079

export CC_PACKAGE_ID=basic_1.0:59d13dab46150edf68f615887fce411300e25d71c286e645a4c8ae4bd27f2079

peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --channelID mychannel --name basic --version 1.0 --package-id CC_PACKAGE_ID --sequence 1 --tls --cafile "{PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem"

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-java -ccl java

相关推荐
卓豪终端管理1 分钟前
MDM 落地实战:一台设备从注册到退役的四道关
运维·网络·windows·安全
沫璃染墨11 分钟前
从零入门计算机网络系列(三十三):Linux I/O 多路复用详解——epoll 核心接口、底层原理与事件通知机制
linux·运维·服务器·c++·驱动开发·系统架构·硬件架构
qq_1715203524 分钟前
nginx访问不同服务器docker部署的java服务上传文件地址
运维·服务器·nginx
Z21-X42 分钟前
云原生运维学习笔记:Kubernetes 动态卷供应与 StatefulSet 实战
运维·笔记·学习·云原生·kubernetes
dog2501 小时前
Linux 7.4 最新的 TCP_ROCCET 拥塞控制解析
linux·运维·tcp/ip
.道阻且长.10 小时前
Linux基础IO:系统文件IO
linux·运维·服务器
迪康coolmu10 小时前
基于迪康端点安全一体化管理系统的屏幕录像审计:录屏的留存、回放与取证链
运维·服务器·网络·经验分享·安全·网络安全·制造
GZlangtian11 小时前
锂电池化成设备自动化产线集成设计:物流节拍、设备通信与MES接口
运维·自动化·制造·化成分容设备·电池化成分容设备·锂电检测设备·锂电池化成分容
zxcvb15312 小时前
运维实践里把备份mysql数据库做稳的一些思路
运维·数据库·mysql
极创信息15 小时前
信创国产化适配流程全解:从环境矩阵到测试证明的完整路径
运维·人工智能·http·wireshark·健康医疗