Date   

Two ways of registering a user in Node SDK?

Siddharth Jain
 

Looking at the docs for fabric-ca-client Node library, it seems there are 2 ways one could register a new user.

register(req, registrar)

Register the member and return an enrollment secret.
Parameters:
Name Type Description
req RegisterRequest The RegisterRequest
registrar User . The identity of the registrar (i.e. who is performing the registration)
Returns:
The enrollment secret to use when this user enrolls

create(req, registrar)

Create a new identity with the Fabric CA server. An enrollment secret is returned which can then be used, along with the enrollment ID, to enroll a new identity. The caller must have `hf.Registrar` authority.
Parameters:
Name Type Description
req IdentityRequest The IdentityRequest
registrar User The identity of the registrar (i.e. who is performing the registration).
Returns:
Return the secret of this new identity

Is this correct?
Could someone explain why two methods are supported?

And is there a method to check if a user is already registered before trying to enroll them?

getOne(enrollmentID, registrar)

Get an identity. The caller must have `hf.Registrar` authority.
Parameters:
Name Type Description
enrollmentID string Required. The enrollment ID which uniquely identifies an identity
registrar User Required. The identity of the registrar (i.e. who is performing the registration).
Returns:

but not sure. What does the ServiceResponse contain if user is registered vs. not?
Create a new identity with the Fabric CA server. An enrollment secret is returned which can then be used, along with the enrollment ID, to enroll a new identity.
hyperledger.github.io


Re: Hyperleger Fabric 2.0 - How to execute block Query throgh fabric-sdk-node client

Kumari Shweta
 

Thanks Gari for your quick response.

Yes fabric-sdk-node release 1.4's channel class has all these methods.

I am using Hyperleger fabric 2.0 with fabric-sdk-node(Beta).The channel class in beta version is updated a lot
and block related queries are removed from channel class.

I can see Block query in go and java sdk but not in node.

https://github.com/hyperledger/fabric-sdk-java/blob/master/src/main/java/org/hyperledger/fabric/sdk/BlockInfo.java
https://github.com/hyperledger/fabric-sdk-go/blob/master/pkg/client/ledger/ledger.go

Kindly Suggest.

Thanks a lot,

Regards,
Shweta

-----Original Message-----
From: Gari Singh <garis@...>
Sent: Wednesday, March 25, 2020 5:58 PM
To: Kumari Shweta <kumari.shweta@...>
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Hyperleger Fabric 2.0 - How to execute block Query throgh fabric-sdk-node client

[CAUTION: This Email is from outside the Organization. Do not click links or open attachments unless you trust the sender.]

The are all available as methods on the Channel class: https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhyperledger.github.io%2Ffabric-sdk-node%2Frelease-1.4%2FChannel.html&;data=02%7C01%7Ckumari.shweta%40hcl.com%7C6640ba33efe74e17a3fb08d7d0b7f116%7C189de737c93a4f5a8b686f4ca9941912%7C0%7C1%7C637207360755222169&amp;sdata=UGvtQCtqz2cyD3BeYLXSFN1515RUVrbIzstMNSJrtW8%3D&amp;reserved=0

-----------------------------------------
Gari Singh
Distinguished Engineer, CTO - IBM Blockchain IBM Middleware
550 King St
Littleton, MA 01460
Cell: 978-846-7499
garis@...
-----------------------------------------

-----fabric@... wrote: -----
To: fabric@...
From: kumari.shweta@...
Sent by: fabric@...
Date: 03/25/2020 06:12AM
Subject: [EXTERNAL] [Hyperledger Fabric] Hyperleger Fabric 2.0 - How to execute block Query throgh fabric-sdk-node client

Hi Team,

In Hyperleger Fabric 2.0 - How to queries QueryInfo, QueryBlock, QueryBlockByHash, QueryBlockByTxID, QueryTransaction and QueryConfig using fabric-sdk-node client. As I can see these methods in java and go sdk client but not in fabric-sdk-node. Kindly Suggest.

Regards,
Shweta


::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________


Re: Hyperleger Fabric 2.0 - How to execute block Query throgh fabric-sdk-node client

Gari Singh <garis@...>
 

The are all available as methods on the Channel class: https://hyperledger.github.io/fabric-sdk-node/release-1.4/Channel.html

-----------------------------------------
Gari Singh
Distinguished Engineer, CTO - IBM Blockchain
IBM Middleware
550 King St
Littleton, MA 01460
Cell: 978-846-7499
garis@...
-----------------------------------------

