Date   

How Fabric is being used in the blockchain carbon accounting lab and how to help out

David Boswell <dboswell@...>
 

The Climate Action and Accounting SIG has an active blockchain carbon accounting lab that is using Hyperledger Fabric to record emissions data, using energy data from utility bills and audited emissions factors from the EPA and EEA.  The code from the lab was recently used for a production system to track and offset emissions.

The group wrote a blog post that goes into more details about the project and shows screenshots and a video of the production system at:


The group is also looking for contributors and they've documented several good first issues that people can help with.  If you're interested in using Fabric for a climate change related use case, please consider helping out.  If you know of anyone who would be interested, please share the link above to the blog post or this link to the project's wiki:


Thanks,
David


Re: Hyperledger fabric in IoT application

Chris Gabriel
 

Hi Nikos,

In general, each party involved in any transaction should be in its own org. With that in mind, it is not a good idea to have only one org as this creates multiple problems (single point of failure, endorsement, trust, and defeats the business purpose of having a blockchain). When I think about Fabric network structure I always begin with the use case. Fabric networks are best implemented in B2B scenarios but you can also implement them in B2C or C2C (as of now, my view is that B2B scenarios is where Fabric really shines).

Implement Fabric networks where:
B2B transactions are occurring between two or more parties.
There is a need for a transparent auditable view of what happened when transactions are executed.
There is a contractual relationship between parties where the terms of the paper contract between them cam be executed in smart contracts.
Each party on the network has its own peer(s), Certificate Authority or other means of managing identities.

Note that these are suggestions for a starting point as there are many ways to think about this.

Example:
Company A (org1) and Company B (org2) need to transact with each other and you want to implement a Fabric network.
Both companies have their own peer nodes and certificate authorities (just like the test-network).
The orderer can be implemented by any of; a trusted third party, Company A, Company B, or each can have their own orderer.

I hope this helps.
Chris

On Apr 19, 2021, at 5:26 AM, Nikos Karamolegkos <nkaram@ics.forth.gr> wrote:

Hello, thank you for your help. My problem is that I can not decide how to set my organizations. Is it good to have a single organization with multiple GWs as clients application to update the data on the ledger?

Thank you very much,

On 15/4/21 3:52 μ.μ., Gmail wrote:
In short, a good place to start in a dev environment is to have one peer and one certificate authority per organization. Very similar to the Fabric Test Network. On that same YouTube channel I have a tutorial on how to deploy fabric certificate authorities on Kubernetes that contains a public GitHub repo that you can clone and practice with. Hope this helps,
Chris

Sent from my iPhone

On Apr 15, 2021, at 7:45 AM, Nikos Karamolegkos <nkaram@ics.forth.gr> wrote:

Hello, thank you for the fast response. Is the code or any paper available? Can you describe the BC architecture (number of orgs, peers, apps,users). I don't know how to decide how many peers to use. I am trying to build a use case.

On 15/4/21 3:17 μ.μ., Chris Gabriel wrote:
Hi Nikos,
It really depends upon the use case. In mine, I use a raspberry pi as a server of IoT sensor data that gets polled for its data by an IoT gateway in Node Red, but the peers are running in the cloud in Kubernetes. I use the Fabric CA to issue identities for each org in the network and also assign each IoT device an identity from the CA as a security practice. Demo here:
https://youtu.be/rGHI8-tpzX0
On Apr 15, 2021, at 6:53 AM, Nikos Karamolegkos <nkaram@ics.forth.gr> wrote:
Hello everyone, I am new to BC and hyperledger. I would like to deploy a BC to an existing IoT network. I have not decide yet the architecture of the BC network (peer, orgs, etc) but I am thinking to deploy some peers in a raspberries which already act as IoT gateways (GWs) and receive sensor data. Also, in GW I would install the fabric client application to update the ledger (with the IoT data). The idea is the data to be distributed in all GWs acting as peers. Is this a good approach for start or should I have the BC network in the backbone?
--
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)
--
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


elmira
 

Hi,

 What kind of external services are we allowed to use in fabric? Can we use any APIs? Or we must just use fabric SDK.

 For example, an external service is a bank ATM API, and our transaction is calling the ATM withdrawal operation.

 We have defined in our policies that four endorsers must approve it. When the endorser nodes call that external service, are the withdrawal operations performed four times separately; and change the bank account's balance outside the blockchain each time? (so we have trouble in the commitment phase) How can we handle external calls?

I appreciate any help you can provide.


Re: Use certificates from a non-Fabric CA with your Fabric network #signcerts #interoperability #fabric-ca #x509

