對于Fabric2.3 peer chaincode invoke的詳細決議
在測驗Fabric-samples的資產轉移模型(asset-transfer-basic)時,在該Go智能合約被打包,安裝,批準,提交到通道完成后,最后需要呼叫寫好的chaincode來初始化內置寫好的賬本,即InitLedger函式,初始化呼叫該函式的指令很長,特地單獨辟出來學習記錄一下:
//該指令用于將已經提交到通道的鏈碼進行一個用的調
peer chaincode invoke
//本地埠
-o localhost:7050
//驗證TLS連接時使用的排序節點主機名
--ordererTLSHostnameOverride orderer.example.com
//與排序節點通信時使用 TLS
--tls
//包含排序端點的 PEM 編碼可信證書的檔案路徑
--cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem"
//在哪個通道上執行,應該是已經提交完成的通道上
-C mychannel
//鏈碼名字
-n basic
//要連接的背書節點埠地址
--peerAddresses localhost:7051
//如果TLS啟用了,背書節點需要鏈接到TLS根證書的路徑,
--tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
//第二個背書節點的埠地址
--peerAddresses localhost:9051
//第二個背書節點需要鏈接到TLS根證書的路徑
--tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
//JSON 格式的鏈碼的建構式訊息
-c '{"function":"InitLedger","Args":[]}'
詳細決議在注釋中,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/302852.html
標籤:區塊鏈
