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

相关推荐
雪落漂泊10 分钟前
Linux进程(四)概念:命令行参数和环境变量篇
linux·运维·服务器
方便面不加香菜10 分钟前
Docker Container -- 容器命令详解
运维·docker·容器
say_fall1 小时前
【Linux系统编程】Linux进程信号:从“外卖到了“到内核里的一张位图
linux·运维·服务器·车载系统·智能硬件
Z21-X1 小时前
云原生运维实战笔记:企业网站综合上云部署与云运维服务全景解析
运维·笔记·学习·云原生
Decay__2 小时前
19_MySQL 告警与自动化运维 —— 告警分级收敛 / Webhook / 定时巡检 / 脚本库
运维·数据库·sql·mysql·架构
FungLeo2 小时前
成为全栈·基础补充·Linux 服务器入门
linux·运维·服务器·ssh·部署·成为全栈
爱和冰阔落2 小时前
【Linux网络】TCP 服务器怎么写?从 listen、accept 到 read/write,手写完整 Echo Server
linux·运维·服务器·网络
鲁邦通物联网2 小时前
工业装备OEM远程服务架构:边缘计算网关与售后运维系统设计
运维·边缘计算·数据采集·工业数据采集·边缘计算网关·plc数采·厂内数采
冯小鸟的探戈3 小时前
电脑重生之安装xp系统
运维·服务器·电脑