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

相关推荐
天才奇男子6 小时前
HAProxy高级功能全解析
linux·运维·服务器·微服务·云原生
小李独爱秋6 小时前
“bootmgr is compressed”错误:根源、笔记本与台式机差异化解决方案深度指南
运维·stm32·单片机·嵌入式硬件·文件系统·电脑故障
Dying.Light8 小时前
Linux部署问题
linux·运维·服务器
S19018 小时前
Linux的常用指令
linux·运维·服务器
萤丰信息8 小时前
AI 筑基・生态共荣:智慧园区的价值重构与未来新途
大数据·运维·人工智能·科技·智慧城市·智慧园区
傻小胖8 小时前
21.ETH-权益证明-北大肖臻老师客堂笔记
笔记·区块链
小义_8 小时前
【RH134知识点问答题】第7章 管理基本存储
linux·运维·服务器
运维小欣8 小时前
Agentic AI 与 Agentic Ops 驱动,智能运维迈向新高度
运维·人工智能
_运维那些事儿9 小时前
VM环境的CI/CD
linux·运维·网络·阿里云·ci/cd·docker·云计算
Trouvaille ~10 小时前
【Linux】UDP Socket编程实战(一):Echo Server从零到一
linux·运维·服务器·网络·c++·websocket·udp