【问题标题】:Questions on CA authorization (balance-transfer hyperledger)关于 CA 授权的问题(余额转移超级账本)
【发布时间】:2018-08-27 05:16:41
【问题描述】:

我正在尝试运行链接中的余额转移示例:https://github.com/hyperledger/fabric-samples/tree/master/balance-transfer#sample-rest-apis-request

我想问为什么我在授权的情况下仍然可以调用chaincode并成功运行:Bearer是org1但调用是在Org2上完成的([“peer1.org2.example.com”)?为什么这不会导致授权错误?

另外,为什么我可以在Org2上查询chaincode use Org1证书。是否存在与 CA 相关的设置问题?

echo "POST invoke chaincode on peers of Org1"
echo
TRX_ID=$(curl -s -X POST \
http://localhost:4000/channels/mychannel/chaincodes/mycc \
-H "authorization: Bearer $ORG1_TOKEN" \
-H "content-type: application/json" \
-d '{
"peers": ["peer1.org2.example.com"],
"fcn":"move",
"args":["a","b","10"]
}')
echo "Transacton ID is $TRX_ID"
echo
echo

非常感谢。

【问题讨论】:

    标签: hyperledger-fabric hyperledger ca


    【解决方案1】:

    这是因为 JSON 字符串中的 peers 是指背书节点。它可以留空。授权是基于token的,交易会根据日志在org1 peers上完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多