Date   

Re: How to recover when write set update statedb failed

Senthil Nathan
 

Does RDB mean Relational Database?

I am assuming the answer to be yes (otherwise, the following can be ignored).

When adding new DB, we need to be very careful when allowing new features to the chaincode. Assume that we introduce a relation database and allow users to create a table with constraints such as NULL/NOT NULL, explicit constraints such as CHECK(price > 10), and moreover a type schema (int, float, string), in the current form, the peer does not guarantee that final commit would pass without explicitly making it aware of these new features and having an additional validation. This is because the peer does not send the writes to DB during the simulation. These checks need to be done on the chaincode side but it would make the chaincode not really use DB features. 

For now, we can plugin any database by implementing the DB interface and only allow Get/Put/Range for serializable isolation and QueryResult for the Repeatable Read Isolation only. Hence, whenever we add a new DB, it is better to look at the txmgr pkg (to understand how read/write set is collected) and the validator pkg (to understand how we ensure serializable isolation). Both might require extensions if we need to expose additional features provided by the DB to the chaincode.

If we need to expose all features of the underlying DB (other than simple KV stores such as leveldb) to the chaincode, we need to make some modifications to the internals of the database itself (similar to the one mention in this proposal -- https://jira.hyperledger.org/browse/FAB-8031 can be done better now and this is kind of old design).

Regards,
Senthil


On Fri, May 1, 2020 at 11:39 AM grapebaba <281165273grape@...> wrote:
Guys,

Recently we try to add RDB as a statedb in fabric. We refer the couchdb implementation, while we have a concern which after block written in ledger, the write set will update state db. However it is possible failed if the write set violate remote RDB constraint. It will cause Peer panic and I don’t see how to recover from this case. Can anyone give some suggestions?


Re: How to recover when write set update statedb failed

David Enyeart
 

We have considered the problem of how to avoid errors during statedb write due to data constraints or other similar DB errors, and concluded that the only reliable solution would be to write a trial record to the database during endorsement phase before returning successful endorsement.
On databases that support it, this could be done by doing an uncommitted write during endorsement phase. On other databases, it could be done by doing a write and then immediate delete during endorsement phase. Rather than writing/deleting from the real statedb table, it may be better to write/delete from a secondary table that exactly matches the real statedb table's schema, so that there is no chance of impacting the real statedb table.
We considered this approach even for CouchDB, but the rules for valid CouchDB writes seemed straightforward enough, therefore peer endorsement code itself checks against CouchDB write rules before returning successful endorsement.

Maybe you could bring your RDBMS design to the community for review?


Dave Enyeart

"Gari Singh" ---05/01/2020 05:44:14 AM---What type of constraint are you violating? If the peer considers that state update to be valid and i

From: "Gari Singh" <garis@...>
To: "grapebaba" <281165273grape@...>
Cc: fabric@...
Date: 05/01/2020 05:44 AM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] How to recover when write set update statedb failed
Sent by: fabric@...





What type of constraint are you violating?
If the peer considers that state update to be valid and it CANNOT write to the state database, it cannot proceed and therefore it panics as the goal is not to ever get into an inconsistent state during validation and commit.
There is/was an open item to modify this behavior such that the peer itself does not panic but rather the peer would only stop processing for the channel in which the error occurred.

-----------------------------------------
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: "grapebaba" <281165273grape@...>
Sent by: fabric@...
Date: 05/01/2020 02:09AM
Subject: [EXTERNAL] [Hyperledger Fabric] How to recover when write set update statedb failed

Guys,

Recently we try to add RDB as a statedb in fabric. We refer the couchdb implementation, while we have a concern which after block written in ledger, the write set will update state db. However it is possible failed if the write set violate remote RDB constraint. It will cause Peer panic and I don’t see how to recover from this case. Can anyone give some suggestions?










Re: How to recover when write set update statedb failed

Gari Singh <garis@...>
 

What type of constraint are you violating?
If the peer considers that state update to be valid and it CANNOT write to the state database, it cannot proceed and therefore it panics as the goal is not to ever get into an inconsistent state during validation and commit.
There is/was an open item to modify this behavior such that the peer itself does not panic but rather the peer would only stop processing for the channel in which the error occurred.

