Date   

Re: install chaincode using API

Nikos Karamolegkos
 

Thus, I have to build functions which will call the peer lifecycle chaincode commands? For example using bash?

On 10/1/21 22:31, Marcos Sarres wrote:

In my case, we had to create our own API for installing, instantiating and upgrading chaincodes and HLF clients.

 

Regards,

 

Marcos Sarres | CEO | +55 61 98116 7866

 

 

De: fabric@... <fabric@...> Em nome de Nikos Karamolegkos
Enviada em: quinta-feira, 30 de setembro de 2021 10:16
Para: fabric <fabric@...>
Assunto: [Hyperledger Fabric] install chaincode using API

 

Hello, as I have seen I can install a smart contract to a peer by running to peer:

peer lifecycle chaincode install ...

In case I want to install or update a chaincode using a Web UI can I do that by using the API?

Thank you,

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Re: Retrieve transaction details

famar
 

Thank you for your reply.
I'm trying to set the composite key.
I know that i can retrieve the ID of the user who is launching the transaction in this way : 

String userId = ctx.getClientIdentity().getID();

Now I need to create a composite key to make a search with this ID and the plate number. The GetHistoryForKey() accept a String so i tried this way:

String[] keyAttribute = {userId,plateId};
String compositeKey = ctx.getStub().createCompositeKey("user-plate",keyAttribute).toString();
QueryResultsIterator<KeyModification> queryResult = ctx.getStub().getHistoryForKey(compositeKey);

but this way I'm not able to retrieve any transaction.

If I use only the plateId in the getHistoryForKey() it works fine so the problem is in the creation of the composite key.
Could you tell me what I'm doing wrong?
Thanks


Il giorno gio 30 set 2021 alle ore 15:05 David Enyeart <enyeart@...> ha scritto:

You can use chaincode API GetHistoryForKey() to retrieve all historical transactions associated with a key. Therefore if you make your key the number plate, or number plate and user id concatenated as a composite key, you can retrieve what you need.

If you need more advanced queries, then the recommendation is to use the block events to build out your own fit-for-purpose data store that can be queried, as seen in this sample: https://github.com/hyperledger/fabric-samples/tree/main/off_chain_data


Dave Enyeart

"famar" ---09/30/2021 06:12:31 AM---Hello everyone, I'm trying to develop chaincode in java.

From: "famar" <fabrizio.marangio@...>
To: fabric@...
Date: 09/30/2021 06:12 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Retrieve transaction details
Sent by: fabric@...





Hello everyone, I'm trying to develop chaincode in java. I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the ID it refers to. For example, let's say we have a generic car asset ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hello everyone,
I'm trying to develop chaincode in java.

I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the ID it refers to.
For example, let's say we have a generic car asset with the number plate as a parameter.
I would like to be able to search for all the transactions made by a user, filtering them by that number plate, and then retrieve the timestamp of the last one made.
Can anyone help me with this?

Thank you.






Re: Check out my co-authored new book on Fabric V2 published by O'Reilly

blind.line
 

Thanks for sharing. I love learning from books

James

On Oct 3, 2021, at 12:03, Mark Anthony Morris <mark.morris@...> wrote:


Hello All, I recommend this new O’Reilly book, I co-authored. It is available at Amazon, O’Reilly, and others. 

It will help your learning and development:

Hands-On Smart Contract Development with Hyperledger Fabric V2: Building Enterprise Blockchain Applications

Amazon:
Learn more: https://www.amazon.com/dp/1492086126/ref=cm_sw_em_r_mt_dp_8QP2R4WFE6NS505Y0CMJ

Google Books:

<PastedGraphic-1.png>

Sincerely,
Mark Anthony Morris


Check out my co-authored new book on Fabric V2 published by O'Reilly

Mark Anthony Morris <mark.morris@...>
 

Hello All, I recommend this new O’Reilly book, I co-authored. It is available at Amazon, O’Reilly, and others. 

It will help your learning and development:

Hands-On Smart Contract Development with Hyperledger Fabric V2: Building Enterprise Blockchain Applications

Amazon:
Learn more: https://www.amazon.com/dp/1492086126/ref=cm_sw_em_r_mt_dp_8QP2R4WFE6NS505Y0CMJ

Google Books:


Sincerely,
Mark Anthony Morris


Re: 回复: [Hyperledger Fabric] How to modify the behaviour of fabric peer #fabric-peer

BigBang019
 

I'm sorry I posted a stupid question:

I did use javascript sdk to submit transaction, and I've found what I need in module fabric-network, where the logic of clients' receiving endorsement from peers and send to orderer is coded in fabric-network/lib/transaction.js: function submit().


回复: [Hyperledger Fabric] How to modify the behaviour of fabric peer #fabric-peer

david liu <david-khala@...>
 

