#Peer
常用命令:
#peer chaincode --help
#peer channel list --help
--logging-level <string>
#<string>:debug,info,notice,warning,error,critical
--version
peer命令包含五个不同的自命令:
###peer chaincode [option] [flags]
#####peer chaincode install [flags]
将指定的链代码打包到部署规范中,并将其保存到peer路径中。参数:
-c:JSON字串的链代码构造函数消息(默认"{}")
-h:帮助
-l:编写chaincode的语言,默认"golang"
-n:chaincode名
-p:chaincode路径
-v:chaincode版本
-o:orderer节点
#####peer chaincode instantiate [flags]
-C:channel ID string
-c:JSON字串的链代码构造函数消息(默认"{}")
-h:帮助
-l:编写chaincode的语言,默认"golang"
-n:chaincode名
-E: The name of the endorsement system chaincode to be used for this chaincode
-P:与此代码相关的认可政策
-o:orderer节点
实例
export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile $ORDERER_CA -C mychannel -n mycc -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P "AND ('Org1MSP.peer','Org2MSP.peer')"

本文总结了Hyperledger Fabric中涉及Peer、Chaincode、Channel、Logging、Node等关键操作的常用命令,包括chaincode的安装、实例化、调用、升级等,以及通道创建、加入、信息获取等流程,还有日志管理和节点状态查看。了解这些命令有助于深入理解Fabric的运作机制。
最低0.47元/天 解锁文章
264

被折叠的 条评论
为什么被折叠?