-----------------------------------------
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: "grapebaba" <281165273grape@...>
Sent by: fabric@...
Date: 05/01/2020 02:09AM
Subject: [EXTERNAL] [Hyperledger Fabric] How to recover when write set update statedb failed

Guys,

Recently we try to add RDB as a statedb in fabric. We refer the couchdb implementation, while we have a concern which after block written in ledger, the write set will update state db. However it is possible failed if the write set violate remote RDB constraint. It will cause Peer panic and I don’t see how to recover from this case. Can anyone give some suggestions?


How to recover when write set update statedb failed

grapebaba
 

Guys,

Recently we try to add RDB as a statedb in fabric. We refer the couchdb implementation, while we have a concern which after block written in ledger, the write set will update state db. However it is possible failed if the write set violate remote RDB constraint. It will cause Peer panic and I don’t see how to recover from this case. Can anyone give some suggestions?


Hyperledger Fabric Documentation Workgroup call - Eastern hemisphere - Fri, 05/01/2020 #cal-notice

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

Hyperledger Fabric Documentation Workgroup call - Eastern hemisphere

When:
Friday, 1 May 2020
6:00am to 7:00am
(GMT+01:00) Europe/London

Where:
https://zoom.us/j/6223336701

Organizer:
a_o-dowd@... +441962816761

Description:
Documentation workgroup call.
Agenda, minutes and recordings: https://wiki.hyperledger.org/display/fabric/Documentation+Working+Group


hrshlbhgt@...
 

While executing a submitTransaction method i am getting an error like "2020-04-30T17:18:11.313Z - warn: [Transaction]: _validatePeerResponses: Received error response from peer: message=transaction returned with failure: Error: Expected 2 parameters, but 1 have been supplied, stack=Error: transaction returned with failure: Error: Expected 2 parameters, but 1 have been supplied"

Previously, I was getting a error like "No orderer was found", So I did some changes in my code. After connecting to the channel through the gateway, I used the object to fetch channel, All peers and orderer that is connected to "pharmachannel" but from the output, I only got all the peers but i haven't got any orderer back.

I have checked the orderer logs and I have found a failed RPC error connection.

So my question is

1.why orderer is not connected to my channel and why it is giving RPC error

2. I have successfully instantiated the chaincode but why I am getting an error from client SDK


hrshlbhgt@...
 

I am getting an error while invoking functions in smart contract

Could anyone let me know why i getting this silly error, I only have one argument in the function as argument looks like this "async  viewCompany(ctx, comanyCRN)"


Documentation Workgroup: Agenda for Friday, 1 May

Anthony O'Dowd <a_o-dowd@...>
 

Hi All,

We will hold the documentation workgroup call this Friday -- with both an Eastern hemisphere and Western hemisphere call. Please feel free to come along, you're always very welcome.

You can read about last week's call at https://wiki.hyperledger.org/display/fabric/2020+04+24+DWG+Agenda It included the now regular V2.x status update from Pam and Joe on new content.  Lots of updates on new features being worked including BFT ordering, Checkpointing and config library.  Another good discussion on LTS, led by Jim, as it relates to notification of architectural changes as well as product features. Pam and Jay Guo are continuing the discussion on adding extra languages, and we reviewed Nik's new create cannel tutorial -- which is rapidly becoming a great way to understand and practice this topic.  We didn't have time to review the internal documentation pages, but we'll discuss that this week.

You can catch up with the full recording and other sessions: https://wiki.hyperledger.org/display/fabric/Recordings

This week we have a great demo from Chris Gabriel on Fabric CA and Kubernetes.  See  https://wiki.hyperledger.org/display/fabric/2020+05+01+DWG+Agenda for this week's agenda.

Please feel free to contribute using the wiki, including helping to build next week's agenda: https://wiki.hyperledger.org/display/fabric/2020+05+08+DWG+Agenda

Thanks!

Pam, Anthony,  Joe, Nik

Meeting Details
-------------
Please use the following link to attend the meeting:  https://zoom.us/j/6223336701

The meeting times are as follows: https://wiki.hyperledger.org/display/fabric/Documentation+Working+Group

Meeting 126A: Friday 1 May
                   1130 India Standard Time
                   1400 China Standard Time
                   1500 Japan Standard Time
                   1700 Australia Eastern Time
                   1400 Singapore Time
                   1100 Gulf Standard Time
                   1000 Moscow Standard Time
                   0700 Greenwich Mean Time
                   0800 Central European Time    

