【发布时间】:2017-09-29 17:52:49
【问题描述】:
我正在使用一组 Hyperledger 1.0.2 docker 映像和 composer 0.11.3 我使用的练习网络是basic-sample-network,它带有一个 SampleParticipant 和一个 SampleAsset。 我可以使用composer参与者添加和JSON sn-p从命令行部署参与者。 我还没有找到将 SampleAsset 插入资产注册表的等效命令行方法。当我使用 composer-rest-server 发布定义 SampleAsset 的 JSON sn-p 时,它返回了以下错误
Error: Peer has rejected transaction '4d2...91f' with cdoe MVCC_READ_CONFLICT
然后我在阅读了关于 BatchTimeout 和锁定的评论后重新提交,因为我是婴儿链上的单个用户,我没有修改它。第二次,REST服务器返回
Error: Failed to add object with ID 'assetId:1' as the object already exists)
我可以验证资产注册表已使用作曲家网络列表进行了更新:
name: basic-sample-network
models:
- org.hyperledger.composer.system
- org.acme.sample
scripts:
- lib/sample.js
registries:
org.acme.sample.SampleAsset:
id: org.acme.sample.SampleAsset
name: Asset registry for org.acme.sample.SampleAsset
registryType: Asset
assets:
assetId:1:
$class: org.acme.sample.SampleAsset
assetId: assetId:1
owner: resource:org.acme.sample.SampleParticipant#Toby
value: new value
org.acme.sample.SampleParticipant:
id: org.acme.sample.SampleParticipant
name: Participant registry for org.acme.sample.SampleParticipant
registryType: Participant
assets:
Toby:
$class: org.acme.sample.SampleParticipant
participantId: Toby
firstName: Tobias
lastName: Hunter
为什么 REST 服务器出现这种奇怪的行为,它抱怨 MVCC_READ_CONFLICT 但插入了记录,我是否错过了从命令行插入 SampleAsset 的方法?
【问题讨论】:
标签: hyperledger-fabric hyperledger hyperledger-composer