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

相关推荐
H1346948904 分钟前
服务器异地备份,服务器异地备份有哪些方法?
运维·服务器
ImAlex6 分钟前
运维大师教你使用流量监控神器nethogs分析Linux进程网络流量
linux·运维
ImAlex10 分钟前
运维大神教你如何用iftop和ss命令结合排查带宽占用高的进程
linux·运维
OneBlock Community13 分钟前
什么是模块化区块链?Polkadot 架构解析
架构·区块链
Lonwayne31 分钟前
Web服务器技术选型指南:主流方案、核心对比与策略选择
运维·服务器·前端·程序那些事
法迪44 分钟前
Linux电源管理(2)_常规的电源管理的基本概念和软件架构
linux·运维·服务器·功耗
古德赖可可1 小时前
chrony服务器(2)
linux·运维·服务器
码码哈哈0.01 小时前
同样开源的自动化工作流工具n8n和Dify对比
运维·开源·自动化
running thunderbolt2 小时前
Linux:基础IO && 文件系统
linux·运维·性能优化
GOATLong2 小时前
网络基础概念
linux·运维·服务器·网络·arm开发·c++