I believe there is no need to intercept by WireShark if you are using any sdk to receive the proposal response. So I guess you are using command lien with binary, is it?

 

Best Regards,

David Liu

 

发件人: fabric@... <fabric@...> 代表 BigBang019
发送时间: 2021101 20:11
收件人: fabric@...
主题: Re: [Hyperledger Fabric] How to modify the behaviour of fabric peer #fabric-peer

 

Hi, thanks for your reply.

I want to monitor when clients receive endorsement from endorser. However, this is a client side issue, and I can only come up with the idea using wireshark to capture network packages and analyze them.

Is there any better way to achieve this?


Re: Private data dissemination for new peers from the same org after joining an existing channel in HLF 2.x #fabric-peer

Yacov
 

It will pull the private data from peers in the collection eventually, it takes time.
 

----- Original message -----
From: jefferson.rs@...
Sent by: fabric@...
To: fabric@...
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] Private data dissemination for new peers from the same org after joining an existing channel in HLF 2.x #fabric-peer
Date: Fri, Oct 1, 2021 10:22 PM
 
Hi everyone. I'm doing some testing over the use of private data and I've got into a doubt which should be the default behaviour in HLF 2.x. Assuming a network with 2 orgs (orgA and orgB) and each org have one peer (peer1.orgA and peer1.orgB): ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi everyone.
 
I'm doing some testing over the use of private data and I've got into a doubt which should be the default behaviour in HLF 2.x.
 
Assuming a network with 2 orgs (orgA and orgB) and each org have one peer (peer1.orgA and peer1.orgB): there's a chaincode installed in the channel with explicit private collection defined where each org have it's own private collection (collectionOrgA and collectionOrgB) with the following configurations: 
  memberOnlyRead: true, 
  memberOnlyWrite: false, 
  requiredPeerCount: 0,
  maxPeerCount: 3
 
I've executed one TX that runs a PutPrivateData to collectionOrgA and another TX to collectionOrgB. So the private data were stored successfully.
 
Later on I up a new peer to orgA (peer2.orgA) and I've executed the join operation for this peer to this channel. After the join, I've noticed that this node didn't received any private data back just the hashes.
 
So I've got these doubts: 
1) Is this the expected behaviour in HLF 2.x? 
2) Would it be possible for a new peer that joins the channel to get this private data that belongs to his own org (in this case orgA)? If so, which would be the setup to enable this?
 
Thanks in advance,
Jeff.
 



Re: install chaincode using API

Marcos Sarres
 

In my case, we had to create our own API for installing, instantiating and upgrading chaincodes and HLF clients.

 

Regards,

 

Marcos Sarres | CEO | +55 61 98116 7866

 

 

De: fabric@... <fabric@...> Em nome de Nikos Karamolegkos
Enviada em: quinta-feira, 30 de setembro de 2021 10:16
Para: fabric <fabric@...>
Assunto: [Hyperledger Fabric] install chaincode using API

 

Hello, as I have seen I can install a smart contract to a peer by running to peer:

peer lifecycle chaincode install ...

In case I want to install or update a chaincode using a Web UI can I do that by using the API?

Thank you,

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Private data dissemination for new peers from the same org after joining an existing channel in HLF 2.x #fabric-peer

jefferson.rs@...
 

Hi everyone.
 
I'm doing some testing over the use of private data and I've got into a doubt which should be the default behaviour in HLF 2.x.
 
Assuming a network with 2 orgs (orgA and orgB) and each org have one peer (peer1.orgA and peer1.orgB): there's a chaincode installed in the channel with explicit private collection defined where each org have it's own private collection (collectionOrgA and collectionOrgB) with the following configurations: 
  memberOnlyRead: true, 
  memberOnlyWrite: false, 
  requiredPeerCount: 0,
  maxPeerCount: 3
 
I've executed one TX that runs a PutPrivateData to collectionOrgA and another TX to collectionOrgB. So the private data were stored successfully.
 
Later on I up a new peer to orgA (peer2.orgA) and I've executed the join operation for this peer to this channel. After the join, I've noticed that this node didn't received any private data back just the hashes.
 
So I've got these doubts: 
1) Is this the expected behaviour in HLF 2.x? 
2) Would it be possible for a new peer that joins the channel to get this private data that belongs to his own org (in this case orgA)? If so, which would be the setup to enable this?
 
Thanks in advance,
Jeff.


Re: Retrieve transaction details

Marcos Sarres
 

Hello Fabrizio,

 

Although you are a java developer, there is an open-source repository in GoLang that maybe could help you.

 

It provides a chaincode with create, update, read, delete, search and history transactions, already with a rest server integrated for HL Fabric 1.4 and 2.2.

 

You could find more info here:

 

https://goledger-cc-tools.readthedocs.io/en/latest/

 

regards,

 

Marcos Sarres | CEO | +55 61 98116 7866

 

 

