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

相关推荐
从后端到QT28 分钟前
SRS流媒体服务器(8)源码分析之rtc/rtmp互相转码详解
运维·服务器·实时音视频
CodeWithMe30 分钟前
Nginx入门进阶:从零到高手的实战指南
运维·nginx
鹏大师运维33 分钟前
在银河麒麟V10 SP1上手动安装与配置高版本Docker的完整指南
linux·运维·docker·容器·麒麟·统信uos·中科方德
QMCY_jason37 分钟前
linux 内存占用排查 vm.nr_hugepages
linux·运维·服务器
半方白1 小时前
通过 ks.cfg 文件实现 openEuler 系统自动部署
运维·自动化运维
moppol1 小时前
容器化 vs 虚拟机:什么时候该用 Docker?什么时候必须用 VM?
运维·docker·容器
ZPC82101 小时前
ubuntu 6.8.0 安装xenomai3.3
linux·运维·ubuntu
一梦浮华2 小时前
自学嵌入式 day30 IPC:进程间通信
linux·运维·服务器
精英的英3 小时前
在Ubuntu 24.04主机上创建Ubuntu 14.04编译环境的完整指南
linux·运维·ubuntu
求索小沈3 小时前
ubuntu22.04安装anaconda
linux·运维·服务器