-----fabric@... wrote: -----
To: fabric@...
From: kumari.shweta@...
Sent by: fabric@...
Date: 03/25/2020 06:12AM
Subject: [EXTERNAL] [Hyperledger Fabric] Hyperleger Fabric 2.0 - How to execute block Query throgh fabric-sdk-node client

Hi Team,

In Hyperleger Fabric 2.0 - How to queries QueryInfo, QueryBlock, QueryBlockByHash, QueryBlockByTxID, QueryTransaction and QueryConfig using fabric-sdk-node client. As I can see these methods in java and go sdk client but not in fabric-sdk-node. Kindly Suggest.

Regards,
Shweta


Hyperleger Fabric 2.0 -Life cycle endorsement with “Any Majority” is not working. #fabric-questions

Kumari Shweta
 

Chain code life cycle endorsement is not working when following changes made in configtx.yaml.

LifecycleEndorsement:
    Type: ImplicitMeta
    Rule: "ANY Endorsement"
Endorsement:
    Type: ImplicitMeta
    Rule: "ANY Endorsement"

Network contains:

  • one ordering service cluster with five orderers running Raft
  • three organizations (Org1, Org2 and Org3), each of which has one peer (peer0)
  • one channel mychannel is created, and peers in all organizations join the channel

Package SACC into chaincode package

  • Install chaincode package to peers of all the three organizations
  • Org1 approves chaincode package, and tries to commit the chaincode. It fails and getting Endorsement policy error.

But chain code should be commited as LifecycleEndorsement has "Any Endorsement" rule.


Hyperleger Fabric 2.0 - How to execute block Query throgh fabric-sdk-node client

Kumari Shweta
 

Hi Team,

In Hyperleger Fabric 2.0 -
 How to queries QueryInfo, QueryBlock, QueryBlockByHash,  QueryBlockByTxID, QueryTransaction and QueryConfig using fabric-sdk-node client.
As I can see these methods in java and go sdk client but not in fabric-sdk-node.
Kindly Suggest.

Regards,
Shweta
 


Re: RAFT based orderer crash #fabric-orderer #raft #fabric

Jean-Gaël Dominé <jgdomine@...>
 

Hi,

We had the same issue in our network.
To solve it, we found a way to persist the following folder in each orderer: /var/hyperledger/production/orderer/etcdraft
Without it restored after a restart, the orderer could not recover.

https://lists.hyperledger.org/g/fabric/topic/raft_orderer_issue/68228360?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,68228360
https://lists.hyperledger.org/g/fabric/topic/32652092

JG



Re: Signature Byte Isn't Valid Warning On Gossip After Addition of a New Org #hyperledger-fabric #configtxgen #raft

Yacov
 

this is not a "bug", this is a natural product of messages being gossiped out of order which is how gossip works.
This is a warning, not an error... if you see it repeatedly only then you should be worried



From:        "Faisal" <mfaisaltariq@...>
To:        fabric@...
Date:        03/24/2020 09:04 PM
Subject:        [EXTERNAL] Re: [Hyperledger Fabric] Signature Byte Isn't Valid Warning On Gossip After Addition of a New Org #hyperledger-fabric #configtxgen #raft
Sent by:        fabric@...




Is this fixed in the 1.4.4 version LTS as we plan to upgrade the network in the coming weeks?




Re: Signature Byte Isn't Valid Warning On Gossip After Addition of a New Org #hyperledger-fabric #configtxgen #raft

Faisal
 

Is this fixed in the 1.4.4 version LTS as we plan to upgrade the network in the coming weeks?


Re: Signature Byte Isn't Valid Warning On Gossip After Addition of a New Org #hyperledger-fabric #configtxgen #raft

Yacov
 

Ignore it, it's a transient warning.

It happens if you get a state info message signed from a node which you did not yet receive its certificate.
You will eventually receive the certificate and be able to validate the signature.



From:        "Faisal" <mfaisaltariq@...>
To:        fabric@...
Date:        03/24/2020 03:16 PM
Subject:        [EXTERNAL] [Hyperledger Fabric] Signature Byte Isn't Valid Warning On Gossip After Addition of a New Org #hyperledger-fabric #configtxgen #raft
Sent by:        fabric@...




Environment

