首页 文章

无法在Hyperledger Fabric中分发私有集合

提问于
浏览
0

我正在使用私有数据集合设置一个自定义的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容器,数据也不会存储在支持对等方自身的边db中 .

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中,为什么传播失败?

提前致谢 .

1 回答

  • 1

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

相关问题