De: fabric@... <fabric@...> Em nome de famar
Enviada em: quinta-feira, 30 de setembro de 2021 07:12
Para: fabric@...
Assunto: [Hyperledger Fabric] Retrieve transaction details

 

Hello everyone,
I'm trying to develop chaincode in java.

I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the ID it refers to.
For example, let's say we have a generic car asset with the number plate as a parameter.
I would like to be able to search for all the transactions made by a user, filtering them by that number plate, and then retrieve the timestamp of the last one made.
Can anyone help me with this?

Thank you.


install chaincode using API

Nikos Karamolegkos
 

Hello, as I have seen I can install a smart contract to a peer by running to peer:

peer lifecycle chaincode install ...

In case I want to install or update a chaincode using a Web UI can I do that by using the API?

Thank you,

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Re: Retrieve transaction details

David Enyeart
 

You can use chaincode API GetHistoryForKey() to retrieve all historical transactions associated with a key. Therefore if you make your key the number plate, or number plate and user id concatenated as a composite key, you can retrieve what you need.

If you need more advanced queries, then the recommendation is to use the block events to build out your own fit-for-purpose data store that can be queried, as seen in this sample: https://github.com/hyperledger/fabric-samples/tree/main/off_chain_data


Dave Enyeart

"famar" ---09/30/2021 06:12:31 AM---Hello everyone, I'm trying to develop chaincode in java.

From: "famar" <fabrizio.marangio@...>
To: fabric@...
Date: 09/30/2021 06:12 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Retrieve transaction details
Sent by: fabric@...





Hello everyone, I'm trying to develop chaincode in java. I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the ID it refers to. For example, let's say we have a generic car asset ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hello everyone,
I'm trying to develop chaincode in java.

I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the ID it refers to.
For example, let's say we have a generic car asset with the number plate as a parameter.
I would like to be able to search for all the transactions made by a user, filtering them by that number plate, and then retrieve the timestamp of the last one made.
Can anyone help me with this?

Thank you.






Re: Hyperledger fabric peer high memory usage #fabric

David Enyeart
 

400MB is fairly typical after peer has completed processing a load.

Does the peer continue to grow unbounded beyond 400MB? That would indeed be concerning but I have not seen that in the past.


Dave Enyeart


neeroz.kumar29---09/29/2021 12:19:41 AM---Hi, I am running a fabric network of 3 peers, 2 orderers and 2 external chaincodes on K8s cluster. E

From: neeroz.kumar29@...
To: fabric@...
Date: 09/29/2021 12:19 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Hyperledger fabric peer high memory usage #fabric
Sent by: fabric@...





Hi, I am running a fabric network of 3 peers, 2 orderers and 2 external chaincodes on K8s cluster. Everything's running fine and smooth as expected. I have been monitoring the memory usage of the fabric peers which keeps growing and doesn't ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi,

I am running a fabric network of 3 peers, 2 orderers and 2 external chaincodes on K8s cluster. Everything's running fine and smooth as expected. I have been monitoring the memory usage of the fabric peers which keeps growing and doesn't comes down despite no transactions being executed.
As and when I am invoking 100-200 transactions there seems to be no unusual spike in the memory usage of peers, or marginal increase which is expected.

I stopped executing transactions altogether and just kept monitoring the resource usage, and since the last two days the
memory usage has increase to ~400MiB which is too high considering no transactions have been executed in the past 2 days. Please have a look at the screenshot from Grafana of the memory usage.

Even though the peers use gossip protocol to communicate about the new blocks, and other stuffs, the high memory usage is kind of unexplainable. I have checked that the
/var/hyperledger/production directory has been mapped to a persistent storage.

This issue happens only after few days after the network has been deployed, as this is the second time I have re-deployed the whole fabric network.

Any suggestions on what could have one wrong, or is there some configuration which I am missing? Or what's the appropriate memory that should be allocated to the peers for running in production?






Re: Minimal Implementation

J K
 

On Sunday, 19 September, 2021, 05:27:12 pm IST, Nicholas Leonardi via lists.hyperledger.org <nlzanutim=yahoo.com@...> wrote:


Em domingo, 19 de setembro de 2021 01:33:02 BRT, mhdalkhaldibc@... <mhdalkhaldibc@...> escreveu:


I'm trying to trim down fabric. My use case is simple, basic token transfer with utxos, so I want to simplify and remove features and components I'm not using. I will most likely have one org, one ca, and no special endorsement policies.
Could you please help me find some relevant resources to look at?

Thanks


Retrieve transaction details

famar
 

Hello everyone,
I'm trying to develop chaincode in java.

I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the ID it refers to.
For example, let's say we have a generic car asset with the number plate as a parameter.
I would like to be able to search for all the transactions made by a user, filtering them by that number plate, and then retrieve the timestamp of the last one made.
Can anyone help me with this?