tilakvardhan@...
 

Stephano, you can give EJBCA a try. That can be your authoritatively CA you’re looking for. It is open source and you can easily issue set of certificates (root/intermedite/end ca + user certs) directly from the admin UI page and use it to bootstrap your fabric network.


Re: Working example of a Java SDK Code for Fabric Commercial Paper example

Chris Gabriel
 

Hi Rajeev,
In the test-network directory, try running

 ./network.sh down 

Then retry the Java sample.  Hope this helps,
Chris


On Apr 18, 2021, at 1:12 PM, Rajeev Kuppadakath <kuppadakath@...> wrote:


Hi,
I am new to this so sorry to ask this basic question. I am going through the examples provided in the fabric-samples package. The network is up and running and also I can run the JavaScript version of the code to 'issue' an asset which is kept ../application/issue.js - which is working fine
However trying to do the same in the application-java/src../../Issue.java, but getting exception like below
Do you have a working Java SDK version of this code somewhere where I can look into? The Java sdk version comes along with this example uses 2.1.0 , is that the latest or do I need to get a new one?

thanks for your help 

regards
Rajeev

Use network channel: mychannel.
Use org.papernet.commercialpaper smart contract.
Submit commercial paper issue transaction.
Exception in thread "main" org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org2.example.com.  Status FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: e2fd766ac0c8ef3f0601bdd67570aa808d3f43709ee509ea2235ec87a6d8cbad to Peer{ id: 2, name: peer0.org2.example.com, channelName: mychannel, url: grpcs://localhost:9051, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=error validating proposal: access denied: channel [mychannel] creator org [Org2MSP], cause=null}
        at


Working example of a Java SDK Code for Fabric Commercial Paper example

Rajeev Kuppadakath
 

Hi,
I am new to this so sorry to ask this basic question. I am going through the examples provided in the fabric-samples package. The network is up and running and also I can run the JavaScript version of the code to 'issue' an asset which is kept ../application/issue.js - which is working fine
However trying to do the same in the application-java/src../../Issue.java, but getting exception like below
Do you have a working Java SDK version of this code somewhere where I can look into? The Java sdk version comes along with this example uses 2.1.0 , is that the latest or do I need to get a new one?

thanks for your help 

regards
Rajeev

Use network channel: mychannel.
Use org.papernet.commercialpaper smart contract.
Submit commercial paper issue transaction.
Exception in thread "main" org.hyperledger.fabric.gateway.GatewayRuntimeException: org.hyperledger.fabric.sdk.exception.ProposalException: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer0.org2.example.com.  Status FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: e2fd766ac0c8ef3f0601bdd67570aa808d3f43709ee509ea2235ec87a6d8cbad to Peer{ id: 2, name: peer0.org2.example.com, channelName: mychannel, url: grpcs://localhost:9051, mspid: Org2MSP} failed because of: gRPC failure=Status{code=UNKNOWN, description=error validating proposal: access denied: channel [mychannel] creator org [Org2MSP], cause=null}
        at


Re: Use certificates from a non-Fabric CA with your Fabric network #signcerts #interoperability #fabric-ca #x509

Gari Singh
 

People have used directly used certificates that were not issued by a Fabric CA as credentials within a Fabric network.

Luckily, there's really no magic here.  You will need to set up the membership service provider (MSP) for your organization using the crypto material from the 3rd party CA.
The structure of an MSP is described here:  https://hyperledger-fabric.readthedocs.io/en/release-2.2/msp.html

At a high level, you just need to populate the MSP structure with artifacts from/generated by the 3rd party CA.  You'll minimally need the root/intermediate chain from the authoritative CA and you'll likely at least one issued certificate to populate admins.

Do be aware that if you use one of the public CAs (like the ones trusted by browsers), this can be problematic as MSPs are differentiated by their root/intermediate chain and therefore anyone with a cert issued by one of the public CAs will match an organization with a MSP containing one of the public CAs.
  


Re: Kubernetes proposes Hyperledger Fabric

Gari Singh
 

Thanks for sharing this, Hakan.  Will try to have a look soon and provide comments/suggestions.


Re: How Check Names of Installed Smart Contracts

Chris Gabriel
 

Hi Brian,
From within the peer container, run:
peer chaincode list —installed -C <channel name>




On Apr 17, 2021, at 4:33 PM, Brian Carpenter <bmc121177@...> wrote:



Is there a terminal command I can run that will list the smart contracts installed on a peer?


Or some other way to get this information?  Need it to debug some issues I'm having.

  

Tks.



How Check Names of Installed Smart Contracts

Brian Carpenter
 

Is there a terminal command I can run that will list the smart contracts installed on a peer?


Or some other way to get this information?  Need it to debug some issues I'm having.

  

Tks.



Membership

Peter Kolodziejski
 

I confirm my email address and want to activate my membership.


ANNOUNCEMENT: Fabric Gateway technology preview in Hyperledger Fabric v2.4.0-alpha is now available!

David Enyeart
 

The Hyperledger Fabric maintainers are pleased to announce the availability of Fabric v2.4.0-alpha!

Hyperledger Fabric v2.4.0-alpha introduces the new Fabric Gateway feature as a technology preview.

The Fabric Gateway is a new feature in the peer that implements much of the high-level 'gateway' programming model that has been found in the recent Fabric SDKs. Much of the transaction submission and query logic can therefore be removed from client applications and delegated to the peer. For example your client application only needs to communicate with your organization's peer(s), and the gateway running in the peer will handle the collection of transaction endorsements required from other organization's peers.

The Fabric Gateway will also simplify the administrative overhead of running a Fabric network because client applications will be able to connect and submit transactions via a single network port rather than requiring ports to be opened from a client application to multiple peers across potentially multiple organizations.

New slim SDKs are delivered in the https://github.com/hyperledger/fabric-gateway repository, along with client application samples and a sample network. Try it out by cloning the fabric-gateway repository and following the instructions at https://github.com/hyperledger/fabric-gateway/tree/main/samples.

You can also see the feature as presented in the last contributor meeting playback:
https://wiki.hyperledger.org/download/attachments/41590443/20210331_contributors_meeting.mp4?api=v2

Let us know your thoughts as we continue to work on the gateway feature for an eventual v2.4 release.

Other details of the v2.4.0-alpha release can be found in the release notes:
https://github.com/hyperledger/fabric/releases/tag/v2.4.0-alpha



Re: using go routine in the chaincode #fabric-chaincode #fabric-questions

Matthew Sykes
 

It's less about a race and more about consistency. (A race can cause an inconsistency.) Imagine that when you run the contract on peer one, the sequence observed by the ledger is ["data1", "data2"]; on peer two the sequence can be ["data2", "data1"] because there's nothing that ensures one write occurs before another.


On Fri, Apr 16, 2021 at 1:56 PM elmira <elmira.ebrahimi@...> wrote:
 Hi,
Concurrency (using goroutine and go channel) can cause non-deterministic behavior in fabric.

I have not found any source or example on the use of Goroutines and go channels in fabric contracts; I need an example; Are there any links that I can read about it?.

I know that it is better not to use the following code, but I want to know how the race condition that is in the code causes inconsistency among peers.
I appritiate any help.

package main import (

"fmt"

"github.com/hyperledger/fabric/core/chaincode/shim"

"github.com/hyperledger/fabric/protos/peer"

)

type BadChainCode struct{

}

func (t *BadChainCode) Invoke(stub shim.ChaincodeStubInterface){


go writeToLedger(stub, “data1”)

go writeToLedger(stub, “data2”)

 

}
func writeToLedger(stub shim.ChaincodeStubInterface, data string){

stub.PutState(“key”,[]byte(data))

}



--
Matthew Sykes
matthew.sykes@...


using go routine in the chaincode #fabric-chaincode #fabric-questions

elmira
 

 Hi,
Concurrency (using goroutine and go channel) can cause non-deterministic behavior in fabric.

I have not found any source or example on the use of Goroutines and go channels in fabric contracts; I need an example; Are there any links that I can read about it?.

I know that it is better not to use the following code, but I want to know how the race condition that is in the code causes inconsistency among peers.
I appritiate any help.

package main import (

"fmt"

"github.com/hyperledger/fabric/core/chaincode/shim"

"github.com/hyperledger/fabric/protos/peer"

)

type BadChainCode struct{

}

func (t *BadChainCode) Invoke(stub shim.ChaincodeStubInterface){


go writeToLedger(stub, “data1”)

go writeToLedger(stub, “data2”)

 

}
func writeToLedger(stub shim.ChaincodeStubInterface, data string){

stub.PutState(“key”,[]byte(data))

}


Kubernetes proposes Hyperledger Fabric

Hakan Eryargi
 

Dear Hyperledger Fabric Community,

I'd like to introduce Hyperledger Fabric Operator for Kubernetes:
https://github.com/raftAtGit/hl-fabric-operator

It's a wrapper around our previous work PIVT Helm charts and makes running and operating Hyperledger Fabric in Kubernetes even more easier.

It allows managing the whole HL Fabric network or part of it declaratively through the FabricNetwork CRD (Custom Resource Definition).

In particular it allows to:
  • Configure and launch the whole HL Fabric network or part of it, either:
    • A simple one, one peer per organization and Solo orderer
    • Or scaled up one, multiple peers per organization and Kafka or Raft orderer
  • Populate the network declaratively:
    • Create the channels, join peers to channels, update channels for Anchor peers
    • Install/Instantiate all chaincodes, or some of them, or upgrade them to newer version
  • Add new peer organizations to an already running network declaratively
This work started as an experimental/PoC hobby project of myself, but turned out to be quite complete and functional.

Apologies for the title. As we called the previous work as "Hyperledger Fabric meets Kubernetes", which I truly believe deserves its name, this one felt like a proper continuation :)

Any feedback is more than welcome!

Cheers,
Hakan


Hyperledger Project Quarterly Update Due #tsc-project-update - Thu, 04/15/2021 #tsc-project-update #cal-notice

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

Hyperledger Project Quarterly Update Due #tsc-project-update

When:
Thursday, 15 April 2021

Organizer:
community-architects@...

Description:
Please file a project status report for the TSC here:

https://wiki.hyperledger.org/display/TSC/2021+Project+Updates

https://wiki.hyperledger.org/display/TSC/2021+TSC+Project+Update+Calendar


Re: Hyperledger fabric in IoT application

Chris Gabriel
 

Hi Nikos,
It really depends upon the use case. In mine, I use a raspberry pi as a server of IoT sensor data that gets polled for its data by an IoT gateway in Node Red, but the peers are running in the cloud in Kubernetes. I use the Fabric CA to issue identities for each org in the network and also assign each IoT device an identity from the CA as a security practice. Demo here:

https://youtu.be/rGHI8-tpzX0

On Apr 15, 2021, at 6:53 AM, Nikos Karamolegkos <nkaram@ics.forth.gr> wrote:

Hello everyone, I am new to BC and hyperledger. I would like to deploy a BC to an existing IoT network. I have not decide yet the architecture of the BC network (peer, orgs, etc) but I am thinking to deploy some peers in a raspberries which already act as IoT gateways (GWs) and receive sensor data. Also, in GW I would install the fabric client application to update the ledger (with the IoT data). The idea is the data to be distributed in all GWs acting as peers. Is this a good approach for start or should I have the BC network in the backbone?

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






Hyperledger fabric in IoT application

Nikos Karamolegkos
 

Hello everyone, I am new to BC and hyperledger. I would like to deploy a BC to an existing IoT network. I have not decide yet the architecture of the BC network (peer, orgs, etc) but I am thinking to deploy some peers in a raspberries which already act as IoT gateways (GWs) and receive sensor data. Also, in GW I would install the fabric client application to update the ledger (with the IoT data). The idea is the data to be distributed in all GWs acting as peers. Is this a good approach for start or should I have the BC network in the backbone?

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


QSCC query equivalents for private collections

Simeon MacMillen
 

Hello community,

What would be the best approach to query an asset on a private collection by transaction ID?

Is there an equivalent of QSCC system chaincode APIs (such as getTransactionByTransactionID) for private collections?

Thank you,
Simeon MacMillen


Use certificates from a non-Fabric CA with your Fabric network #signcerts #interoperability #fabric-ca #x509

sangieri@...
 

Hello Community, 

 

I'm working on a use case where I need to use certificates, which bind resources to identities, that have been already issued by an Authoritative CA with the Fabric Network I'm developing which is dealing with the same resources bound in the certificates. 

 

Reading the docs: https://hyperledger-fabric-ca.readthedocs.io/en/latest/deployguide/ca-deploy-topology.html 

I see that yes it is possible, but I cannot figure out How. 

There are several articles about how "to link" a third party or external CA to a HF CA, but I guess this is not the use case. Actually, instead of linking the Authoritative CA to a HF CA I would like just to use the certificates emitted by the Authoritative CA into my network.

Basically, I want to bind the existing authorization model to my HF network.  

 

So let's imagine a scenario: 

 

user with (certificate, private_key) externally emitted --> Fabric CA --> User credential for the Fabric Network

where the fabric CA can verify, using a trust anchor, the validity of the certificate provided by the user and upon successfull verification, emit the user credential for the fabric network.

 

Has such a solution already been implemented?  

Any advise, different solution or pointer to docs I can read about? 

 

Thanks to All, 

Stefano Angieri 

 

 

 

341 - 360 of 10158