fabric升級鏈碼步驟


Fabric 2.2.1 升級鏈碼步驟

  1. 在通道所屬的對等節點安裝鏈碼
peer lifecycle chaincode install \
    ${CC_NAME}.tar.gzs
  1. 查詢鏈碼是否被安裝
peer lifecycle chaincode queryinstalled
  1. 機構1審批,檢查鏈碼定義是否准備好提交
    (1) 機構審批
peer lifecycle chaincode \
    approveformyorg \
    -o localhost:7050 \
    --ordererTLSHostnameOverride orderer.example.com \
    --tls \
    --cafile $ORDERER_CA \
    --channelID $CHANNEL_NAME \
    --name ${CC_NAME} \
    --version ${CC_VERSION} \
    --package-id ${PACKAGE_ID} \
    --sequence ${CC_SEQUENCE} ${INIT_REQUIRED} ${CC_END_POLICY} ${CC_COLL_CONFIG}
(2) 檢查鏈碼是否准備好
peer lifecycle chaincode checkcommitreadiness \
    --channelID $CHANNEL_NAME \
    --name ${CC_NAME} \
    --version ${CC_VERSION} \
    --sequence ${CC_SEQUENCE} ${INIT_REQUIRED} ${CC_END_POLICY} ${CC_COLL_CONFIG} \
    --output json
  1. 機構2審批,檢查鏈碼定義是否准備好提交
  2. 提交鏈碼定義
peer lifecycle chaincode commit \
    -o localhost:7050 \
    --ordererTLSHostnameOverride orderer.example.com \
    --tls \
    --cafile $ORDERER_CA \
    --channelID $CHANNEL_NAME \
    --name ${CC_NAME} $PEER_CONN_PARMS \
    --version ${CC_VERSION} \
    --sequence ${CC_SEQUENCE} ${INIT_REQUIRED} ${CC_END_POLICY} ${CC_COLL_CONFIG}
  1. 查詢提交定義的結果
peer lifecycle chaincode \
    querycommitted \
    --channelID $CHANNEL_NAME \
    --name ${CC_NAME}

驗證升級成功

鏈碼更新完成,日志

2021-09-27 02:25:48.886 UTC [lifecycle] update -> INFO 0b0 Updating cached definition for chaincode 'ncapledger' on channel 'chl-01'
2021-09-27 02:25:48.886 UTC [lifecycle] update -> INFO 0b1 Chaincode with package ID 'ncapledger_20210927:cd7711fdbb05c99c74f3a7cc50dc7516eb3d84c17b5da1019f539a0099750a0a' now available on channel chl-01 for chaincode definition ncapledger:20210927


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM