Hyperledger Fabric New Chaincode Lifecycle -- Decentralized Chaincode Government

  1. The command to get logs from container is

docker logs -f

  1. The Chaincode Invoke command is read like this,

    • orderer: orderer.example.com (and its TLS root certificate)
    • channel name: mychannel
    • chaincode name: fabcar endorsing peers:
    • peer0.org1.example.com and peer0.org2.example.com (and their TLS root certificates)
    • arguments: [“createCar”, “CAR12”, “Honda”, “Accord”, “black”, “Tom”]

docker exec cli peer chaincode invoke -o orderer.example.com:7050 --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 -C mychannel -n fabcar --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c ‘{“Args”:[“createCar”, “CAR12”, “Honda”, “Accord”, “black”, “Tom”]}’

3. Lifecycle chaincode

  1. Package chaincode
  2. Install chaincode package on selected peers in
  3. each organization Approve chaincode definition for each organization
  4. Commit chaincode definition to channel when lifecycle endorsement policy is satisfied

前 3 步分别完成,可互不干扰,甚至合约内容不是完全相同(但大概逻辑需一直,或者说一部分逻辑是相同的,否则这个 consortium 也是无意义的)。
Hyperledger Fabric New Chaincode Lifecycle -- Decentralized Chaincode Government_第1张图片
比如 sacc ,sacc-age(比 sacc 多了一句判断, 68-70)
Hyperledger Fabric New Chaincode Lifecycle -- Decentralized Chaincode Government_第2张图片
Hyperledger Fabric New Chaincode Lifecycle -- Decentralized Chaincode Government_第3张图片

你可能感兴趣的:(Hyperledger Fabric New Chaincode Lifecycle -- Decentralized Chaincode Government)