Re: peer discovery/collection errors when calling chaincode from nodejs client
Simeon MacMillen
Hi Mark, Thank you for your response and for your helpful direction! The explicit designation of endorsing peer at transaction submit was exactly what I was looking for. After adapting this, I was able to successfully resolve the write transactions through the Dockerized client. Sincerely,
On 3/25/21 2:42 PM, Mark Lewis wrote:
You might need to set some discovery interests for the private data collections you are using. See the "using chaincode to chaincode calls and collections" section on this page for details:
|
|||||||
|
|||||||
Re: Editing default signature policy for chaincode triggers error while running transactions: received discovery error:failed constructing descriptor for chaincodes. Commercial paper on Test-network
#policies
#fabric-chaincode
#fabric-questions
#fabric-endorser
sangieri@...
Hi Nik, Thanks for answering.
I confirm the chaincode has been committed to the channel: peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --peerAddresses localhost:7051 --tlsRootCertFiles ${PEER0_ORG1_CA} --peerAddresses localhost:9051 --tlsRootCertFiles ${PEER0_ORG2_CA} --channelID mychannel --signature-policy "OR('Org1.peer', 'Org2.peer')" --name papercontract -v 0 --sequence 1 --tls --cafile $ORDERER_CA --waitForEvent 2021-03-26 13:51:22.432 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [a2633e88ce9a337c523dfb24fc33914cb82fb8fadf24b01609331a64d77c0a7b] committed with status (VALID) at localhost:7051 2021-03-26 13:51:22.456 UTC [chaincodeCmd] ClientWait -> INFO 002 txid [a2633e88ce9a337c523dfb24fc33914cb82fb8fadf24b01609331a64d77c0a7b] committed with status (VALID) at localhost:9051
and that all docker containers seem to be properly setup: docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e0dafb74a871 dev-peer0.org2.example.com-cp_0-ddca913c004eb34f36dfb0b4c0bcc6d4afc1fa823520bb5966a3bfcf1808f40a-5c83b377cab7f417bcf7f196e6cbde2f685ab9db73ea78fa733ccb4c3af65781 "docker-entrypoint.s…" 6 seconds ago Up 5 seconds dev-peer0.org2.example.com-cp_0-ddca913c004eb34f36dfb0b4c0bcc6d4afc1fa823520bb5966a3bfcf1808f40a 25f6984c346f dev-peer0.org1.example.com-cp_0-ddca913c004eb34f36dfb0b4c0bcc6d4afc1fa823520bb5966a3bfcf1808f40a-0829f3256ad634f959b8cb39756634e18a5aecbc11e7cc9cdb38c88304e03b4b "docker-entrypoint.s…" 6 seconds ago Up 5 seconds dev-peer0.org1.example.com-cp_0-ddca913c004eb34f36dfb0b4c0bcc6d4afc1fa823520bb5966a3bfcf1808f40a 38ebe71216cc hyperledger/fabric-tools:latest "/bin/bash" 3 minutes ago Up 3 minutes cli 6bb6d323df4a hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 0.0.0.0:7051->7051/tcp peer0.org1.example.com d16b32dce7b9 hyperledger/fabric-peer:latest "peer node start" 3 minutes ago Up 3 minutes 7051/tcp, 0.0.0.0:9051->9051/tcp peer0.org2.example.com 115460e0646b couchdb:3.1.1 "tini -- /docker-ent…" 3 minutes ago Up 3 minutes 4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp couchdb1 9fb31d32ca3f couchdb:3.1.1 "tini -- /docker-ent…" 3 minutes ago Up 3 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb0 c8795371969d hyperledger/fabric-orderer:latest "orderer" 3 minutes ago Up 3 minutes 0.0.0.0:7050->7050/tcp orderer.example.com 7adfadccb74a hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 3 minutes ago Up 3 minutes 7054/tcp, 0.0.0.0:8054->8054/tcp ca_org2 78f6a1bfd0d4 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 3 minutes ago Up 3 minutes 0.0.0.0:7054->7054/tcp ca_org1 f1b15beb5920 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 3 minutes ago Up 3 minutes 7054/tcp, 0.0.0.0:9054->9054/tcp ca_orderer
Stefano
|
|||||||
|
|||||||
Re: Editing default signature policy for chaincode triggers error while running transactions: received discovery error:failed constructing descriptor for chaincodes. Commercial paper on Test-network
#policies
#fabric-chaincode
#fabric-questions
#fabric-endorser
Nikhil Gupta
Hi, Can you confirm that the chaincode has been committed to the channel? Or can you do a docker ps to confirm that the chaincode containers have started. This error looks like the chaincode may not be on the channel. Nik
On Fri, Mar 26, 2021 at 8:35 AM <sangieri@...> wrote:
|
|||||||
|
|||||||
Editing default signature policy for chaincode triggers error while running transactions: received discovery error:failed constructing descriptor for chaincodes. Commercial paper on Test-network
#policies
#fabric-chaincode
#fabric-questions
#fabric-endorser
sangieri@...
Using the default configuration I can run all the functions inside the application folder of commercial paper on test-network without any problem If I edit the default signature policy in the approval and commitment of the chaincode definition i am unable to run the issue.js code without experiencing the service discovery error: " Connect to Fabric gateway. Use network channel: mychannel. Use org.papernet.commercialpaper smart contract. Submit commercial paper issue transaction. 2021-03-26T12:05:04.277Z - error: [DiscoveryService]: send[papercontract] - Channel:mychannel received discovery error:failed constructing descriptor for chaincodes:<name:"papercontract" > Error processing transaction. Error: DiscoveryService: papercontract error: failed constructing descriptor for chaincodes:<name:"papercontract" > Error: DiscoveryService: papercontract error: failed constructing descriptor for chaincodes:<name:"papercontract" > at DiscoveryService.send (/home/sangieri/TestProject/commercial-paper/organization/magnetocorp/application/node_modules/fabric-common/lib/DiscoveryService.js:363:11) Disconnect from Fabric gateway. Issue program complete."
According to documentation, to edit the signature policy I use the following commands: peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com --channelID mychannel --signature-policy "OR('Org1.peer', 'Org2.peer')" --name papercontract -v 0 --package-id $PACKAGE_ID --sequence 1 --tls --cafile $ORDERER_CA peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --peerAddresses localhost:7051 --tlsRootCertFiles ${PEER0_ORG1_CA} --peerAddresses localhost:9051 --tlsRootCertFiles ${PEER0_ORG2_CA} --channelID mychannel --signature-policy "OR('Org1.peer', 'Org2.peer')" --name papercontract -v 0 --sequence 1 --tls --cafile $ORDERER_CA --waitForEvent
The Anchor peer are set. The connectionOptions in issue.js are set properly: let connectionOptions = { identity: userName, wallet: wallet, discovery: { enabled:true, asLocalhost: true } };
Any help?
|
|||||||
|
|||||||
Re: Problematic raspberry support
Nikos Karamolegkos
Thank you for your time. I just ran the test-network (after your contribution) but the error remains. My steps were: make docker clean, make docker, make native, copy the bin into fabric samples.
|
|||||||
|
|||||||
Re: Fabric Contributor Meeting - March 17, 2021 - any agenda topics?
Vitalii Demianets
Hi David and all! I would like to propose one more item for March 31st agenda. We would like to open a discussion on our RFC: https://github.com/hyperledger/fabric-rfcs/pull/44 I am planning to attend and present it from the norbloc side. -- // Vitalii Demianets @ norbloc AB
On Tue, Mar 16, 2021 at 11:53 PM David Enyeart <enyeart@...> wrote:
|
|||||||
|
|||||||
Re: peer discovery/collection errors when calling chaincode from nodejs client
Mark Lewis
You might need to set some discovery interests for the private data collections you are using. See the "using chaincode to chaincode calls and collections" section on this page for details:
https://hyperledger.github.io/fabric-sdk-node/release-2.2/tutorial-discovery-fabric-network.html You can also explicitly specify the endorsing organizations to use for a given transaction submit: https://hyperledger.github.io/fabric-sdk-node/release-2.2/module-fabric-network.Transaction.html#setEndorsingOrganizations
|
|||||||
|
|||||||
Re: Fabric network org structure reg.
Tsvetan Georgiev
Hi Indirajith, Yes it is better to use dedicated MSP for the ordering orgs. This means a business organization may use multiple MSPs to run peers or orderers. You can find details on the MSP concept here: https://hyperledger-fabric.readthedocs.io/en/latest/membership/membership.html There are different ways to model and map a business organization to MSP(s): https://hyperledger-fabric.readthedocs.io/en/latest/membership/membership.html#what-role-does-an-organization-play-in-an-msp I recommend going though the production deployment guide: https://hyperledger-fabric.readthedocs.io/en/release-2.2/deployment_guide_overview.html Hope that helps!
---- On Wed, 24 Mar 2021 04:40:35 -0400 indirajith <indirajithv@...> wrote ----
|
|||||||
|
|||||||
Hyperledger Fabric Documentation Workgroup call - Western hemisphere - Fri, 03/26/2021 11:00am-12:00pm
#cal-reminder
fabric@lists.hyperledger.org Calendar <fabric@...>
Reminder: Hyperledger Fabric Documentation Workgroup call - Western hemisphere When: Friday, 26 March 2021, 11:00am to 12:00pm, (GMT-04:00) America/New York Where:https://zoom.us/my/hyperledger.community.backup?pwd=dkJKdHRlc3dNZEdKR1JYdW40R2pDUT09 Organizer: Pam Andrejko pama@... Description: Documentation workgroup call. Join Zoom Meeting
https://zoom.us/j/6223336701?pwd=dkJKdHRlc3dNZEdKR1JYdW40R2pDUT09
Meeting ID: 622 333 6701
Passcode: 475869
|
|||||||
|
|||||||
peer discovery/collection errors when calling chaincode from nodejs client
Simeon MacMillen
Hello Fabric community, I am encountering a couple issues when accessing/writing data
to a Fabric (2.3) network from a Node.js client. I have a 4-org
network running on 4 different VPS instances. (Each VPS hosts 1
org with dockerized peer and orderer instances. The VPSs are
linked via a Docker swarm overlay network.) There are 2 shared
private data collections, one with 3 orgs, 1 with 2 orgs. (Only
1 org is a member of both collections.) When I start my node client (on any of the VPS instances), I get error messages like these:
It seems that the client org is having trouble connecting with the other orgs outside of Docker. Note that "asLocalhost" is set to true. However, after displaying the error messages, I can use the
client to successfully read and write to the ledger. So it
seems the error messages are more of a cosmetic issue than a
functional issue? (They certainly would not inspire confidence
in a demo!) The error messages also occur randomly after other
read/write requests.
To deal with this problem, I tried dockerizing my node client. This way, the client could use the same docker overlay network and natively resolve the other hosts. This worked great (I thought) - no more errors on startup or queries! However, when I try to write data to the ledger, I get this error:
So I solved the discovery problem, but now the client is connecting to any organization peer it wants to? I could avoid calling the verifyClientOrgMatchesPeerOrg function in the Chaincode, but that would potentially introduce other problems. Is there a way to force the client to only use the client org's
peer? Or is there a better approach here? Sincerely,
|
|||||||
|
|||||||
Re: HyperLedger Fabric v2.3 Endorsement Policy did not come into action
David Enyeart
This is working as expected. You updated the size field but not the version field. The read set check only checks the version field. It is up to the chaincode to check other fields such as asset ownership (and size, if there are business rules around that, such as size not being allowed to change in an update). The asset transfer chaincode is a trivial sample and only checks for asset existence in state database by key. So in your case chaincode execution succeeded because it passed the asset existence check, endorsements succeeded, and validation succeeded since both endorsements were over the same read set (version) and write set. Hi, I was trying to test out the endorsement policy feature of Fabric with the Running a Fabric Application tutorial and I have encountered a few questions/issues. Instead of using LevelDB, I up the network using CouchDB by changing the command ZjQcmQRYFpfptBannerStart This Message Is From an External Sender This message came from outside your organization. ZjQcmQRYFpfptBannerEnd Hi, I was trying to test out the endorsement policy feature of Fabric with the Running a Fabric Application tutorial and I have encountered a few questions/issues. Instead of using LevelDB, I up the network using CouchDB by changing the command to ./network.sh up createChannel -c mychannel -ca -s couchdb. After the call to InitLedger, I manually edit asset2's "Size" field value to another random value through fauxton, accessed from http://127.0.0.1:5984/_utils/ (couchdb0, which belongs to organization 1). So at this point, asset2 has 2 different value sitting in couchdb0 and couchdb1. Then I invoke the UpdateAsset function in the chaincode to update asset2's value. I was expecting an error about endorsement policy is not met or something to be thrown as the different value of asset2 in couchdb0 and couchdb1 should results in different RW set. peer0.org1.example.com|2021-03-23 09:03:09.568 UTC [statecouchdb] commitUpdates -> WARN 0b4 CouchDB batch document update encountered an problem. Reason:Document update conflict., Retrying update for document ID:asset2 I did notice this warning in logspout however there was no error caught in my try catch block, and it seems that a valid block is committed and the world states is getting updated as usual without any error. Shouldn't the different RW Set would cast the transaction as invalid and the world states wouldn't be updated? Regards, Sean
|
|||||||
|
|||||||
HyperLedger Fabric v2.3 Endorsement Policy did not come into action
Ming Xian Ng
Hi, I was trying to test out the endorsement policy feature of Fabric with the Running a Fabric Application tutorial and I have encountered a few questions/issues. Instead of using LevelDB, I up the network using CouchDB by changing the command to Then I invoke the
I did notice this warning in Shouldn't the different RW Set would cast the transaction as invalid and the world states wouldn't be updated? Regards, Sean
|
|||||||
|
|||||||
Re: Problematic raspberry support
Matthew Sykes
I had some time this morning so I played around with the peer image created on linux/aarch64 (linux/arm64). To get to the bottom of why the program was dying during initialization, I commented out all of the code in the peer main and slowly added back in the package imports until I hit the segfault again. I went to the package introducing the problem and repeated the process until I got to the bottom.
After running down the tree, the package that caused the problem was `plugin’ and the only import left in Fabric is from `github.com/hyperledger/fabric/core/handlers/library`. It looks like plugins work with glibc (the native builds and tests seem fine) so it has something to do with musl. I’ll put together a PR to enable builds without plugins some time today. After that’s in, the images built with alpine and musl should work on linux/aarch64 (linux/arm64). It’s still not something we’ll be testing and supporting at this time but it may unblock your efforts.
|
|||||||
|
|||||||
Fabric network org structure reg.
indirajith
Dear Fabric Community, I would like to know what is the best practice or prefered method to design a fabric network in 2.x versions? Shall we have orderers in the same organization as peers or should we need to have a seperate org for orderers? Or should we have two different orgs for peers and orderers for each participating orgs? Can anyone shed some light and point me to resources? I could not get any response for the query in the chat channel. Thanks in advance. Regards, Indirajith.
|
|||||||
|
|||||||
Re: Smart BFT
grapebaba
Hi guys I looked at several git branch prefix release-1.4-BFT, what is the difference between them? What is the correct version for docker https://hub.docker.com/r/smartbft/fabric-peer?
On Mon, Oct 26, 2020 at 10:59 PM Oleg Martianov <olegmartianov@...> wrote:
|
|||||||
|
|||||||
Re: Orderer ledger pruning
Vitalii Demianets
The RFC draft has been submitted, here: https://github.com/hyperledger/fabric-rfcs/pull/44 Please review! -- // Vitalii Demianets @ norbloc AB
On Thu, Feb 25, 2021 at 1:06 PM Vitalii Demianets via lists.hyperledger.org <vitalii=norbloc.com@...> wrote:
|
|||||||
|
|||||||
Private Chaincode Lab - Tue, 03/23/2021
#cal-notice
fabric@lists.hyperledger.org Calendar <noreply@...>
Private Chaincode Lab When: Where: Organizer: Description:
|
|||||||
|
|||||||
Re: Problematic raspberry support
Matthew Sykes
Yeah, they’re all my commits so I’m very familiar with them. The change you’re referencing this time was required to get through the link phase in the alpine containers but the binaries in the containers still aren’t exercised.
As for clues, I don’t have any. If the binaries are going belly-up with a segfault, I’d start with that. It’s probably related to the musl libc used in the alpine container.
|
|||||||
|
|||||||
Re: Problematic raspberry support
Brett T Logan <development.brett@...>
While I hold that those changes do in fact make building Fabric for ARM64 possible, as Matt mentioned it's not officially supported. I can say that I've tested that change on PI4 and when done right with Go chaincode, that change in itself makes it possible to run Fabric on ARM64. There are many threads all over the place with people who have had success doing this.
On Tue, Mar 23, 2021 at 9:46 AM Nikos Karamolegkos <nkaram@...> wrote:
|
|||||||
|
|||||||
Re: Problematic raspberry support
Nikos Karamolegkos
Sorry I misclick the commit link. The correct one is this. Also, this answer made me believe that raspberry pi4 is supported (even at an early stage). I can take a look on the problem but I need some clues. Where should I start? -- Nikos Karamolegkos R & D engineer at ICS-FORTH Telecommunications and Networks Lab (TNL)
|
|||||||
|