Date   

get specific records after GetHistoryForKey #fabric-chaincode #chaincode #database #fabric-questions

Nikos Karamolegkos
 

Hello, I use Level DB and I am using GetHistoryForKey to get the history of a key which return some records. Is there an efficient way to parse the returned records in order to find some specific values. For example If CAR3 has a history of color change 10 times can I get somehow in which of these was yellow and red without just traversing the output looking for these two colors?  

Another question, is is bad for the BC logic to have Keys that never updated? I mean that every write to ledger create a new key without updating an existing one.


setEvent is not sending the contect

jay park
 

Hi Team,

I put event in chaincode but it seems the contents is not coming to the client, only event name is coming.
Could you please let me know how to receive the contents that I set in the chaincode?

I set event in chaincode and use 2.4.2.





In client, code is like below and use fabric network 2.2.15.

try {
      listener = async (error, event) => {
        this.logger.debug("registerEvent 2", transaction.getTransactionId());        const trevent = event.getBlockEvent().getTransactionEvents()
        console.log("getTransactionEvents : ",trevent);
        console.log("getContractEvents : ",trevent[0].getContractEvents()[0].payload );
        console.log("getContractEvents : ",trevent[0].getContractEvents()[0].getTransactionEvent());
 
      };  
      const mspId = network.getGateway().getIdentity().mspId;
      const peers = network.getChannel().getEndorsers(mspId);
    await network.addCommitListener(listener, peers, transaction.getTransactionId());





Best,
Jungil



Re: Running test-network on an ARM SBC Chaincode issue

sbhaskar@...
 

Figured the issue - the NetworkMode in the peer config yaml and the docker compose environment variables CORE_VM_ENDPOINT and CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE had to be set with the correct values.


Running test-network on an ARM SBC Chaincode issue

sbhaskar@...
 

Have been able to build the docker images for arm64 (see here - https://www.polarsparc.com/xhtml/Hyperledger-ARM-Build.html) and successfully setup the network (see here https://www.polarsparc.com/xhtml/Hyperledger-ARM-Test.html) ... the problem is the chaincode - was ale to deploy and commit to the peers ... but the chaincode docker container exits ... from the docker logs find the following:

2022/09/21 23:27:08 Error starting asset-transfer-basic chaincode: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org2.example.com on 192.168.1.1:53: no such host"
panic: Error starting asset-transfer-basic chaincode: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org2.example.com on 192.168.1.1:53: no such host"

goroutine 1 [running]:
log.Panicf({0x931e5b?, 0x4000092b80?}, {0x4000577f48?, 0x436058?, 0x80af80?})
    /usr/local/go/src/log/log.go:392 +0x6c
main.main()
    /chaincode/input/src/assetTransfer.go:21 +0xcc

Have tried the 'host.docker.internal' for the CORE_PEER_CHAINCODEADDRESS and nothing seems to help ...

Any ideas or suggestions ??


Re: Where do the Hyperledger Fabric check block header hash duplication? #fabric

David Enyeart
 

Here’s the block hash check:

https://github.com/hyperledger/fabric/blob/main/common/ledger/blkstorage/blockfile_mgr.go#L287

 

 

From: fabric@... <fabric@...> on behalf of SANGWOO PARK <sangwoopark1218@...>
Date: Wednesday, September 21, 2022 at 2:33 AM
To: fabric@... <fabric@...>
Subject: [EXTERNAL] [Hyperledger Fabric] Where do the Hyperledger Fabric check block header hash duplication? #fabric

I was reading the source-code for HLF v2. 2 along with the officical github. But I am still looking for the source-code part that double check the block hash code. Any recommendation will be welcomed! Thank you! _. _,_. _,_ Links: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍

ZjQcmQRYFpfptBannerStart

This Message Is From an Untrusted Sender

You have not previously corresponded with this sender.

ZjQcmQRYFpfptBannerEnd

I was reading the source-code for HLF v2.2 along with the officical github.

But I am still looking for the source-code part that double check the block hash code.

Any recommendation will be welcomed!

Thank you!


Re: Where do the Hyperledger Fabric check block header hash duplication? #fabric

Baohua Yang
 

Hi SANGWOO

Do you mean the peer or orderer to check the header?

On Tue, Sep 20, 2022 at 11:33 PM SANGWOO PARK <sangwoopark1218@...> wrote:
I was reading the source-code for HLF v2.2 along with the officical github.

But I am still looking for the source-code part that double check the block hash code.

Any recommendation will be welcomed!

Thank you!



--
Best wishes!

Baohua Yang


Re: Need help with some of Issues With the Hyperledger fabric

Baohua Yang
 

Hi Danny

You may list the steps to repeat the issue and the related logs, which will be helpful to debug it.

On Tue, Sep 20, 2022 at 9:58 PM danny jollin <danny.jollin1994@...> wrote:


---------- Forwarded message ---------
From: danny jollin <danny.jollin1994@...>
Date: Wed, Sep 21, 2022 at 10:26 AM
Subject: Need help with some of Issues With the Hyperledger fabric
To: <fabric+help@...>


I am using fabric 2 version ,when i list containers the peer containers get exit just seconds after docker run ,when i check the docker logs of peer containers it shows error such as TLS failed and bad certificate 

what should i do to resolve this?please help.

thank you



--
Best wishes!

Baohua Yang


Re: Implementing custom validation GO plugin, does an example exists? #vscc

Yacov
 

The plugin is indeed the interface that you outlined below, with the Validate and Init methods.

However, these plugins are created for each channel and should be independent from each other.

When a plugin instance is created, the plugin factory is called with the method New() which returns an instance of a plugin.

The way to override the regular validation plugin, is to create a plugin factory which returns plugins that you implement.

In the test, we have a custom plugin factory which:
  • Invokes a method that asserts that the correct factory method was invoked
  • Returns the regular builtin plugin (default validation)

The aim of the integration tests is to check that the peer can be correctly configured with a validation plugin.


From: fabric@... <fabric@...> on behalf of rmulken@... <rmulken@...>
Sent: Wednesday, September 21, 2022 5:47 PM
To: fabric@... <fabric@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Implementing custom validation GO plugin, does an example exists? #vscc
 
Hi Yacov, Thanks for your reply. I'm not concerned about the integration test not working, the code looks legit, but does not cover what I'm looking for. The documentation of implementing a validation plugin is describe here: https: //hyperledger-fabric. readthedocs. io/en/release-2. 2/pluggable_endorsement_and_validation. html#validation-plugin-implementation
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
 
ZjQcmQRYFpfptBannerEnd
Hi Yacov,

Thanks for your reply. I'm not concerned about the integration test not working, the code looks legit, but does not cover what I'm looking for.

The documentation of implementing a validation plugin is describe here: https://hyperledger-fabric.readthedocs.io/en/release-2.2/pluggable_endorsement_and_validation.html#validation-plugin-implementation and describes the following plugin interface:

// Plugin validates transactions
type Plugin interface {
    // Validate returns nil if the action at the given position inside the transaction
    // at the given position in the given block is valid, or an error if not.
    Validate(block *common.Block, namespace string, txPosition int, actionPosition int, contextData ...ContextDatum) error

    // Init injects dependencies into the instance of the Plugin
    Init(dependencies ...Dependency) error
}

When I look at the integration tests the reference the following test validation plugin: https://github.com/hyperledger/fabric/blob/2ef46bbc718de220bbd33ee4e1ce65194b963358/integration/pluggable/testdata/plugins/validation/plugin.go but this plugin does not implement this validation interface and nor has it executable instructions. 


package
main
   
  import (
  validation "github.com/hyperledger/fabric/core/handlers/validation/api"
  "github.com/hyperledger/fabric/core/handlers/validation/builtin"
  "github.com/hyperledger/fabric/integration/pluggable"
  )
   
  // go build -buildmode=plugin -o plugin.so
   
  // NewPluginFactory is the function ran by the plugin infrastructure to create a validation plugin factory.
  func NewPluginFactory() validation.PluginFactory {
  pluggable.PublishValidationPluginActivation()
  return &builtin.DefaultValidationFactory{}
  }

So i'm really helped with an actual example of a validation plugin as mentioned in the documentation.

Or is the answer that Hyperledger Fabric does not actively supporting pluggable endorser/validation plugins on a peer?


Re: Implementing custom validation GO plugin, does an example exists? #vscc

rmulken@...
 

Hi Yacov,

Thanks for your reply. I'm not concerned about the integration test not working, the code looks legit, but does not cover what I'm looking for.

The documentation of implementing a validation plugin is describe here: https://hyperledger-fabric.readthedocs.io/en/release-2.2/pluggable_endorsement_and_validation.html#validation-plugin-implementation and describes the following plugin interface:

// Plugin validates transactions
type Plugin interface {
    // Validate returns nil if the action at the given position inside the transaction
    // at the given position in the given block is valid, or an error if not.
    Validate(block *common.Block, namespace string, txPosition int, actionPosition int, contextData ...ContextDatum) error

    // Init injects dependencies into the instance of the Plugin
    Init(dependencies ...Dependency) error
}

When I look at the integration tests the reference the following test validation plugin: https://github.com/hyperledger/fabric/blob/2ef46bbc718de220bbd33ee4e1ce65194b963358/integration/pluggable/testdata/plugins/validation/plugin.go but this plugin does not implement this validation interface and nor has it executable instructions. 


package
main
   
  import (
  validation "github.com/hyperledger/fabric/core/handlers/validation/api"
  "github.com/hyperledger/fabric/core/handlers/validation/builtin"
  "github.com/hyperledger/fabric/integration/pluggable"
  )
   
  // go build -buildmode=plugin -o plugin.so
   
  // NewPluginFactory is the function ran by the plugin infrastructure to create a validation plugin factory.
  func NewPluginFactory() validation.PluginFactory {
  pluggable.PublishValidationPluginActivation()
  return &builtin.DefaultValidationFactory{}
  }

So i'm really helped with an actual example of a validation plugin as mentioned in the documentation.

Or is the answer that Hyperledger Fabric does not actively supporting pluggable endorser/validation plugins on a peer?


Now: Fabric Contributor Meeting - 09/21/2022 #cal-notice

Group Notification <noreply@...>
 

Fabric Contributor Meeting

When:
09/21/2022
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


Where do the Hyperledger Fabric check block header hash duplication? #fabric

SANGWOO PARK
 

I was reading the source-code for HLF v2.2 along with the officical github.

But I am still looking for the source-code part that double check the block hash code.

Any recommendation will be welcomed!

Thank you!


Fabric Contributor Meeting - September 21, 2022

David Enyeart
 

Hyperledger Fabric Contributor Meeting

When: Every 4th Wednesday 9am US Eastern, 13:00 UTC

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

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

 

Agenda for September 21, 2022

 

- Project status update

- Fabric full stack development workshop - https://github.com/hyperledgendary/full-stack-asset-transfer-guide

- Other topics welcome!

 


Now: Private Chaincode Lab - 09/20/2022 #cal-notice

Group Notification <noreply@...>
 

Private Chaincode Lab

When:
09/20/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@...

View Event

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


Storage data in private data collection has a different value #fabric #couchdb

Joao Antunes
 

Hi all,

I've encountered a strange issue and couldn't find any opened issue regarding this.

Currently using JAVA to develop the chaincde

 

I'm using private data collections to store data. The stored data is something like:

{"item":"itemName", "quantity", 1.0}

The quantity is a BigDecimal.

 

From what I can check, when we store the data above, the hash that is generated by fabric has the ".0" value in it.

The problem comes when I try to get the data from private data collection. It returns with no ".0" value.

Then when I'm validating the value with its hash, I get a mismatch.

 

Shouldn't the value be stored as it is sent to couchdb?


Re: Update PeerOrg Admin Certificate #kubernetes #fabric-ca-client #hyperledger-fabric #policies

hiteshdutt05@...
 

I have resolved this issue after making an update to writer, and changing the sub_policy to "Admins" instead of writers

after making above change, i was able to make certificate update.

once the admin certificates were updated, I made the change again to make sub_policy to "Writers"

Not sure if this is the right way, but I am unblocked for now.


Re: Remove channel from the network

Nikos Karamolegkos
 

The purpose of removing the channel is that is not anymore useful for the BC network. The peers and the orderers are joined to another channel so how can I remove them from the useless channel? Is it enough for the peers to use peer unjoin? Is there something similar for the orderer nodes?


Re: Remove channel from the network

Baohua Yang
 

What's the original purpose of removing a channel?

If just to prevent using it, you can remove/disable the peers/orderers.

On Mon, Sep 19, 2022 at 1:49 AM Nikos Karamolegkos <nkaram@...> wrote:
Any proposals for that? What is the flow (steps) I should follow for "removing" a channel? Is it enough just to unjoin the peers and orderers nodes?



--
Best wishes!

Baohua Yang


Re: Fabric Version Upgrade

David Enyeart
 

See the upgrade guide here - https://hyperledger-fabric.readthedocs.io/en/latest/upgrade.html

 

IBM provides an official support offering but you would need to deploy Fabric using the IBM Kubernetes operator - https://www.ibm.com/cloud/blockchain-platform/hyperledger-fabric-support.

 

 

From: fabric@... <fabric@...> on behalf of Nawaf A. Alabra <alabranawaf@...>
Date: Monday, September 19, 2022 at 8:56 AM
To: fabric@... <fabric@...>
Subject: [EXTERNAL] [Hyperledger Fabric] Fabric Version Upgrade

Hello Hyperledger community, I have a hyperledger fabric infrastructure that runs on version: 1. 3. 0 Now the system is a bit unstable and I want to upgrade the version to the latest fabric version, the problem there is no proper documentation

ZjQcmQRYFpfptBannerStart

This Message Is From an Untrusted Sender

You have not previously corresponded with this sender.

ZjQcmQRYFpfptBannerEnd

Hello Hyperledger community,

 

I have a hyperledger fabric infrastructure that runs on version: 1.3.0

 

Now the system is a bit unstable and I want to upgrade the version to the latest fabric version, the problem there is no proper documentation or a formal guide for upgradation process plus what if we face issues in the process is there official support channel for higher resolution?

 

 

Thanks,


Re: TLS Renewal of certificate

David Enyeart
 

If the certificate is already expired, Fabric CA server will return this error.

An option was added in Fabric CA v1.5.1 to allow for re-enroll of an expired cert.

See the details in the v1.5.1 release notes - https://github.com/hyperledger/fabric-ca/releases/tag/v1.5.1.

 

 

From: fabric@... <fabric@...> on behalf of Nawaf A. Alabra <alabranawaf@...>
Date: Monday, September 19, 2022 at 8:56 AM
To: fabric@... <fabric@...>
Subject: [EXTERNAL] [Hyperledger Fabric] TLS Renewal of certificate

Hello Hyperledger community, I renewed the TLS certificate a year ago with the use of "fabric-ca-client re enroll" command and it was successfully renewed with no issues. Now after a year I tried again to renew the certificate via

ZjQcmQRYFpfptBannerStart

This Message Is From an Untrusted Sender

You have not previously corresponded with this sender.

ZjQcmQRYFpfptBannerEnd

Hello Hyperledger community,

 

I renewed the TLS certificate a year ago with the use of "fabric-ca-client re enroll" command and it was successfully renewed with no issues.

 

Now after a year I tried again to renew the certificate via the same command but I am not able to renew the certificate this time. 

 

I am receiving the below error in console:

 

"certificate has expired or is not yet valid"

Hyperledger fabric version: 1.3.0

Error Screenshot: https://prnt.sc/c6wQX6m1iNbN

 

 


Fabric Version Upgrade

Nawaf A. Alabra <alabranawaf@...>
 

Hello Hyperledger community,

I have a hyperledger fabric infrastructure that runs on version: 1.3.0

Now the system is a bit unstable and I want to upgrade the version to the latest fabric version, the problem there is no proper documentation or a formal guide for upgradation process plus what if we face issues in the process is there official support channel for higher resolution?


Thanks,

121 - 140 of 11527