Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Blockchain by (12.7k points)

I am setting up a custom Hyperledger Fabric v1.2 blockchain network with 3 peers and 3 orgs using a private data collection. The side database is CouchDB. I use fabric-node-sdk to connect to the blockchain. The chaincode is instantiated without any errors but it is not possible to invoke a chaincode method that puts data into the collection.

The following error is displayed in the docker log of the peer that instantiated the chaincode and that is also the endorsing peer of the transaction:

> 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

Note that the required peer count for the collection is 3. Obviously the data are not even stored in the side db of the endorsing peer itself even though each peer has its own couchdb container.

The couchdb containers log an error like the following. Apart from that they seem to work properly.

>[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}]}]

Why are no private data stored in the side dbs and why does dissemination fail?

Thanks in advance.

1 Answer

0 votes
by (29.5k points)
edited by

 For private data collections to work, you need to set up cross-organization gossip. This means you'll need to make sure that you add the anchor peer(s) for each org to your channel configuration.

please refer this link for step by step guide https://hyperledger-fabric.readthedocs.io/en/release-1.2/build_network.html

Know the blockchain better through Blockchain Certification by Intellipaat.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...