HLF (1.4.2)
Orderer (RAFT 3 Node)
2 Orgs (adding 3rd Org)
Running on multiple hosts (Docker Swarm Cluster)


Steps Followed

Configtx.yaml file contents

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

---
################################################################################
#
# Section: Organizations
#
# - This section defines the different organizational identities which will
# be referenced later in the configuration.
#
################################################################################
Organizations:
-&SFDA
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name:SFDAMSP

# ID to load the MSP definition as
ID:SFDAMSP

MSPDir:crypto-config/peerOrganizations/sfda.example.com/msp

# Policies defines the set of policies at this level of the config tree
# For organization policies, their canonical path is usually
# /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
Policies:
Readers:
Type:Signature
Rule:"OR('SFDAMSP.admin', 'SFDAMSP.peer', 'SFDAMSP.client')"
Writers:
Type:Signature
Rule:"OR('SFDAMSP.admin', 'SFDAMSP.client')"
Admins:
Type:Signature
Rule:"OR('SFDAMSP.admin')"

# leave this flag set to true.
AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
-Host:peer0.sfda.example.com
Port:7051



crypto-config.yaml

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:
# ---------------------------------------------------------------------------
# Org3
# ---------------------------------------------------------------------------
-Name:SFDA
Domain:sfda.example.com
EnableNodeOUs:true
Template:
Count:2
Users:
Count:1


1- Generated Certs

cryptogen generate --config=./crypto-config.yaml


2- Generated Configuration

configtxgen -printOrg SFDAMSP > ./SFDA.json


3- Copied Certs and configuration file into cli

4- Set environment variables for Orderer in CLI and channel name

5- Ran the following set of commands

```
peer channel fetch config config_block.pb -o orderer.example.com:7050 -c $CHANNEL_NAME --tls --cafile $ORDERER_CA
configtxlator proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config >config.json
```

Append the configuration of the new org in **SFDA.json**file into the **config.json**file. Change the file name and MSP in the below command accordingly.
```
jq -s '.[0] * {"channel_group":{"groups":{"Application":{"groups": {"SFDAMSP":.[1]}}}}}' config.json ./SFDA.json > modified_config.json
```
Verify that the file has been updated
```
diff config.json modified_config.json
```

Package updated configuration into a block and then create a block that is delta of the old and new configuration
```
# Pack config again, create a delta of new and old config
configtxlator proto_encode --input config.json --type common.Config >original_config.pb
configtxlator proto_encode --input modified_config.json --type common.Config >modified_config.pb
configtxlator compute_update --channel_id $CHANNEL_NAME --original original_config.pb --updated modified_config.pb >config_update.pb
```
Convert the Delta Block **config_update.pb**block to JSON again, append the header to it and create a package again. Modify the channel name in the second command accordingly
```
configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate >config_update.json
echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel", "type":2}},"data":{"config_update":'$(cat config_update.json)'}}}' | jq . > config_update_in_envelope.json
configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope >update-block-env.pb
```


6- Set the environment for Peer0 Org1 and Signed the update-block-env.pb

peer channel signconfigtx -f update-block-env.pb


7- Set the environment for Peer0 Org2 and send the transaction to orderer

peer channel update -f update-block-env.pb -c $CHANNEL_NAME -o orderer.example.com:7050 --tls --cafile $ORDERER_CA


8- Deployed the peer and couchdbs
9- Installed chaincode on all peers including new peers added
10- Upgraded the chaincode with the new endorsement policy
11- Sent a transaction and received the following warning.



What would be the implications of this warning in the future or can it can be ignored?





Signature Byte Isn't Valid Warning On Gossip After Addition of a New Org #hyperledger-fabric #configtxgen #raft

Faisal
 

Environment

HLF (1.4.2)
Orderer (RAFT 3 Node)
2 Orgs (adding 3rd Org)
Running on multiple hosts (Docker Swarm Cluster)

Steps Followed
Configtx.yaml file contents

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

---
################################################################################
#
# Section: Organizations
#
# - This section defines the different organizational identities which will
# be referenced later in the configuration.
#
################################################################################
Organizations:
- &SFDA
# DefaultOrg defines the organization which is used in the sampleconfig
# of the fabric.git development environment
Name: SFDAMSP

# ID to load the MSP definition as
ID: SFDAMSP

MSPDir: crypto-config/peerOrganizations/sfda.example.com/msp

# Policies defines the set of policies at this level of the config tree
# For organization policies, their canonical path is usually
# /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
Policies:
Readers:
Type: Signature
Rule: "OR('SFDAMSP.admin', 'SFDAMSP.peer', 'SFDAMSP.client')"
Writers:
Type: Signature
Rule: "OR('SFDAMSP.admin', 'SFDAMSP.client')"
Admins:
Type: Signature
Rule: "OR('SFDAMSP.admin')"

# leave this flag set to true.
AnchorPeers:
# AnchorPeers defines the location of peers which can be used
# for cross org gossip communication. Note, this value is only
# encoded in the genesis block in the Application section context
- Host: peer0.sfda.example.com
Port: 7051



crypto-config.yaml

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:
# ---------------------------------------------------------------------------
# Org3
# ---------------------------------------------------------------------------
- Name: SFDA
Domain: sfda.example.com
EnableNodeOUs: true
Template:
Count: 2
Users:
Count: 1


1- Generated Certs

cryptogen generate --config=./crypto-config.yaml


2- Generated Configuration

configtxgen -printOrg SFDAMSP > ./SFDA.json


3- Copied Certs and configuration file into cli

4- Set environment variables for Orderer in CLI and channel name

5- Ran the following set of commands

```
peer channel fetch config config_block.pb -o orderer.example.com:7050 -c $CHANNEL_NAME --tls --cafile $ORDERER_CA
configtxlator proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config >config.json
```

Append the configuration of the new org in **SFDA.json** file into the **config.json** file. Change the file name and MSP in the below command accordingly.
```
jq -s '.[0] * {"channel_group":{"groups":{"Application":{"groups": {"SFDAMSP":.[1]}}}}}' config.json ./SFDA.json > modified_config.json
```
Verify that the file has been updated
```
diff config.json modified_config.json
```

Package updated configuration into a block and then create a block that is delta of the old and new configuration
```
# Pack config again, create a delta of new and old config
configtxlator proto_encode --input config.json --type common.Config >original_config.pb
configtxlator proto_encode --input modified_config.json --type common.Config >modified_config.pb
configtxlator compute_update --channel_id $CHANNEL_NAME --original original_config.pb --updated modified_config.pb >config_update.pb
```
Convert the Delta Block **config_update.pb** block to JSON again, append the header to it and create a package again. Modify the channel name in the second command accordingly
```
configtxlator proto_decode --input config_update.pb --type common.ConfigUpdate >config_update.json
echo '{"payload":{"header":{"channel_header":{"channel_id":"mychannel", "type":2}},"data":{"config_update":'$(cat config_update.json)'}}}' | jq . > config_update_in_envelope.json
configtxlator proto_encode --input config_update_in_envelope.json --type common.Envelope >update-block-env.pb
```


6- Set the environment for Peer0 Org1 and Signed the update-block-env.pb

peer channel signconfigtx -f update-block-env.pb


7- Set the environment for Peer0 Org2 and send the transaction to orderer

peer channel update -f update-block-env.pb -c $CHANNEL_NAME -o orderer.example.com:7050 --tls --cafile $ORDERER_CA


8- Deployed the peer and couchdbs
9- Installed chaincode on all peers including new peers added
10- Upgraded the chaincode with the new endorsement policy
11- Sent a transaction and received the following warning.


What would be the implications of this warning in the future or can it can be ignored?


Unable to revoke a certificate #fabric #hyperledger-fabric #fabric-sdk-node

p.kamesh.cse@...
 

We could revoke an user successfully. But, unable to update the channel with crl details. We are getting below error 

Unexpected error error applying config update to existing channel 'trusttrace': initializing channelconfig failed: could not create channel Application sub-group config: setting up the MSP manager failed: admin 0 is invalid: could not validate identity against certification chain: The certificate has been revoked

We have followed below standard steps to revoke an user certificate by using node.js fabric library,

1) revoke an user by serial, AKI for a given certificate
caClient.revoke({
serial: serial,
aki: aki
}, adminUser)
2) Generated CRL for the same 
caClient.generateCRL({}, adminUser)
3) fetching the channelconfig  and updating the config with crl
original_config_json.channel_group.groups.Application.groups[orgName].values.MSP.value.config.revocation_list = [crl];
4) computing delta w.r.t modified changes and signing the same with org admin / registrar and updating the channel
 


Re: Does Hyperledger Fabric support RSA key? #hyperledger-fabric #fabric-ca