Thank you.


Re: HA on Kubernetes

Yacov
 

The important thing to remember is to never ever give the same certificate (TLS or enrollment certificate) to two or more peers or orderers.
 
Or in other words, Fabric only needs redundancy of nodes and manages HA on its own.
 
It should also be noted that the common model adopted in the web world where you have the container orchestration platform spin up new nodes upon demand, does not apply to Fabric, not even to peers, as it takes a fresh peer a long time to replicate the blocks, and while bootstrapping it from a snapshot is probably something you can script, it's better to plan ahead.
 

----- Original message -----
From: tom@...
Sent by: fabric@...
To: <nrostkowski@...>, <fabric@...>
Cc:
Subject: [EXTERNAL] Re: [Hyperledger Fabric] HA on Kubernetes
Date: Thu, Sep 30, 2021 1:37 AM
 
Hi, I am new to this group so I am very interested in responses from those with more experience than I have. That said, I have created a K8s based Hyperledger Fabric network with three orderers and three peers on a Google Cloud K8s platform. ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd

Hi,

I am new to this group so I am very interested in responses from those with more experience than I have.

That said, I have created a K8s based Hyperledger Fabric network with three orderers and three peers on a Google Cloud K8s platform. I watched the logs as I killed the lead orderer and continued to submit transactions. The two remaining peers recognized that the lead orderer was missing, re-established themselves, and continued processing the incoming transactions. At the same time, the K8s control plane re-created the missing orderer and once started, the other two orderers recognized it and again re-established themselves as a set of three orderers.

The entire process took less than 10 minutes. No transactions were lost.

Of course, this was a simple test, but I found it interesting to see how the orderers adapted to the changing environment and was very satisfied that the network remained stable throughout.

Tom Lamm

 

From: fabric@... <fabric@...> On Behalf Of nrostkowski@...
Sent: Wednesday, September 29, 2021 6:37 AM
To: fabric@...
Subject: [Hyperledger Fabric] HA on Kubernetes

 

Hi, 

what's the proper way to achieve High Availability of Hyperledger Fabric on Kubernetes?

 

Can we just scale up existing orderers and peers Deployments or do we need to add new Deployments and each Deployment must have only one replica?

 

Norbert Rostkowski

 

 



Re: HA on Kubernetes

Tom Lamm
 

Hi,

I am new to this group so I am very interested in responses from those with more experience than I have.

That said, I have created a K8s based Hyperledger Fabric network with three orderers and three peers on a Google Cloud K8s platform. I watched the logs as I killed the lead orderer and continued to submit transactions. The two remaining peers recognized that the lead orderer was missing, re-established themselves, and continued processing the incoming transactions. At the same time, the K8s control plane re-created the missing orderer and once started, the other two orderers recognized it and again re-established themselves as a set of three orderers.

The entire process took less than 10 minutes. No transactions were lost.

Of course, this was a simple test, but I found it interesting to see how the orderers adapted to the changing environment and was very satisfied that the network remained stable throughout.

Tom Lamm

 

From: fabric@... <fabric@...> On Behalf Of nrostkowski@...
Sent: Wednesday, September 29, 2021 6:37 AM
To: fabric@...
Subject: [Hyperledger Fabric] HA on Kubernetes

 

Hi, 

what's the proper way to achieve High Availability of Hyperledger Fabric on Kubernetes?

 

Can we just scale up existing orderers and peers Deployments or do we need to add new Deployments and each Deployment must have only one replica?

 

Norbert Rostkowski


Now: Fabric Contributor Meeting - 09/29/2021 #cal-notice

fabric@lists.hyperledger.org Calendar <noreply@...>
 

Fabric Contributor Meeting

When:
09/29/2021
9:00am to 10:00am
(UTC-04:00) America/New York

Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09

Organizer: Dave Enyeart enyeart@...

View Event

Description:
For meeting agendas, recordings, and more details, see https://wiki.hyperledger.org/display/fabric/Contributor+Meetings

Join Zoom Meeting
https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09
 
Meeting ID: 518 494 7650
Passcode: 475869


HA on Kubernetes

nrostkowski@wp.pl
 

Hi, 
what's the proper way to achieve High Availability of Hyperledger Fabric on Kubernetes?

Can we just scale up existing orderers and peers Deployments or do we need to add new Deployments and each Deployment must have only one replica?

Norbert Rostkowski


Fabric Contributor Meeting - September 29, 2021

David Enyeart
 

Hyperledger Fabric Contributor Meeting

Where: https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09

Agendas and Recordings: https://wiki.hyperledger.org/display/fabric/Contributor+Meetings

----------------------------------------------------------------------------------------------------

Agenda for September 29, 2021


- Fabric Strategic Priorities discussion and survey preparation - Dave Enyeart