Meeting 126B: Friday 1 May
              1100 Central Daylight Time
                   1200 Eastern Daylight Time
                   0900 Pacific Daylight Time
                   1400 Brasil Time (BRT)
                   1600 Greenwich Mean Time
                   1700 Central European Time
                   1800 Moscow Standard Time
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


Re: Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

Gari Singh <garis@...>
 

The system clocks across the system running the CA, the system running the fabric-ca-client and the system running the peer are skewed.
Are you using NTP to sync the times across the various machines?

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

-----fabric@... wrote: -----
To: Yacov Manevich <YACOVM@...>
From: "Mattia Bolzonella"
Sent by: fabric@...
Date: 04/30/2020 11:11AM
Cc: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

My system has the CEST time zone, so it's different from the UTC used in the peer

Il giorno gio 30 apr 2020 alle ore 17:07 Yacov Manevich <YACOVM@...> ha scritto:
is your system clock fine?



From: mattia.bolzonella@...
To: fabric@...
Date: 04/30/2020 05:27 PM
Subject: [EXTERNAL] [Hyperledger Fabric] Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions
Sent by: fabric@...



Hi, I'm having some troubles starting my fabric peer (version 2.0.1) here's the log:
```
UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid
```
The certificate is generated using `fabric-ca 1.4.6` and the expiring and validity date seem correct. So I cannot understand what is the real problem.
Any idea?






--

Mattia Bolzonella
Software Developer
mattia.bolzonella@...
Via G. Medici 9/a - 35138 Padova (PD)
+39 049 500 1 500 www.ifin.it



IFIN SISTEMI S.R.L. a socio unico
Via G. Medici 9/a
35138 Padova


Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari sopra indicati. La diffusione, la distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. 196/2003 e Regolamento UE 2016/679. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all'indirizzo e-mail del mittente. L’interessato può esercitare tutti i diritti previsti ai sensi degli articoli degli articoli 13, comma 2, lettere (b) e (d), 15-21 del Regolamento UE 2016/679, inviando un messaggio all'indirizzo e-mail del mittente o telefonando allo 049 500 1 500. Si prega di leggere Privacy Policy presente in https://ifin.it/privacy-policy-informativa-sui-cookies.


Re: Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

Mattia Bolzonella
 

My system has the CEST time zone, so it's different from the UTC used in the peer


Il giorno gio 30 apr 2020 alle ore 17:07 Yacov Manevich <YACOVM@...> ha scritto:
is your system clock fine?



From:        mattia.bolzonella@...
To:        fabric@...
Date:        04/30/2020 05:27 PM
Subject:        [EXTERNAL] [Hyperledger Fabric] Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions
Sent by:        fabric@...




Hi, I'm having some troubles starting my fabric peer (version 2.0.1) here's the log:
```
UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid
```
The certificate is generated using `fabric-ca 1.4.6` and the expiring and validity date seem correct. So I cannot understand what is the real problem.
Any idea?





--

Mattia Bolzonella

Software Developer

mattia.bolzonella@...

Via G. Medici 9/a - 35138 Padova (PD)

+39 049 500 1 500  www.ifin.it
      



IFIN SISTEMI S.R.L. a socio unico

Via G. Medici 9/a
35138 Padova 


Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari sopra indicati. La diffusione, la distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. 196/2003 e Regolamento UE 2016/679. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all'indirizzo e-mail del mittente. L’interessato può esercitare tutti i diritti previsti ai sensi degli articoli degli articoli 13, comma 2, lettere (b) e (d), 15-21 del Regolamento UE 2016/679, inviando un messaggio all'indirizzo e-mail del mittente o telefonando allo 049 500 1 500. Si prega di leggere Privacy Policy presente in https://ifin.it/privacy-policy-informativa-sui-cookies.


Re: Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

Yacov
 

is your system clock fine?



From:        mattia.bolzonella@...
To:        fabric@...
Date:        04/30/2020 05:27 PM
Subject:        [EXTERNAL] [Hyperledger Fabric] Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions
Sent by:        fabric@...




Hi, I'm having some troubles starting my fabric peer (version 2.0.1) here's the log:
```
UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid
```
The certificate is generated using `fabric-ca 1.4.6` and the expiring and validity date seem correct. So I cannot understand what is the real problem.
Any idea?




