Private Chaincode Lab
When:
04/26/2022
8:00am to 9:00am
(UTC-07:00) America/Los Angeles
Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09
Organizer: Marcus Brandenburger bur@...
Description:
Two of the Hyperleger Labs projects (private data objects and private chain code) are collaborating to develop a "private smart contracts" capability.
Join Zoom Meeting https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09 Meeting ID: 518 494 7650 Passcode: 475869
In addition to the general call for proposals for Hyperledger Global Forum sessions, there are a couple of options for sharing about Hyperledger projects that are being reserved for project leads. We encourage you to take part in these to make the most of the largest Hyperledger event this year.
* Workshops: If you or your team members are attending Global Forum and would like to give a ½ day workshop, please propose one here. We will be able to support a limited number of workshops selected by the Proposals Committee. These are a good way to help people learn how to use and contribute to your project. The submission deadline is Friday, April 29, 2022 at 11:59 PM PDT.
* Meetup: We will be hosting an evening meetup that will be open to the local community and this will allow people who aren’t going to Global Forum to learn more about Hyperledger. The format will be quick lightning style talks and then time to connect with meetup attendees who want to learn more about what you’re doing. Please reach out to dboswell@... if you’d like to speak at the meetup.
If you have questions about either of these or about other ways Hyperledger staff can help you with your project, feel free to let us know. And if you are planning a release or have a big project milestone around the time of Global Forum, let us know and we can help you promote your news.
Thanks,
David
Hello;
So start with the Fabric Gateway SDKs (https://hyperledger.github.io/fabric-gateway/) available in Go ,Nodejs and Java
This will let you connect an application to Fabric, and invoke transactions on the Smart Contract.
If you wish then to expose a gRPC server of your own that’s perfectly fine. We’ve an example of REST version in fabric-samples that will provide some information about the best map to manage Fabric transactions.
As to writing a gRPC server – I’d refer you to googles own docs 😊
Cheers, Matthew
Sent: 25 April 2022 07:27
To: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Is java deprecated for Fabric
Hi All, I need to implement GRPC as a server to post and query data in fabric using Java sdk . Can you please help me in getting started? Thanks, Upma On Tue, Mar 29, 2022 at 8:25 PM upma gupta <upma121gupta@...> wrote:
ZjQcmQRYFpfptBannerStart
|
ZjQcmQRYFpfptBannerEnd
Hi All,
I need to implement GRPC as a server to post and query data in fabric using Java sdk . Can you please help me in getting started?
Thanks,
Upma
On Tue, Mar 29, 2022 at 8:25 PM upma gupta <upma121gupta@...> wrote:
Hi All,
I wanted to check if the Java SDK is deprecated for Fbric 2.2 and higher versions ? Is Java not a choice for fabric implementation?
Regards,
Upma
Hi All,I wanted to check if the Java SDK is deprecated for Fbric 2.2 and higher versions ? Is Java not a choice for fabric implementation?Regards,Upma
Is there a way to determine the ideal load on fabric sdk, where we can get a high throughput?
How can we configure the sdk with the ideal number of connections and so that it will work smoothly without any downtime or minimal down time?
Please could you answer these queries. My knowledge in this area is minimal
Reminder: Documentation Workgroup monthly call
When:
04/22/2022
11:00am to 12:00pm
(UTC-04:00) America/New York
Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09
Organizer: Josh Horton joshh@...
Description:
Schedule, Agendas, Minutes, etc: https://wiki.hyperledger.org/display/fabric/Documentation+Working+Group
while updating the channel config :
peer channel update
I am getting this error:
what is the reason for this?
In Fabric docs, following example is explained at
https://hyperledger-fabric.readthedocs.io/en/release-2.2/readwrite.html It is
mentioned that all transaction viz., T1 to T5 are based on same snapshot of the
world state DB before their validation.
World state: (k1,1,v1), (k2,1,v2), (k3,1,v3), (k4,1,v4), (k5,1,v5)
T1 -> Write(k1, v1'), Write(k2, v2')
T2 -> Read(k1), Write(k3, v3')
T3 -> Write(k2, v2'')
T4 -> Write(k2, v2'''), read(k2)
T5 -> Write(k6, v6'), read(k5)
T1 passes validation because it does not perform any read. Further, the tuple of
keys k1 and k2 in the world state are updated to (k1,2,v1'), (k2,2,v2')
T2 fails validation because it reads a key, k1, which was modified by a
preceding transaction - T1
T3 passes the validation because it does not perform a read. Further the tuple
of the key, k2, in the world state is updated to (k2,3,v2'')
T4 fails the validation because it reads a key, k2, which was modified by a
preceding transaction T1
T5 passes validation because it reads a key, k5, which was not modified by any
of the preceding transactions
I could not understand, how T3 passes the validation though value of K2 is
modified in T1. By the time T3 is to be validated the read-set acquired by T3
is no longer valid as its value has been modified by T1. Can you please explain
this scenario.
Regards,
Satya
------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]
This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
------------------------------------------------------------------------------------------------------------
While signing the newly modified structure :
peer channel signconfigtx -f ordorg_update_envelope.pb
I was getting this error:
Error: Invalid channel create transaction : No configtx file name supplied
Why this error comes?
FABRIC_CFG_PATH ws pointing to configtx
Private Chaincode Lab
When:
04/19/2022
8:00am to 9:00am
(UTC-07:00) America/Los Angeles
Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09
Organizer: Marcus Brandenburger bur@...
Description:
Two of the Hyperleger Labs projects (private data objects and private chain code) are collaborating to develop a "private smart contracts" capability.
Join Zoom Meeting https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09 Meeting ID: 518 494 7650 Passcode: 475869
Hello,
I’d suggest looking at the `fabric-contract-api-go` that will do exactly what you want. Specifically https://github.com/hyperledger/fabric-contract-api-go/blob/main/tutorials/getting-started.md#declaring-a-contract
Thanks Mathew
Sent: 18 April 2022 14:29
To: fabric@...
Subject: [EXTERNAL] [Hyperledger Fabric] #hyperledger-fabric Contract to call a Contract within the same chaincode
Hello , I am trying to implement multiple contracts in a single chaincode in Go lang. Ref:(https://hyperledger-fabric.readthedocs.io/en/release-2.3/smartcontract/smartcontract.html#terminology) We have a method called `InvokeChaincode(chaincodeName ZjQcmQRYFpfptBannerStart
|
ZjQcmQRYFpfptBannerEnd
Hello ,
I am trying to implement multiple contracts in a single chaincode in Go lang.
Ref:(https://hyperledger-fabric.readthedocs.io/en/release-2.3/smartcontract/smartcontract.html#terminology)
We have a method called `InvokeChaincode(chaincodeName
string, args [][]byte,
channel string)` where we will invoke a method ,from one chaincode to another method of another chaincode.,
Do we have any methods where a contract will call another contract in a same chaincode in Fabric Go-SDK.
Eg:
Vehicle chaincode{
Car contract{
create car,
query car
}
boat contract{
create boat,
query boat
}
person contract{
updatevehicles vehicles,
queryvehicles vehicles
}
}
Call create car(car contract) and create boat(Boat contract) in person contract
Thanks in-advance.
Thanks,
Dinesh. A
I am not using localhost or 0.0.0.0 as docker gives problems if you try to create intermediates that way. I then created hosts within the docker network.
I describe the steps taken as concisely as possible:
Enroll peer for identity
Here i have my first doubt. When i enrolled orderers i used the certificates located in the cacerts folders (rca-org0-7052.pem for the orderer on the rca-org0 for istance) and i was sure i need to use the same strategy for the peer. If i try to follow this way, it result in a "unknown owner" error. So i change the certificate and it work but i'm not very sure about the reason.
However, after enrolling the peer for identity and TLS and the admin, i try to start the peer container.
In my docker compose file i have this line:
- CORE_PEER_MSPCONFIGPATH=/tmp/hyperledger/ica1-rca-org0/peer1/msp
But i have the following error:
The folder exists and it has not restriction but the docker compose can't read the content.
Would anyone be able to suggest why?
Thanks
Hello ,
I am trying to implement multiple contracts in a single chaincode in Go lang.
Ref:(https://hyperledger-fabric.readthedocs.io/en/release-2.3/smartcontract/smartcontract.html#terminology)
We have a method called `InvokeChaincode(chaincodeName string, args [][]byte, channel string)` where we will invoke a method ,from one chaincode to another method of another chaincode.,
Do we have any methods where a contract will call another contract in a same chaincode in Fabric Go-SDK.
Eg:
Vehicle chaincode{
Car contract{
create car,
query car
}
boat contract{
create boat,
query boat
}
person contract{
updatevehicles vehicles,
queryvehicles vehicles
}
}
Call create car(car contract) and create boat(Boat contract) in person contract
Thanks in-advance.
Thanks,
Dinesh. A
|
Hey Fabric Community,
Thanks for everyone for their suggestions so far, but I’m still seeing issues with my read/write sets being malformed within the endorsement responses when a single peer is trying to endorse multiple non-conflicting transactions at once.
Here’s my situation (with updated information that I’ve figured out so far):
- 4 organizations, each with one (endorsing) peer
- Nodejs chaincode running in an external container (1 chaincode container per org)
- MAJORITY endorsement policy (so three endorsements required for each transaction)
- 5 Fabric client instances (each running in a Kubernetes pod) that are all executing in parallel
- Each pod pulls a job off a queue and attempts to execute a simple Chaincode transaction that reads/updates one object and creates another (i.e. there should be 2 reads and 2 writes in the read/write set within each endorsement response)
- When each transaction is executed, 3 endorsement proposals are requested and received from 3 different orgs / peers
- Unfortunately, some of the read/write sets within the endorsement responses from various org peers are incorrect, leading to ENDORSEMENT_POLICY_FAILURE errors when the transaction is submitted to the orderer and processed in the block by the peers.
- Some endorsement responses have read/write sets that only contain 1 read and no writes, some contain 3 reads and 1 write, some have other combinations, and some are just fine.
- None of the data touched by the chaincode transactions executed by these 5 client instances overlap – i.e. there are no MVCC_READ_CONFLICTs
- All endorsing peers randomly exhibit this same behaviour, so it’s not a problem with one particular org’s peer
- If I run only one client instance (i.e. 1 kubernetes pod) and process the transactions sequentially, waiting for the block to be delivered before running the next transaction, everything works fine. But that obviously results in debilitatingly poor performance.
So I guess my question is: Are there any known limitations/issues in terms of a single peer responding to multiple (non-conflicting) endorsement requests concurrently?
Thanks so much for your help!
Curtis.
From: Marcos Sarres <marcos.sarres@...>
Date: Thursday, April 7, 2022 at 10:40 AM
To: 'David Faulstich Diniz Reis' <davidfdr@...>, 'Curtis Miles' <curtis@...>
Cc: 'fabric' <fabric@...>
Subject: RES: [Hyperledger Fabric] Transaction read/write sets are bleeding into each otherGood point David,
Please also check for MVCC (Multi Version Concurrent Control) CONFLICT errors at your client and orderer logs.
Regards,
Marcos Sarres | CEO | +55 61 98116 7866
De: fabric@... <fabric@...> Em nome de David Faulstich Diniz Reis
Enviada em: quinta-feira, 7 de abril de 2022 08:31
Para: Curtis Miles <curtis@...>
Cc: fabric <fabric@...>
Assunto: Re: [Hyperledger Fabric] Transaction read/write sets are bleeding into each other
Just as a complement to Marcos and Tsvetan,
I got similar errors due to concurrency control when doing stress tests with the same asset keys.
You may check why the transaction fails using QSCC chaincode:
1 - Evaluate Transaction Method:
/*
* Evaluate a transaction and handle any errors
*/
export const evaluateTransaction = async (contract: Contract, transactionName: string, ...transactionArgs: string[]): Promise<Buffer> => {
const transaction = contract.createTransaction(transactionName);
const transactionId = transaction.getTransactionId();
logger.trace({ transaction }, 'Evaluating transaction');
try {
const payload = await transaction.evaluate(...transactionArgs);
logger.trace(
{
transactionId: transactionId,
payload: payload.toString(),
},
'Evaluate transaction response received',
);
return payload;
} catch (err) {
throw handleTXError(transactionId, err);
}
};
2 - Check status transaction:
/*
* Get the validation code of the specified transaction
*/
export const getTransactionValidationCode = async (qsccContract: Contract, transactionId: string): Promise<string> => {
const data = await evaluateTransaction(qsccContract, 'GetTransactionByID', config.channelName, transactionId);
const processedTransaction = protos.protos.ProcessedTransaction.decode(data);
const validationCode = protos.protos.TxValidationCode[processedTransaction.validationCode];
logger.debug({ transactionId }, 'Validation code: %s', validationCode);
return validationCode;
};
--
I use this as part of my retry logic implemented by Event Source and Saga patterns.
Best regards.
David
Em qua., 6 de abr. de 2022 às 20:29, Tsvetan Georgiev <tsvetan@...> escreveu:
Hi Curtis,
Marcos has a good point and you should check your client logic.
To better understand could you share also how many peers participate in the transaction endorsement? Are those failed/bad transactions part of the block built by the Ordering Service and marked as invalid due to concurrency control version check?
If your transactions don't contain the read/write sets you expect then you definitely have to re-check your chaincode and what your client is actually sending to the peers during the endorsement step.
Regards,
Tsvetan Georgiev
Director, Senofi Inc.
438-494-7854 | tsvetan@...
---- On Wed, 06 Apr 2022 18:54:10 -0400 Marcos Sarres <marcos.sarres@...> wrote ----
Please check your Hyperledger Fabric client.
The endorsement policy should be fulfilled at your API sending the message proposals the the endorsement peers further receiving and packaging the signed proposals to be transmitted to the orderer.
I think your API (HLF Client) is not getting the correct signed proposals from the chaincode endorsing policy orgs.
Regards,
Marcos Sarres | CEO | +55 61 98116 7866
De: fabric@... <fabric@...> Em nome de Curtis Miles
Enviada em: sexta-feira, 1 de abril de 2022 10:32
Para: fabric@...
Assunto: [Hyperledger Fabric] Transaction read/write sets are bleeding into each other
Hello world!
I’ve hit what appears to be a strange situation when testing my soon-to-be production network under a bit of (very light) load. I have a very simple chaincode function that is doing two things within a single transaction:
1. Retrieving a document of type A by id, updating it, and storing it back (using its same id)2. Storing a new object of type B by id (the object is passed in a parameter to the chaincode function)
When I try to execute a number of these transactions in parallel (e.g. 5) such that they are included in the same block, I’m *randomly* getting a ENDORSEMENT_POLICY_FAILURE error. This didn’t make any sense to me because each transaction is dealing with distinct objects of type A and B and nothing else is going on in the network at the time. So I look into the blocks that had the transactions that were failing and noticed something very strange. It looks like the items in the read/write sets in the transactions are bleeding into each other. For example, a single block includes the following read/write sets within three different transactions:
Transaction 1 (which looks correct to me):
{
"namespace": "projectXYZ",
"rwset": {
"reads": [
{
"key": "A1",
"version": {
"block_num": "79389",
"tx_num": "0"
}
},
{
"key": "B1",
"version": null
}
],
"range_queries_info": [],
"writes": [
{
"key": "A1",
"is_delete": false,
"value": "{\"id\":\"1\”, \"type\":\"A\”}"}"
},
{
"key": "B1",
"is_delete": false,
"value": "{\"id\":\"1\”, \"type\":\"B\”}"}"
}
],
"metadata_writes": []
},
"collection_hashed_rwset": []
}
Transaction 2 (has an extra read/write of A3, which I would have expected to be in a different transaction):
{
"namespace": "projectXYZ",
"rwset": {
"reads": [
{
"key": "A2",
"version": {
"block_num": "79389",
"tx_num": "0"
}
},
{
"key": "A3",
"version": {
"block_num": "79389",
"tx_num": "0"
}
},
{
"key": "B2",
"version": null
}
],
"range_queries_info": [],
"writes": [
{
"key": "A2",
"is_delete": false,
"value": "{\"id\":\"2\”, \"type\":\"A\”}"}"
},
{
"key": "A3",
"is_delete": false,
"value": "{\"id\":\"3\”, \"type\":\"A\”}"}"
},
{
"key": "B2",
"is_delete": false,
"value": "{\"id\":\"2\”, \"type\":\"B\”}"}"
}
],
"metadata_writes": []
},
"collection_hashed_rwset": []
}
Transaction 3 (has only a read of A3, with no write of A3 or B3):
{
"namespace": "projectXYZ",
"rwset": {
"reads": [
{
"key": "A3",
"version": {
"block_num": "79389",
"tx_num": "0"
}
}
],
"range_queries_info": [],
"writes": [],
"metadata_writes": []
},
"collection_hashed_rwset": []
}
If I only submit one transaction per block, everything is fine (although for performance reasons, that isn’t going to work for me).
Does anyone have any ideas why this might be happening? Shouldn’t it be fundamentally impossible for these transactions to bleed into each other? Can you think of anything I might be doing wrong that is causing this?
Thanks for any help you can offer!
Curtis.
--
David Reis
Hello, Community
I am a pre-final computer science student from India. Recently, I have contributed to the documentation related issues in the repositories of Hyperledger in one of the open-source programs which has motivated me a lot to contribute more to this project and now I am looking forward to contributing to Hyperledger through the Hyperledger Mentorship Program by contributing to "Identity Mixer Support for both Fabric Gateway SDK for Java and Fabric Gateway Client API for Java" project. As I am a complete beginner, I need help from the community on how I can start?
Here is the link to Project: Identity Mixer Support for both Fabric Gateway SDK for Java and Fabric Gateway Client API for Java
I am looking forward to connecting with you all and learning a lot from this community.
Thank you
Sheetal Jain
https://www.linkedin.com/in/sheetaljain225/