Baohua Yang
 

Fabric supports ECDSA for signature currently.
There're several non-official work to let it support other crypto standards.
For chaincode/client encryption, you can choose whatever type.

On Mon, Mar 23, 2020 at 12:23 PM Matthew Sykes <matthew.sykes@...> wrote:
> I then wonder why latest fabric-ca user guide mentions about supporting RSA?

Because fabric-ca supports the management of certificates using RSA; you just can't use them with Fabric.

--
Matthew Sykes
matthew.sykes@...



--
Best wishes!

Baohua Yang


Re: Does Hyperledger Fabric support RSA key? #hyperledger-fabric #fabric-ca

Matthew Sykes
 

> I then wonder why latest fabric-ca user guide mentions about supporting RSA?

Because fabric-ca supports the management of certificates using RSA; you just can't use them with Fabric.

--
Matthew Sykes
matthew.sykes@...


Re: [EXTERNAL] Re: [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain

Prasanth Sundaravelu
 

Hi Ameya,

You might have to read about No-SQL databases. 

And to answer your question, 

Yes, there can be multiple assets created and they can be differentiated in a no-sql database using a "DocType" field. 
Each asset can have their own unique identifiers and using that ID, they can be linked between multiple assets. It will be your job as a developer to fetch linked assets though.

Eg: 
You can have something like:
Coffee_Pack {
DocType: "Coffee"
ID: CP_001
Weight: 1 Kg
...
..


Transport_Package {
DocType: "Transportation"
ID: T_001
CoffeePacks: [CP_001, CP_002, CP_003 ....]
Status: "In-Transit"
...
}

When you want to query a list of all coffee packets present in a transport package, you can:
1. Get Transport package with ID T_001
2. Loop through CofeePacks field and get the Coffee_Packs using ID. 
3. Return.

With couch db, you can also perform rich queries, using that you can also get Coffee_Packs or Transport_Packages using fields other than ID.
For example, If you want a list of all Transport_Packages, you can query using "DocType" field. Since all Transport_Packages will have same DocType, you get what you want, and that's how DocType separates multiple assets in a no-sql database. 

You can also consider DocType similar to Table Name in relational databses, and every new object created for an asset can be considered as a new row being added to the table with tablename as mentioned in DocType field.

- Prasanth


On Mon, 23 Mar 2020, 8:18 pm Ameya Sinha via Lists.Hyperledger.Org, <t-amsi=microsoft.com@...> wrote:

Hi David,

 

Thanks for the reply, it helped clear one aspect of my doubt. I have one more thing to ask now though.

 

So I’ve been reading about how Blockchain solutions are implemented in Supply Chain, and I was thinking that they would represent the data in a relational way. As a lot of the solutions I’ve read use Hyperledger Fabric do these solutions represent data in key-value pair?

 

How do they deal with combination of items then? As in suppose, there’s a coffee tracking system which tracks the coffee beans, when the beans combine to form a packet how does that representation play in our database?

 

Thanks for your help,

Ameya Sinha.

 

From: David Enyeart <enyeart@...>
Sent: Monday, March 23, 2020 6:10 PM
To: Ameya Sinha <t-amsi@...>
Cc: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain

 

The current Fabric transaction manager supports key/value data only. If you want semi-structured data, you can utilize JSON as the value and leverage CouchDB state database for JSON queries.

There is no support for relational data models (technically it could be added in the future, but there is no current plan to do so).

Many people choose to utilize an off-chain database for fit-for-purpose reporting/queries, see suggestions in doc:
https://hyperledger-fabric.readthedocs.io/en/release-2.0/couchdb_tutorial.html#use-best-practices-for-queries-and-indexes


Dave Enyeart


"Ameya Sinha via Lists.Hyperledger.Org" ---03/23/2020 12:58:04 AM---Hi All, I was wondering how would be represent data that is intrinsically relational i

From: "Ameya Sinha via Lists.Hyperledger.Org" <t-amsi=microsoft.com@...>
To: "fabric@..." <fabric@...>
Cc: fabric@...
Date: 03/23/2020 12:58 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain
Sent by: fabric@...





Hi All,

I was wondering how would be represent data that is intrinsically relational in nature on a Blockchain like Hyperledger Fabric. Do we normalize the data and the represent each part of it as an asset on Hyperledger? How would joins and queries work in that case?

Thanks,
Ameya Sinha.




Re: Doubt in representation of Relational Data on Blockchain

Brett T Logan <brett.t.logan@...>
 

Generally you implement some other standard. In particular the global supply chain standard is GS1. Items have what is called a GTIN identifying their category specific to your company and serial numbers. GS1 likewise has an event called transformation. Your transformation event removes the bean from the chain and converts it to a packet. Just as converting a packet into case and a case into a pallet is an aggregation event. And then you have an aggregation event that does the reverse, converts the pallet back into cases.
 
The GS1 data standard also has a field for recording what items are part of these aggregations. So you can see that a pallet contains these cases with SN and GTIN's. Then when someone breaks the pallet down, and scans the cases, you have systems for recording this in the blockchain and then you can verify whether all of the cases that went into the pallet still existed when the pallet was broken down, and then packets in the case.
 
All of this data, its transformations, aggregations, and parent-child relationships are represented in simple standards like JSON and XML in GS1.
 
Brett Logan
Software Engineer, IBM Blockchain
Phone: 1-984-242-6890
 
 
 

----- Original message -----
From: "Ameya Sinha via Lists.Hyperledger.Org" <t-amsi=microsoft.com@...>
Sent by: fabric@...
To: David Enyeart <enyeart@...>
Cc: fabric@...
Subject: Re: [EXTERNAL] Re: [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain
Date: Mon, Mar 23, 2020 10:48 AM
 

Hi David,

 

Thanks for the reply, it helped clear one aspect of my doubt. I have one more thing to ask now though.

 

So I’ve been reading about how Blockchain solutions are implemented in Supply Chain, and I was thinking that they would represent the data in a relational way. As a lot of the solutions I’ve read use Hyperledger Fabric do these solutions represent data in key-value pair?

 

How do they deal with combination of items then? As in suppose, there’s a coffee tracking system which tracks the coffee beans, when the beans combine to form a packet how does that representation play in our database?

 

Thanks for your help,

Ameya Sinha.

 

From: David Enyeart <enyeart@...>
Sent: Monday, March 23, 2020 6:10 PM
To: Ameya Sinha <t-amsi@...>
Cc: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain

 

The current Fabric transaction manager supports key/value data only. If you want semi-structured data, you can utilize JSON as the value and leverage CouchDB state database for JSON queries.

There is no support for relational data models (technically it could be added in the future, but there is no current plan to do so).

Many people choose to utilize an off-chain database for fit-for-purpose reporting/queries, see suggestions in doc:
https://hyperledger-fabric.readthedocs.io/en/release-2.0/couchdb_tutorial.html#use-best-practices-for-queries-and-indexes


Dave Enyeart

"Ameya Sinha via Lists.Hyperledger.Org" ---03/23/2020 12:58:04 AM---Hi All, I was wondering how would be represent data that is intrinsically relational i

From: "Ameya Sinha via Lists.Hyperledger.Org" <t-amsi=microsoft.com@...>
To: "fabric@..." <fabric@...>
Cc: fabric@...
Date: 03/23/2020 12:58 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain
Sent by: fabric@...





Hi All,

I was wondering how would be represent data that is intrinsically relational in nature on a Blockchain like Hyperledger Fabric. Do we normalize the data and the represent each part of it as an asset on Hyperledger? How would joins and queries work in that case?

Thanks,
Ameya Sinha.



 


Re: [EXTERNAL] Re: [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain

Ameya Sinha <t-amsi@...>
 

Hi David,

 

Thanks for the reply, it helped clear one aspect of my doubt. I have one more thing to ask now though.

 

So I’ve been reading about how Blockchain solutions are implemented in Supply Chain, and I was thinking that they would represent the data in a relational way. As a lot of the solutions I’ve read use Hyperledger Fabric do these solutions represent data in key-value pair?

 

How do they deal with combination of items then? As in suppose, there’s a coffee tracking system which tracks the coffee beans, when the beans combine to form a packet how does that representation play in our database?

 

Thanks for your help,

Ameya Sinha.

 

From: David Enyeart <enyeart@...>
Sent: Monday, March 23, 2020 6:10 PM
To: Ameya Sinha <t-amsi@...>
Cc: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain

 

The current Fabric transaction manager supports key/value data only. If you want semi-structured data, you can utilize JSON as the value and leverage CouchDB state database for JSON queries.

There is no support for relational data models (technically it could be added in the future, but there is no current plan to do so).

Many people choose to utilize an off-chain database for fit-for-purpose reporting/queries, see suggestions in doc:
https://hyperledger-fabric.readthedocs.io/en/release-2.0/couchdb_tutorial.html#use-best-practices-for-queries-and-indexes


Dave Enyeart


"Ameya Sinha via Lists.Hyperledger.Org" ---03/23/2020 12:58:04 AM---Hi All, I was wondering how would be represent data that is intrinsically relational i

From: "Ameya Sinha via Lists.Hyperledger.Org" <t-amsi=microsoft.com@...>
To: "fabric@..." <fabric@...>
Cc: fabric@...
Date: 03/23/2020 12:58 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain
Sent by: fabric@...





Hi All,

I was wondering how would be represent data that is intrinsically relational in nature on a Blockchain like Hyperledger Fabric. Do we normalize the data and the represent each part of it as an asset on Hyperledger? How would joins and queries work in that case?

Thanks,
Ameya Sinha.




Re: Error while Approving chaincode for ORG.

Adhav Pavan
 

Hi Nikhil,

I confirmed one more time, I am sure, I am using the correct MSP ID for each organization.

Thank you for your reply.

Heartfelt Regards,

Pavan Adhav
Blockchain Developer, Infinichains
phone:  8390114357
email:  pavan@...
------
Please excuse my brevity.


On Mon, Mar 23, 2020 at 6:38 PM Nikhil E Gupta <negupta@...> wrote:
Maybe check the MSP ID? you could be using the wrong environment variables for the ORG?



-----fabric@... wrote: -----
To: David Enyeart <enyeart@...>, hyperledger-fabric <hyperledger-fabric@...>
From: "Adhav Pavan"
Sent by: fabric@...
Date: 03/21/2020 11:02PM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Error while Approving chaincode for ORG.

Hello David,

Thank you so much for the quick reply.

I have checked the peer signed certificate and it has OU as a peer.

Subject: C = US, ST = California, L = San Francisco, OU = peer, CN = peer0.org1.example.com

The weird thing is, it worked previously and suddenly started giving the mentioned error.

Thank you.

Heartfelt Regards,

Pavan Adhav
Blockchain Developer, Infinichains
phone:  8390114357
email:  pavan@...
------
Please excuse my brevity.


On Sun, Mar 22, 2020 at 2:12 AM David Enyeart <enyeart@...> wrote:

Make sure your peer certificate has "OU=peer" in the Subject.

You can view your certificate using openssl, e.g.:
openssl x509 -in <mspConfigPath>/msp/signcerts/peer0.org1.example.com-cert.pem -noout -text

For more details about identity classifications:
https://hyperledger-fabric.readthedocs.io/en/latest/msp.html#identity-classification


Dave Enyeart

"Adhav Pavan" ---03/21/2020 11:22:11 AM---Hello Experts, I am creating a network using fabric 2.0.

From: "Adhav Pavan" <adhavpavan@...>
To: hyperledger-fabric <hyperledger-fabric@...>
Date: 03/21/2020 11:22 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Error while Approving chaincode for ORG.
Sent by: fabric@...





Hello Experts,

I am creating a network using fabric 2.0.

As per the new lifecycle method, I am following as mentioned in the test-network.

I have 2 Org having 2 peers in each, not using CLI.

Steps:
1)  Channel Artifacts Creation (Genesis Block, Channel.tx)
2) Channel Creation
3) Deploying Chaincode
    • Package Chaincode
    • Install Chaincode
    • QueryInstalled Chaincode
    • Approve for My Org
I am getting an error while approving for my organization.

Here is the command
    peer lifecycle chaincode approveformyorg \
     -o localhost:7050  \
     --ordererTLSHostnameOverride orderer.example.com \
     --tls $CORE_PEER_TLS_ENABLED \
     --cafile $ORDERER_CA \
     --channelID $CHANNEL_NAME \
     --name fabcar \
     --version ${VERSION} \
     --init-required \
     --package-id ${PACKAGE_ID} \
     --sequence ${VERSION}

 Environmental Variables:
Getting the following error:

Peer log:
VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection _implicit_org_Org1MSP chaincode _lifecycle in tx 5:0 failed: signature set did not satisfy the policy

Just above this error, getting following
[cauthdsl] func2 -> DEBU 197cf 0xc0037051e0 identity 0 does not satisfy principal: The identity is not a [PEER] under this MSP [Org1MSP]: The identity does not contain OU [PEER], MSP: [Org1MSP].

Default Policy:
LifecycleEndorsement:
Type: ImplicitMeta
Rule: "MAJORITY Endorsement"
Endorsement:
Type: ImplicitMeta
Rule: "MAJORITY Endorsement"



 Please correct me If I am mistaken somewhere. I am following test-network.

 Let me know for more network information.

Thank you so much for your help.

Heartfelt Regards,

Pavan Adhav
Blockchain Developer, Infinichains
phone:  8390114357
email:  adhavpavan@...
------
Please excuse my brevity.





Re: Doubt in representation of Relational Data on Blockchain

David Enyeart
 

The current Fabric transaction manager supports key/value data only. If you want semi-structured data, you can utilize JSON as the value and leverage CouchDB state database for JSON queries.

There is no support for relational data models (technically it could be added in the future, but there is no current plan to do so).

Many people choose to utilize an off-chain database for fit-for-purpose reporting/queries, see suggestions in doc:
https://hyperledger-fabric.readthedocs.io/en/release-2.0/couchdb_tutorial.html#use-best-practices-for-queries-and-indexes


Dave Enyeart

"Ameya Sinha via Lists.Hyperledger.Org" ---03/23/2020 12:58:04 AM---Hi All, I was wondering how would be represent data that is intrinsically relational i

From: "Ameya Sinha via Lists.Hyperledger.Org" <t-amsi=microsoft.com@...>
To: "fabric@..." <fabric@...>
Cc: fabric@...
Date: 03/23/2020 12:58 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Doubt in representation of Relational Data on Blockchain
Sent by: fabric@...





Hi All,

I was wondering how would be represent data that is intrinsically relational in nature on a Blockchain like Hyperledger Fabric. Do we normalize the data and the represent each part of it as an asset on Hyperledger? How would joins and queries work in that case?

Thanks,
Ameya Sinha.





Re: The problem of tampered value in blockfile going to other peers #fabric

David Enyeart
 

See answers to the same questions in prior thread https://lists.hyperledger.org/g/fabric/message/4896.

To answer the other questions:

A new peer that joins will get blocks from an ordering service node or from another peer node. In either case, the receiving peer will match the data against the original block signature, to ensure corrupted/tampered blocks aren't received.

You should utilize an endorsement policy that requires multiple organization's peers to agree on the chaincode execution results, to ensure any one peer's corrupted/tampered data does not impact future transactions. A simple 'OR' endorsement policy is not suitable for actual deployments, for the reasons you highlight.



Dave Enyeart

"Lei Zhao" ---03/23/2020 12:01:34 AM---Hi, anyone can help me solve this problem? Basic info: a channel with 2 organizations A and B, the p

From: "Lei Zhao" <tyrone197913@...>
To: fabric@...
Date: 03/23/2020 12:01 AM
Subject: [EXTERNAL] [Hyperledger Fabric] The problem of tampered value in blockfile going to other peers #fabric
Sent by: fabric@...





Hi, anyone can help me solve this problem?
Basic info: a channel with 2 organizations A and B, the policy is OR ( A, B).
each has only 1 peer.

Tamper process:
I changed the value from 1,000,000 to 1,500,000 in blockfile_000000 by using vi tool in A organization.
Hashcode and data should unmatch of course.

and couch db


Then the tampered value shown in client web app.

That is OK. but the client application of A organization still worked well and proposed and committed 1,500,000 to B organization.
In B organization, the value was changed to 1,500,000.

After that, when another new transaction created by B organization, peer of A organization came error.
But the big problem is , even I recovered the peer of A organization by re-join the channel.
The tampered value 1,500,000 was still there in both A and B organization.

My question is.
1. Why client app can still proposed and committed transaction even when hash and data unmatches?
2. Any ways to avoid new transaction committed, when the value was tampered?





Re: Does Hyperledger Fabric support RSA key? #hyperledger-fabric #fabric-ca

shrugupt@...
 

Thank you Matthew for answering the query.
 
I then wonder why latest fabric-ca user guide mentions about supporting RSA? I also had same understanding that Hyperledger fabric does not support RSA algorithm but got confuse after reading latest fabric-ca user guide. Not sure if it is mentioned with some purpose in latest user guide or it is a discrepancy in documentation?
 
Thanks,
Shruti Gupta

3621 - 3640 of 11527