Re: Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

Mattia Bolzonella
 

Sure: here's the complete log, I think that it's the second certificate that is causing troubles (the peer certificate).

2020-04-30 14:33:47.647 UTC [bccsp] GetDefault -> DEBU 001 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2020-04-30 14:33:47.662 UTC [bccsp] GetDefault -> DEBU 002 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2020-04-30 14:33:47.665 UTC [bccsp_sw] openKeyStore -> DEBU 003 KeyStore opened at [/etc/hyperledger/fabric/msp/keystore]...done
2020-04-30 14:33:47.665 UTC [bccsp] initBCCSP -> DEBU 004 Initialize BCCSP [SW]
2020-04-30 14:33:47.665 UTC [msp] getPemMaterialFromDir -> DEBU 005 Reading directory /etc/hyperledger/fabric/msp/signcerts
2020-04-30 14:33:47.666 UTC [msp] getPemMaterialFromDir -> DEBU 006 Inspecting file /etc/hyperledger/fabric/msp/signcerts/cert.pem
2020-04-30 14:33:47.667 UTC [msp] getPemMaterialFromDir -> DEBU 007 Reading directory /etc/hyperledger/fabric/msp/cacerts
2020-04-30 14:33:47.667 UTC [msp] getPemMaterialFromDir -> DEBU 008 Inspecting file /etc/hyperledger/fabric/msp/cacerts/ca.pem
2020-04-30 14:33:47.667 UTC [msp] getPemMaterialFromDir -> DEBU 009 Reading directory /etc/hyperledger/fabric/msp/admincerts
2020-04-30 14:33:47.668 UTC [msp] getPemMaterialFromDir -> DEBU 00a Inspecting file /etc/hyperledger/fabric/msp/admincerts/Admin@...
2020-04-30 14:33:47.669 UTC [msp] getPemMaterialFromDir -> DEBU 00b Reading directory /etc/hyperledger/fabric/msp/intermediatecerts
2020-04-30 14:33:47.669 UTC [msp] getMspConfig -> DEBU 00c Intermediate certs folder not found at [/etc/hyperledger/fabric/msp/intermediatecerts]. Skipping. [stat /etc/hyperledger/fabric/msp/intermediatecerts: no such file or directory]
2020-04-30 14:33:47.669 UTC [msp] getPemMaterialFromDir -> DEBU 00d Reading directory /etc/hyperledger/fabric/msp/tlscacerts
2020-04-30 14:33:47.669 UTC [msp] getMspConfig -> DEBU 00e TLS CA certs folder not found at [/etc/hyperledger/fabric/msp/tlsintermediatecerts]. Skipping and ignoring TLS intermediate CA folder. [stat /etc/hyperledger/fabric/msp/tlscacerts: no such file or directory]
2020-04-30 14:33:47.669 UTC [msp] getPemMaterialFromDir -> DEBU 00f Reading directory /etc/hyperledger/fabric/msp/crls
2020-04-30 14:33:47.670 UTC [msp] getMspConfig -> DEBU 010 crls folder not found at [/etc/hyperledger/fabric/msp/crls]. Skipping. [stat /etc/hyperledger/fabric/msp/crls: no such file or directory]
2020-04-30 14:33:47.671 UTC [msp] getMspConfig -> DEBU 011 Loading NodeOUs
2020-04-30 14:33:47.673 UTC [msp] newBccspMsp -> DEBU 012 Creating BCCSP-based MSP instance
2020-04-30 14:33:47.673 UTC [msp] New -> DEBU 013 Creating Cache-MSP instance
2020-04-30 14:33:47.673 UTC [msp] loadLocaMSP -> DEBU 014 Created new local MSP
2020-04-30 14:33:47.673 UTC [msp] Setup -> DEBU 015 Setting up MSP instance IfinPeerMSP
2020-04-30 14:33:47.673 UTC [msp.identity] newIdentity -> DEBU 016 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICeDCCAh6gAwIBAgIJAIOHQSyQL76sMAoGCCqGSM49BAMCMFUxCzAJBgNVBAYT
AklUMQ8wDQYDVQQIDAZJVEFMSUExGDAWBgNVBAoMD3RydXN0ZWRjaGFpbi5pdDEb
MBkGA1UEAwwSY2EudHJ1c3RlZGNoYWluLml0MB4XDTIwMDQzMDEwMzYwNFoXDTMw
MDQyODEwMzYwNFowVTELMAkGA1UEBhMCSVQxDzANBgNVBAgMBklUQUxJQTEYMBYG
A1UECgwPdHJ1c3RlZGNoYWluLml0MRswGQYDVQQDDBJjYS50cnVzdGVkY2hhaW4u
aXQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQLrlHOhrAQJg1ZaBRMrN2EtElQ
Q/kvSfAu9ra8ueMVtEy9HCKsCsN21SKM4s7gRG9wtQbQyoLnG8cqiOZd0PQpo4HW
MIHTMG8GA1UdIwRoMGahWaRXMFUxCzAJBgNVBAYTAklUMQ8wDQYDVQQIDAZJVEFM
SUExGDAWBgNVBAoMD3RydXN0ZWRjaGFpbi5pdDEbMBkGA1UEAwwSY2EudHJ1c3Rl
ZGNoYWluLml0ggkAg4dBLJAvvqwwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8B
Af8EBAMCAQYwHQYDVR0OBBYEFBtb6+7I0Gt1xffBsfR+J2fLmLa3MB0GA1UdEQQW
MBSCEmNhLnRydXN0ZWRjaGFpbi5pdDAKBggqhkjOPQQDAgNIADBFAiBuIhKPlBIf
8UDJaQ7TMCszily6ykZtExZyVSwuKb8AhAIhANbxlIhHABNN42Y57+Vm83CL3O8l
XoMA1S+MbeepIvON
-----END CERTIFICATE-----
2020-04-30 14:33:47.673 UTC [msp.identity] newIdentity -> DEBU 017 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICqjCCAlCgAwIBAgIUEoMnlJHanghqNgVw29nF/Ge2GDMwCgYIKoZIzj0EAwIw
VTELMAkGA1UEBhMCSVQxDzANBgNVBAgMBklUQUxJQTEYMBYGA1UECgwPdHJ1c3Rl
ZGNoYWluLml0MRswGQYDVQQDDBJjYS50cnVzdGVkY2hhaW4uaXQwHhcNMjAwNDMw
MTAzMjAwWhcNMjEwNDMwMTAzNzAwWjBnMQswCQYDVQQGEwJJVDEPMA0GA1UECBMG
SVRBTElBMRgwFgYDVQQKEw90cnVzdGVkY2hhaW4uaXQxDTALBgNVBAsTBHBlZXIx
HjAcBgNVBAMTFXBlZXIwLnRydXN0ZWRjaGFpbi5pdDBZMBMGByqGSM49AgEGCCqG
SM49AwEHA0IABKC1bFjSy7rUl+0+3ry2lDFU/o8egd0IcUtiEWKnopYl7KvT8+B5
aEeOwj0YMZOsDdadIf2CYm21Bvvcipb9IPCjgeswgegwDgYDVR0PAQH/BAQDAgeA
MAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFDIBH1UBhlt0tdV/SwkdGUujvtubMB8G
A1UdIwQYMBaAFBtb6+7I0Gt1xffBsfR+J2fLmLa3MCAGA1UdEQQZMBeCFXBlZXIw
LnRydXN0ZWRjaGFpbi5pdDBmBggqAwQFBgcIAQRaeyJhdHRycyI6eyJoZi5BZmZp
bGlhdGlvbiI6IiIsImhmLkVucm9sbG1lbnRJRCI6InBlZXIwLnRydXN0ZWRjaGFp
bi5pdCIsImhmLlR5cGUiOiJwZWVyIn19MAoGCCqGSM49BAMCA0gAMEUCIQCt1qvM
oa2NPtZ8y9RtRZWZknxD3oWrT2zqG6JTQ1INlAIgATTwQAYxQtw3YvA4xVUpjKa4
1SB8GmzG00xxQ5ypFkE=
-----END CERTIFICATE-----
2020-04-30 14:33:47.673 UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid



maybe the CA certificate expired?




From:        mattia.bolzonella@...
To:        fabric@...
Date:        04/30/2020 05:27 PM
Subject:        [EXTERNAL] [Hyperledger Fabric] Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions
Sent by:        fabric@...




Hi, I'm having some troubles starting my fabric peer (version 2.0.1) here's the log:
```
UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid
```
The certificate is generated using `fabric-ca 1.4.6` and the expiring and validity date seem correct. So I cannot understand what is the real problem.
Any idea?





--

Mattia Bolzonella

Software Developer

mattia.bolzonella@...

Via G. Medici 9/a - 35138 Padova (PD)

+39 049 500 1 500  www.ifin.it
      



IFIN SISTEMI S.R.L. a socio unico

Via G. Medici 9/a
35138 Padova 


Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari sopra indicati. La diffusione, la distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. 196/2003 e Regolamento UE 2016/679. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all'indirizzo e-mail del mittente. L’interessato può esercitare tutti i diritti previsti ai sensi degli articoli degli articoli 13, comma 2, lettere (b) e (d), 15-21 del Regolamento UE 2016/679, inviando un messaggio all'indirizzo e-mail del mittente o telefonando allo 049 500 1 500. Si prega di leggere Privacy Policy presente in https://ifin.it/privacy-policy-informativa-sui-cookies.


Re: Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

Yacov
 

can you show the certificate?



From:        mattia.bolzonella@...
To:        fabric@...
Date:        04/30/2020 05:27 PM
Subject:        [EXTERNAL] [Hyperledger Fabric] Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions
Sent by:        fabric@...




Hi, I'm having some troubles starting my fabric peer (version 2.0.1) here's the log:
```
UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid
```
The certificate is generated using `fabric-ca 1.4.6` and the expiring and validity date seem correct. So I cannot understand what is the real problem.
Any idea?




Cannot start peer due to "certificate has expired or is not yet valid" but it's not #fabric #fabric-questions

Mattia Bolzonella
 

Hi, I'm having some troubles starting my fabric peer (version 2.0.1) here's the log:
```
UTC [main] InitCmd -> ERRO 018 Cannot run peer because error when setting up MSP of type bccsp from directory /etc/hyperledger/fabric/msp: the supplied identity is not valid: x509: certificate has expired or is not yet valid
```
The certificate is generated using `fabric-ca 1.4.6` and the expiring and validity date seem correct. So I cannot understand what is the real problem.
Any idea?


Upcoming Event: Hyperledger Fabric Documentation Workgroup call - Eastern hemisphere - Fri, 05/01/2020 6:00am-7:00am #cal-reminder

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

Reminder: Hyperledger Fabric Documentation Workgroup call - Eastern hemisphere

When: Friday, 1 May 2020, 6:00am to 7:00am, (GMT+01:00) Europe/London

Where:https://zoom.us/j/6223336701

View Event

Organizer: Anthony O'Dowd a_o-dowd@... +441962816761

Description: Documentation workgroup call.
Agenda, minutes and recordings: https://wiki.hyperledger.org/display/fabric/Documentation+Working+Group


Error While Upgrading Network (Edit Channel ACLs) #hyperledger-fabric #fabric

Faisal
 

Hi Everyone,

I was attempting to upgrade the network from 1.4.2 --> 2.0. I have completed all steps except the step where one has to Edit the Channel ACLs. The error and details are given below can anyone please provide an insight on it?

Secondly the documentation states that it is an Optional step, if I skip this step would it effect any operations of the network and what functionalities might not be available as a result of it?

Environment

HLF (1.4.2)  --> 2.0
2 Orgs

Step: Edit Channel ACLs (Optional)
Doc_Link

Delta-Set JSON

{
"payload": {
"header": {
"channel_header": {
"channel_id": "mychannel",
"type": 2
}
},
"data": {
"config_update": {
"channel_id": "mychannel",
"isolated_data": {},
"read_set": {
"groups": {
"Application": {
"groups": {
"ORG2MSP": {
"groups": {},
"mod_policy": "",
"policies": {},
"values": {},
"version": "2"
},
"ORG1MSP": {
"groups": {},
"mod_policy": "",
"policies": {},
"values": {},
"version": "2"
}
},
"mod_policy": "",
"policies": {
"Admins": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"Endorsement": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"LifecycleEndorsement": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"Readers": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"Writers": {
"mod_policy": "",
"policy": null,
"version": "0"
}
},
"values": {
"Capabilities": {
"mod_policy": "",
"value": null,
"version": "1"
}
},
"version": "2"
}
},
"mod_policy": "",
"policies": {},
"values": {},
"version": "0"
},
"write_set": {
"groups": {
"Application": {
"groups": {
"ORG2MSP": {
"groups": {},
"mod_policy": "",
"policies": {},
"values": {},
"version": "2"
},
"ORG1MSP": {
"groups": {},
"mod_policy": "",
"policies": {},
"values": {},
"version": "2"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"Endorsement": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"LifecycleEndorsement": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"Readers": {
"mod_policy": "",
"policy": null,
"version": "0"
},
"Writers": {
"mod_policy": "",
"policy": null,
"version": "0"
}
},
"values": {
"ACLs": {
"mod_policy": "",
"value": {
"acls": {
"_lifecycle/CheckCommitReadiness": {
"policy_ref": "/Channel/Application/Writers"
},
"_lifecycle/CommitChaincodeDefinition": {
"policy_ref": "/Channel/Application/Writers"
},
"_lifecycle/QueryChaincodeDefinition": {
"policy_ref": "/Channel/Application/Readers"
},
"_lifecycle/QueryChaincodeDefinitions": {
"policy_ref": "/Channel/Application/Readers"
}
}
},
"version": "0"
},
"Capabilities": {
"mod_policy": "",
"value": null,
"version": "1"
}
},
"version": "3"
}
},
"mod_policy": "",
"policies": {},
"values": {},
"version": "0"
}
}
}
}
}


Error MSG While Applying Update:

2020-04-29 22:17:09.543 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating DeltaSet: invalid mod_policy for element [Value] /Channel/Application/ACLs: mod_policy not set



 


Re: How to share an Asset that belongs to UserA in Org1 to UserB of Org2 instaed of asset transfer in Hyperledger fabric v1.4 ? #fabric-chaincode #couchdb #fabric-questions #hyperledger-fabric

David Enyeart
 

Private data collections define which organization's peers are authorized to receive and store the private data. This is orthogonal to user based access control. You need to consider both aspects.

So the questions to ask yourself are:
1) Do you want Org 2 peers to have the private data? This implies that Org 2 is in control of which users they share the private data with. If you want to go down this path, look into per-organization collections where Org 1 creates a copy of the private data in an Org 2 private data collection. As part of this, Org 2 peer's chaincode can validate the private data against the prior on-chain hashes.
2) Or do you want to keep the private data on Org 1 peers only and simply allow Org 2 users query the Org 1 peer? In this case add access control logic, either in an application layer on top of the Org 1 peer, or in the chaincode itself. For example you could maintain an access control list per private key on the ledger itself (either public state or in a Org1 collection), such that chaincode checks the private key's ACL against the client certificate before returning the private data to them.

If you want sharing for a limited time, you'd have to go with the latter approach. Once private data is shared with another organization's peer, there is really no 'unsharing' it. Even if you use the blockToLive collection property, the Org 2 admin could make a copy of the peer that doesn't process blocks, thereby preserving the access forever.

Hopefully you have found the documentation topic which mentions these patterns (beyond just asset transfer scenarios):
https://hyperledger-fabric.readthedocs.io/en/latest/private-data/private-data.html#private-data-sharing-patterns


Dave Enyeart

praviteja---04/29/2020 10:55:21 AM---There are two organizations A and B. *User1* in *Org1* has a document *Doc1* in his private data sto

From: praviteja@...
To: fabric@...
Date: 04/29/2020 10:55 AM
Subject: [EXTERNAL] [Hyperledger Fabric] How to share an Asset that belongs to UserA in Org1 to UserB of Org2 instaed of asset transfer in Hyperledger fabric v1.4 ? #fabric-chaincode #couchdb #fabric-questions #hyperledger-fabric
Sent by: fabric@...





There are two organizations A and B. User1 in Org1 has a document Doc1 in his private data store and he wants to share it with User2 of Org2 for a limited time like 3 days, the document shared should expire after this time keeping the original with User A.

From the literature of Hyperledger fabric I have been through, everything is explained about asset transfer. But I want to keep the hold of the asset at point A and give temporary access to other users in different organizations.

Any suggestions on how to achieve this in fabric infrastructure.





How to share an Asset that belongs to UserA in Org1 to UserB of Org2 instaed of asset transfer in Hyperledger fabric v1.4 ? #fabric-chaincode #couchdb #fabric-questions #hyperledger-fabric

praviteja@...
 

