fabric相关操作

1.打包链码
peer lifecycle chaincode package
2.安装链码
peer lifecycle chaincode install
3.查看链码列表
peer lifecycle chaincode queryinstalled
4.同意链码
peer lifecycle chaincode approveformyorg
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com --channelID mychannel --name papercontract -v 0 --package-id ORDERER_CA
例子
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com --channelID mychannel --name papercontract -v 0 --package-id ORDERER_CA
5.链码提交到channel
peer lifecycle chaincode commit

peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --peerAddresses localhost:7051 --tlsRootCertFiles {PEER0_ORG2_CA} --channelID mychannel --name papercontract -v 0 --sequence 1 --tls --cafile $ORDERER_CA --waitForEvent
6,检查背书
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract --version 1.0 --sequence 1 --output json --init-required

你可能感兴趣的:(fabric相关操作)