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

相关推荐
斑马1396 分钟前
Linux软件编程学习笔记(四)——进程
linux·运维·服务器
扛枪的书生21 分钟前
Linux 三剑客 - Awk 命令指南
linux·运维
MaximusCoder1 小时前
等保测评命令——weblogic
运维·安全·安全威胁分析
学linux的QQ蛋1 小时前
Linux 文件 IO vs 标准 IO:缓冲区、目录操作、常用函数汇总
linux·运维·服务器
苍狗T2 小时前
k8s 控制器管理
linux·运维·云原生·容器·kubernetes
笨笨饿2 小时前
#121_图传中的H.364编码与MP4的联系
linux·运维·前端·单片机·嵌入式硬件·面试·职场和发展
运维糕手2 小时前
一次 EVS"disk doesn't exist"报错的完整排查:我差点删掉生产Kafka
运维
优化Henry2 小时前
5G站点BBU功能模块集成化与偶发案例
运维·网络·学习·5g·tdd
小HANN3 小时前
高可用架构实战:Keepalived+LVS(DR)+MariaDB主主集群搭建指南
linux·运维·服务器·经验分享
Sylvia-girl3 小时前
【一】:Linux基础指令
linux·运维·服务器