There are two organizations A and B. User1 in Org1 has a document Doc1 in his private data store and he wants to share it with User2 of Org2 for a limited time like 3 days, the document shared should expire after this time keeping the original with User A.
 
From the literature of Hyperledger fabric I have been through, everything is explained about asset transfer. But I want to keep the hold of the asset at point A and give temporary access to other users in different organizations. 
 
Any suggestions on how to achieve this in fabric infrastructure.  
 


Tutorial: Deploy a Hyperledger Fabric v2 Web App Using the Node.js SDK

evkonst@...
 

Check out this tutorial on building a web app for HLF v2 with Fabric Node SDK:

Deploy a Hyperledger Fabric v2 Web App Using the Node.js SDK
https://chainstack.com/deploy-a-hyperledger-fabric-v2-web-app-using-sdk-for-node-js/

--
Ake


Re: [EXTERNAL] Re: [Hyperledger Fabric] Doubt on how to GetTransactionByID using hypedledger. (Google didn't help!)

Senthil Nathan
 

Hi Ameya,

    We can query QSCC chaincode using peer CLI with an appropriate block API as the argument. In this blog article http://www.bchainledger.com/2018/03/system-chaincodes-in-hyperledger-fabric.html you can find an example of peer CLI that invokes QSCC system chaincode to retrieve block 3 (use GetTransactionByTxID instead of GetBlockByNumber). Though the command was tested only with v1.1, I hope this would work in v2.0 with no or minor tweaking.


Regards,
Senthil


On Mon, Apr 27, 2020 at 7:11 PM Ameya Sinha <t-amsi@...> wrote:

Hi Senthil,

 

Thanks for explaining what system chaincodes are and why I can’t invoke them from a user chaincode.

 

I’m still confused about how should I invoke a method like GetTransactionByID using a peer cli. Suppose I set up the BYFN and after I’m in the container with address set as peer0.org1 what should I exactly do to call this method?

 

Thanks,

Ameya Sinha.

 

From: Senthilnathan N <cendhu@...>
Sent: Monday, April 27, 2020 11:31 AM
To: Ameya Sinha <t-amsi@...>
Cc: hyperledger-fabric <hyperledger-fabric@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Doubt on how to GetTransactionByID using hypedledger. (Google didn't help!)

 

Hi Ameya,

 

What is a system chaincode? Is it already present when we spin up a network or a channel or do we need to install it separately.

 

System chaincodes are built into the peer executables. Please refer to following links for more information on inbuilt system chaincodes

  1. https://hyperledger-fabric.readthedocs.io/en/latest/smartcontract/smartcontract.html#system-chaincode 
  2. http://www.bchainledger.com/2018/03/system-chaincodes-in-hyperledger-fabric.html

These chaincodes are not associated with any channels.

 

How to use this chaincode to GetTransactionByID? Can anyone give me some sample code through which I can call this chaincode from mychannel.

 

Since v2.0, system chaincodes can be invoked only from client SDK or peer CLI and a user chaincode cannot invoke a system chaincode. The reason for not allowing a user chaincode to invoke a system chaincode can be found in https://jira.hyperledger.org/browse/FAB-15285 and https://github.com/hyperledger/fabric/commit/804852ae25ac438c17cc77b08119944d84ac336b 

 

Regards,

Senthil

 

On Mon, Apr 27, 2020 at 10:28 AM Ameya Sinha via lists.hyperledger.org <t-amsi=microsoft.com@...> wrote:

Hi Everyone,

 

              So I was following the Chaincode for Developers tutorial and have successfully managed to now install my own chaincode on the mychannel of BYFN. However after making some transactions, I want to do two things.

 

1.       See the History for a particular key.

2.       See the transactions that are made by a particular transaction id.

 

I was able to do #1 from here. Now to do #2 after a bit of googling, I found myself here (https://github.com/hyperledger/fabric/tree/master/core/scc/qscc). I have many questions about this.

 

1.       What is a system chaincode? Is it already present when we spin up a network or a channel or do we need to install it separately.

2.       How to use this chaincode to GetTransactionByID? Can anyone give me some sample code through which I can call this chaincode from mychannel.

 

The internet was not really helpful in answering these questions. That’s why I turned to the community.

 

Thanks and Regards,

Ameya Sinha.

3381 - 3400 of 11527