【问题标题】:Failed to distribute private collection in Hyperledger Fabric无法在 Hyperledger Fabric 中分发私有集合
【发布时间】:2019-02-26 02:53:21
【问题描述】:

我正在使用私有数据集合设置一个自定义的 Hyperledger Fabric v1.2 区块链网络,其中包含 3 个对等点和 3 个组织。侧数据库是 CouchDB。我使用 fabric-node-sdk 连接到区块链。链码实例化没有任何错误,但无法调用将数据放入集合的链码方法。

在实例化链码的对等方的 docker 日志中显示以下错误,该对等方也是交易的背书对等方:

> 2018-09-21 13:32:52.163 UTC [gossip/privdata] func1 -> ERRO 036 Failed disseminating private RWSet for TxID e2f0a03885bd31232042a19ff8a7eb36cef92f8a6ed24fcb0e3eed2f52b5c037 , namespace contract collection collection0 : Requested to send to at least 3 peers, but know only of 0 suitable peers.

>2018-09-21 13:32:52.163 UTC [gossip/service] DistributePrivateData -> ERRO 037 Failed to distributed private collection, txID e2f0a03885bd31232042a19ff8a7eb36cef92f8a6ed24fcb0e3eed2f52b5c037 channel coachannel due to Failed disseminating 1 out of 1 private RWSets

请注意,集合所需的对等点计数为 3。显然,即使每个对等点都有自己的 couchdb 容器,数据甚至也不存储在背书对等点本身的侧数据库中。

couchdb 容器记录如下错误。除此之外,它们似乎工作正常。

>[notice] 2018-09-21T16:26:38.406978Z nonode@nohost <0.318.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:403) <= mem3_shards:load_shards_from_disk/1(line:378) <= mem3_shards:load_shards_from_disk/2(line:407) <= mem3_shards:for_docid/3(line:91) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2018-09-21T16:26:38.407028Z nonode@nohost emulator -------- Error in process <0.319.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,403}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,378}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,407}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,91}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}

为什么侧dbs中没有存储私有数据,为什么传播失败?

提前致谢。

【问题讨论】:

    标签: hyperledger-fabric hyperledger blockchain ibm-blockchain


    【解决方案1】:

    为了使私人数据收集工作,您需要设置跨组织八卦。这意味着您需要确保将每个组织的锚节点添加到您的频道配置中。您可以在文档中找到所有必需的信息,但在高层次上,您需要在 configtx.yaml 文件中为每个组织添加锚点,然后在订购服务运行并创建通道后,每个组织都需要执行频道更新以添加他们的锚节点。 https://hyperledger-fabric.readthedocs.io/en/release-1.2/build_network.html 将引导您完成这些步骤。

    【讨论】:

    • 感谢您提供这个非常有用的提示!实际上,该频道并未更新以包括锚点对等点。现在它工作正常。
    • 非常好……乐于助人
    • 哦,非常感谢@GariSingh,我整个周末都在解决这个问题,最后我通过在启动网络后“仅”运行更新来解决它
    • 如何使用节点 sdk 添加锚节点?我了解如何使用 cli 容器来做到这一点,但我希望使用 node sdk 实现自动化
    猜你喜欢
    • 2018-12-28
    • 2021-12-10
    • 1970-01-01
    • 2018-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多