Re: Is it efficient when "Upgrade Chaincode New Docker Container will be created"?
Brett T Logan <brett.t.logan@...>
In 2.0 Fabric we added logic to remove unreferenced chaincode containers, so once your old version is no longer used anywhere it would be cleaned up. We also introduced a new chaincode builder and launcher model in 2.0, this empowers developers and admins to run chaincode however they see fit, including totally devoid of Docker, take a look at it here: https://hyperledger-fabric.readthedocs.io/en/master/cc_launcher.html
----- Original message -----
|
|
Is it efficient when "Upgrade Chaincode New Docker Container will be created"?
Kimheng SOK
Dear all, I would like to ask about hyperledger performance related to chaincode upgrade. Each time when we upgrade the new chaincode, a new docker container will be created. Do you think this is an optimal way to go? Will hyperledger continue to adopt this concept, or may be modified to other solutions? If YES why and if NO what is the alternative solution in mind? Bests,
|
|
Re: chaincode 2.0 problems
David Enyeart
This is not an issue with the submitting client credentials, it is an issue with the peer credentials not matching the org credentials in the channel config. Hi all, I am facing the same problem as Tong Li mentioned in the first email. After successful installation of CC package on peers, the documents and other samples, get approval with in their org before committing the chaincode. But for me I can not get the installed package approved from the org. It says, ` txid [f2d81371e4b62a37c32de0506643629cafaa4d7d4b73c4012bf7b24c3251cbf7] committed with status (ENDORSEMENT_POLICY_FAILURE) at Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)` The LifeCycle endorsement policy says, org1MSP.peer. So, when I use peer's msp instead of org admin, it says, ` Error: proposal failed with status: 500 - Failed to authorize invocation due to failed ACL check: Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]` I tried it on both peers of og org1. Getting endorsement policy failure from both. Or should I commit the package before getting approval? Thank you! BR, Indirajith. On Fri, 10 Jan 2020 at 05:05, Jay Guo <guojiannan1101@...> wrote:
> You tried to approve the same definition twice, completely unmodified. This produced an empty write-set, because nothing changed. Since there was no change to a specific collection, but because we had to pick _some_ endorsement policy to validate your tx with, you get the default for `_lifecycle`. opened FAB-17371 for this - J
On Fri, Jan 10, 2020 at 1:02 AM Jay Guo via Lists.Hyperledger.Org <guojiannan1101=gmail.com@...> wrote:
I'm using byfn w/o any modification - J On Thu, Jan 9, 2020 at 9:25 PM <email4tong@...> wrote:
On Thursday, January 9, 2020, 4:47 AM, Jay Guo <guojiannan1101@...> wrote:
- J On Thu, Jan 9, 2020 at 12:46 AM Tong Li <litong01@...> wrote: Thanks David and Nikhil for your response. I took David's suggestion and sent to multiple peers for commit which went through successfully. Then I tried the lifecycle chaincode approveformyorg command and lifecycle chaincode install few more times, here is what I found. 1. Chaincode can be installed multiple times, if the chaincode package never changes, the returned package id will be the same. No errors. 2. Command chaincode lifecycle approveformyorg behaves like this (at least from what I can figure): a.) one peer in the org can only approve the chaincode one time b.) the other peer in the org can also approve the chaincode but the sequence number has to increase by 1, this is after chaincode has been committed. c.) once the chaincode gets approved by a peer, that peer can not approve it the 2nd time. If you try the 2nd time, it will give you the same error like below: 2020-01-08 16:31:53.754 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [af84dab09c428471a87aad3e9f921b8f876ecdc69b6b0b05fdf42d621cd3e31a] committed with status (ENDORSEMENT_POLICY_FAILURE) at Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE) The behavior at 2 is a bit different from what David suggested earlier, I wonder if I misunderstood David's point. My endorsement policy is using the Majority. Thanks so much for your response. Tong Li IBM Open Technology From: "Nikhil Gupta" <negupta@...> To: "David Enyeart" <enyeart@...> Cc: "Tong Li" <litong01@...>, fabric@... Date: 01/08/2020 08:53 AM Subject: [EXTERNAL] Re: [Hyperledger Fabric] chaincode 2.0 problems Sent by: fabric@... The approval is at the Org level. You only need to target one peer, and then the approval is distributed to other peers using gossip. The endorsement error also pops up if you try to commit a different chaincode definition than the one that was approved. -----fabric@... wrote: ----- To: "Tong Li" <litong01@...> From: "David Enyeart" Sent by: fabric@... Date: 01/08/2020 12:28AM Cc: fabric@... Subject: [EXTERNAL] Re: [Hyperledger Fabric] chaincode 2.0 problems 1. You should be able to re-approveformyorg on the same peer, and the other peer (although it only needs to be done on one peer per org). I've tried this and it works in my environment... I can't think of a reason why you'd get ENDORSEMENT_POLICY_FAILURE on subsequent trials, as the approveformyorg transaction only requires endorsement on the org's own peer. See if you can re-approveformyorg on the same peer as before, just to help narrow down the problem... Have been trying to use the new peer lifecycle command to approve and eventually commit the chaincode but I have found two problems. 1. with 2 orgs and total of 4 peers, I can only do approveformyorg exactly two approvals. Once I have two approvals, see below output from checkcommitreadiness { "approvals": { "org0examplecom": true, "org1examplecom": true } } That shows that I have two approvals from two different orgs. Then I tried to use two other peers to do the approval, when I tried that, I got an error below. peer lifecycle chaincode approveformyorg --channelID mychannel --name simple2 --version 1.0 --package-id simple2_1.0:46b05e58222be471f9c305ad2ca3374e25343076502adcc82159865986dc3288 --init-required --sequence 1 --tls true --cafile $ORDERER_TLS_CA 2020-01-08 04:04:50.026 UTC [cli.lifecycle.chaincode] setOrdererClient -> INFO 001 Retrieved channel (mychannel) orderer endpoint: orderer1.example.com:7050 2020-01-08 04:04:52.130 UTC [chaincodeCmd] ClientWait -> INFO 002 txid [2fb5dafa70316b2d69a736ab8a1be399668f724646e66241ab4c2ce28f873c80] committed with status (ENDORSEMENT_POLICY_FAILURE) at Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE) Though I already have two approvals, I expect more approval from different peers wont fail, but it did, I do not know if that is expected behavior, please someone confirm one way or the other. 2. With two approvals from both orgs, I should have already met the majority requirement, but when I tried to do the commit, I was getting the exact same error as the approveformyorg process. Can someone please help with this problem? Please see the configtx.yaml file below if that can give a bit of clue. Thanks very much. --- Organizations: - &examplecom Name: examplecom ID: examplecom MSPDir: keyfiles/ordererOrganizations/example.com/msp Policies: Readers: Type: Signature Rule: "OR('examplecom.member')" Writers: Type: Signature Rule: "OR('examplecom.member')" Admins: Type: Signature Rule: "OR('examplecom.admin')" - &org0examplecom Name: org0examplecom ID: org0examplecom MSPDir: keyfiles/peerOrganizations/org0.example.com/msp Policies: Readers: Type: Signature Rule: "OR('org0examplecom.admin', 'org0examplecom.peer', 'org0examplecom.client')" Writers: Type: Signature Rule: "OR('org0examplecom.admin', 'org0examplecom.client')" Admins: Type: Signature Rule: "OR('org0examplecom.admin')" Endorsement: Type: Signature Rule: "OR('org0examplecom.peer')" AnchorPeers: - Host: peer1.org0.example.com Port: 7051 - Host: peer2.org0.example.com Port: 7051 - &org1examplecom Name: org1examplecom ID: org1examplecom MSPDir: keyfiles/peerOrganizations/org1.example.com/msp Policies: Readers: Type: Signature Rule: "OR('org1examplecom.admin', 'org1examplecom.peer', 'org1examplecom.client')" Writers: Type: Signature Rule: "OR('org1examplecom.admin', 'org1examplecom.client')" Admins: Type: Signature Rule: "OR('org1examplecom.admin')" Endorsement: Type: Signature Rule: "OR('org1examplecom.peer')" AnchorPeers: - Host: peer1.org1.example.com Port: 7051 - Host: peer2.org1.example.com Port: 7051 Capabilities: Channel: &ChannelCapabilities V2_0: true Orderer: &OrdererCapabilities V2_0: true Application: &ApplicationCapabilities V2_0: true Application: &ApplicationDefaults Organizations: Policies: Readers: Type: ImplicitMeta Rule: "ANY Readers" Writers: Type: ImplicitMeta Rule: "ANY Writers" Admins: Type: ImplicitMeta Rule: "MAJORITY Admins" LifecycleEndorsement: Type: ImplicitMeta Rule: "MAJORITY Endorsement" Endorsement: Type: ImplicitMeta Rule: "MAJORITY Endorsement" Capabilities: <<: *ApplicationCapabilities Orderer: &OrdererDefaults OrdererType: etcdraft Addresses: - orderer1.example.com:7050 - orderer2.example.com:7050 - orderer3.example.com:7050 BatchTimeout: 2s BatchSize: MaxMessageCount: 10 AbsoluteMaxBytes: 99 MB PreferredMaxBytes: 512 KB EtcdRaft: Consenters: - Host: orderer1.example.com Port: 7050 ClientTLSCert: keyfiles/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/server.crt ServerTLSCert: keyfiles/ordererOrganizations/example.com/orderers/orderer1.example.com/tls/server.crt - Host: orderer2.example.com Port: 7050 ClientTLSCert: keyfiles/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt ServerTLSCert: keyfiles/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt - Host: orderer3.example.com Port: 7050 ClientTLSCert: keyfiles/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt ServerTLSCert: keyfiles/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt Organizations: Policies: Readers: Type: ImplicitMeta Rule: "ANY Readers" Writers: Type: ImplicitMeta Rule: "ANY Writers" Admins: Type: ImplicitMeta Rule: "MAJORITY Admins" BlockValidation: Type: ImplicitMeta Rule: "ANY Writers" Channel: &ChannelDefaults Policies: Readers: Type: ImplicitMeta Rule: "ANY Readers" Writers: Type: ImplicitMeta Rule: "ANY Writers" Admins: Type: ImplicitMeta Rule: "MAJORITY Admins" Capabilities: <<: *ChannelCapabilities Profiles: OrgChannel: Consortium: SampleConsortium <<: *ChannelDefaults Application: <<: *ApplicationDefaults Organizations: - *org0examplecom - *org1examplecom Capabilities: <<: *ApplicationCapabilities OrdererGenesis: <<: *ChannelDefaults Capabilities: <<: *ChannelCapabilities Orderer: <<: *OrdererDefaults Organizations: - *examplecom Capabilities: <<: *OrdererCapabilities Application: <<: *ApplicationDefaults Organizations: - <<: *examplecom Consortiums: SampleConsortium: Organizations: - *org0examplecom - *org1examplecom Tong Li IBM Open Technology
|
|
Re: chaincode 2.0 problems
indirajith
Hi all, I am facing the same problem as Tong Li mentioned in the first email. After successful installation of CC package on peers, the documents and other samples, get approval with in their org before committing the chaincode. But for me I can not get the installed package approved from the org. It says, ` txid [f2d81371e4b62a37c32de0506643629cafaa4d7d4b73c4012bf7b24c3251cbf7] committed with status (ENDORSEMENT_POLICY_FAILURE) at Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)` The LifeCycle endorsement policy says, org1MSP.peer. So, when I use peer's msp instead of org admin, it says, ` Error: proposal failed with status: 500 - Failed to authorize invocation due to failed ACL check: Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]` I tried it on both peers of og org1. Getting endorsement policy failure from both. Or should I commit the package before getting approval? Thank you! BR, Indirajith.
On Fri, 10 Jan 2020 at 05:05, Jay Guo <guojiannan1101@...> wrote:
|
|
Re: Why does the Ordering Consensus Work?
Gari Singh <garis@...>
Transaction consensus and validity in Fabric is not the same thing as the consensus mechanism used to build a fault tolerant ordering service.
Have a look at https://hyperledger-fabric.readthedocs.io/en/release-2.0/txflow.html which describes the entire Fabric transaction flow ... this would be considered consensus for Fabric transactions. At a high-level, it is comprised of: - execute chaincode and collect endorsements - submit for ordering - ordering service orders and batches into blocks - ordering service pushes blocks to peers on a per channel basis - peers validate and commit transactions - check that endorsement policy has been satisfied (which means that enough peers executed chaincode with the same results based on policy) - check for collisions using an MVCC-like model (aka double-spend) - if valid, update state The ordering service itself uses a consensus algorithm itself to make sure that all ordering nodes produce batches/blocks with the same transactions in the same order. ----------------------------------------- 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: "Trevor Lee Oakley" Sent by: fabric@... Date: 02/06/2020 03:30AM Subject: [EXTERNAL] [Hyperledger Fabric] Why does the Ordering Consensus Work? From what I know, the orderer is just assembling blocks from application transactions composed of the endorser responses to proposals. Then sending the blocks to committing peers. How is that a consensus process? Surely we have to somehow compare the outcomes of the smart contracts and check that they all agree? Is that done in validation somehow? Trevor
|
|
Re: Why does the Ordering Consensus Work?
Brett T Logan <brett.t.logan@...>
The ordering services job is to assemble blocks from transactions and determine the final order of the transactions. It doesn't participate in the validation of the endorsed transactions.
Once the orderer disseminates the block to the peer, the peer validates the signatures, verifies that its endorsements match their expected origin, and that the state of the transaction matches the current state given the current values in the ledger (the state of a key hasn't changed since the proposal was submitted for endorsement as the result of an in-flight transaction).
Your transaction has (assuming it was valid) already passed your endorsement policy, the result of the smart contracts doesn't have to match for all proposals. This is why we write deterministic chaincode, to prevent chaincode from arriving at different results.
----- Original message -----
|
|
Why does the Ordering Consensus Work?
Trevor Lee Oakley <trevor@...>
From what I know, the orderer is just assembling blocks from application transactions composed of the endorser responses to proposals. Then sending the blocks to committing peers. How is that a consensus process?
Surely we have to somehow compare the outcomes of the smart contracts and check that they all agree? Is that done in validation somehow?
Trevor
|
|
Registrar enrollment and registration
#fabric-sdk-go
Amal C Saji
Hi,
I am using the example https://github.com/chainHero/heroes-service/ with fabric-sdk-go beta version. When I try to register a new user, registrar part have same issues. I can't register a registrar. The post request return some errors "Client sent an HTTP request to an HTTPS server. : invalid character 'C' looking for beginning of value"
|
|
Fabric contributor meeting - February 5th 14:00 GMT
David Enyeart
For the contributor meeting scheduled for tomorrow, we'll do a quick project update, but there are no deep dive topics scheduled yet. If you have a proposal or other topic you'd like to discuss, please let us know here or on RocketChat fabric-maintainers.
|
|
Re: Error when joining the channel
Nikhil Gupta
Hi Marina, I would check the order log to see what the problems are. You can find some help with what to look for with this stack overflow post: https://stackoverflow.com/questions/57662562/when-i-try-to-create-a-channel-using-hyperledger-fabric-the-request-fails/57662645#57662645 My guess is that your org does not have permission to create a channel in the orderer system channel. or is not a member of the system channel consortium. -----fabric@... wrote: ----- To: "hyperledger-fabric@..." <hyperledger-fabric@...> From: "Marina Wanis" Sent by: fabric@... Date: 02/01/2020 04:37AM Subject: [EXTERNAL] [Hyperledger Fabric] Error when joining the channel Hi,
I used to be able to create the channel using the channel transaction and join the channel with the command : peer channel join -o localhost:7050 -b ./acmechannel.block
I got the following error:
2020-02-01 09:24:48.338 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized Error: proposal failed (err: rpc error: code = Unknown desc = access denied: channel [] creator org [Org1MSP])
I made sure that the identity of the peer is admin. I’m really not sure why I keep getting this error. Thank you, Marina
Sent from Mail for Windows 10
|
|
Re: How to set regulator or auditor in private data collection
David Enyeart
In v2.0 we are promoting this pattern of org-specific collections, where the per organization collections implicitly exist so that you don't have to define them at all. Thank you for your explanation. I now understand it clearly. But this would cost huge efforts to maintain private data collections in production environment if there are hundreds of private data collections. How about pre-define a regulator or auditor, the private data collection will include this pre-defined regulator or auditor in the collection configuration period. So we don’t need to define every private data collection to include it. It will be automatically included in every private data collection. That would be more simple and useful for massive private data collection configuration in production environment.
A regulator or auditor would be modeled as any other organization. Hi All, The fabric doc said: “Fabric v2.0 also enables new patterns for working with and sharing private data, without the requirement of creating private data collections for all combinations of channel members that may want to transact. Specifically, instead of sharing private data within a collection of multiple members, you may want to share private data across collections, where each collection may include a single organization, or perhaps a single organization along with a regulator or auditor”. I wonder how to set regulator or auditor along with a single organization when using private data in Fabric 2.0? Is there any sample to tell how to do this?
|
|
Re: How to set regulator or auditor in private data collection
胡 银松
Thank you for your explanation. I now understand it clearly.
toggle quoted messageShow quoted text
But this would cost huge efforts to maintain private data collections in production environment if there are hundreds of private data collections.
How about pre-define a regulator or auditor, the private data collection will include this pre-defined regulator or auditor in the collection configuration period. So we don’t need to define every private data collection to include it. It will
be automatically included in every private data collection. That would be more simple and useful for massive private data collection configuration in production environment.
|
|
Re: Potential project in need of BFT orderers
#consensus
#fabric-orderer
Brian Behlendorf <bbehlendorf@...>
Excellent, thanks! I should have piped
up on this earlier when I saw the call for mass-closure of old
issues.
Brian
On 2/3/20 10:18 PM, David Enyeart
wrote:
-- Brian Behlendorf Executive Director, Hyperledger bbehlendorf@... Twitter: @brianbehlendorf
|
|
Re: Potential project in need of BFT orderers
#consensus
#fabric-orderer
David Enyeart
To clarify, as Jason mentioned the Jira FAB-33 got caught up in a recent mass cleanup of stale issues that hadn't been touched in a long time. Any issue that was automatically closed in error can be re-opened, we simply ask that a comment be added to explain the rationale for re-opening. I've re-opened FAB-33 and commented that it is targeted for a future release. You really should use a different status for deferred feature requests than "Closed", because "decided not to implement this ever" is a closer inference from "Closed" than "maybe someday". Jira is depended upon as a future-feature-request tool by lots of other projects and asking people to know it's differently treated at Fabric is another cognitive burden to new contributors. At the very least I suggest updating FAB-33 with a link to new work. Brian On 2/3/20 7:44 AM, Jason Yellick wrote:
FAB-33 was closed along with hundreds of other items in an overall cleanup of JIRA. Its closure does not indicate any mothballing or abandonment of BFT efforts, in fact, there's been considerably more activity in the space in the recent months; particularly there are some ongoing efforts to develop a golang BFT consensus library that is compatible with Fabric. JIRA can be a good tool for tracking the progress of a designed, approved, and mid-implementation item, but it's the wrong place to look for future work. Future work is to be submitted and approved as an RFC https://github.com/hyperledger/fabric-rfcs/ so I would watch that space for updates. Thanks, ~Jason
----- Original message -----
From: atom@... Sent by: fabric@... To: fabric@... Cc: Subject: [EXTERNAL] [Hyperledger Fabric] Potential project in need of BFT orderers #consensus #fabric-orderer Date: Sun, Feb 2, 2020 6:16 PM We are leading a standardization effort within SunSpec.org to utilize blockchain for securing the distributed power grid in the US. --
|
|
Re: How to set regulator or auditor in private data collection
David Enyeart
A regulator or auditor would be modeled as any other organization. Hi All, The fabric doc said: “Fabric v2.0 also enables new patterns for working with and sharing private data, without the requirement of creating private data collections for all combinations of channel members that may want to transact. Specifically, instead of sharing private data within a collection of multiple members, you may want to share private data across collections, where each collection may include a single organization, or perhaps a single organization along with a regulator or auditor”. I wonder how to set regulator or auditor along with a single organization when using private data in Fabric 2.0? Is there any sample to tell how to do this?
|
|
How to set regulator or auditor in private data collection
胡 银松
Hi All,
The fabric doc said: “Fabric
v2.0 also enables new patterns for working with and sharing private data, without the requirement of creating private data collections for all combinations of channel members that may want to transact. Specifically, instead of sharing private data within a
collection of multiple members, you may want to share private data across collections, where each collection may include a single organization, or perhaps a single organization along with a regulator or auditor”.
I wonder how to set regulator or auditor along with a single organization when using private data in Fabric 2.0?
Is there any sample to tell how to do this?
|
|
Re: Customize chaincode docker image
Brett T Logan <brett.t.logan@...>
Part of the chaincode instantiation process is to compile the JAR, this isn't something you can hijack in 1.4.x without modifying the source code. Fabric v2.0 (which released last week) provides a framework for configuring and running chaincode however you want: https://hyperledger-fabric.readthedocs.io/en/master/cc_launcher.html
And, if you want to debug your chaincode containers you can forward their standard output to the peer container where you can grep the log for the chaincodes output. You can enable this by setting CORE_VM_DOCKER_ATTACHSTDOUT=true in your peer launch environment, but note, this is not meant for production purposes as it can leak sensitive information into the peer logs from broken or malicious code.
----- Original message -----
|
|
Re: Customize chaincode docker image
sanjaykumar3989@...
Hi,
Every time when i initiate the chaincode , it take time to build the jar. To skip this process for multiple times and to learn the flow of hyperledger CC flow, i am customizing the image. Usually capturing the docker logs of the chaincode really helps in cases like this. - CC container get killed automatically. Is there is some way how i can capture the logs?
|
|
Re: Potential project in need of BFT orderers
#consensus
#fabric-orderer
Brian Behlendorf <bbehlendorf@...>
You really should use a different
status for deferred feature requests than "Closed", because
"decided not to implement this ever" is a closer inference from
"Closed" than "maybe someday". Jira is depended upon as a
future-feature-request tool by lots of other projects and asking
people to know it's differently treated at Fabric is another
cognitive burden to new contributors. At the very least I suggest
updating FAB-33 with a link to new work.
Brian
On 2/3/20 7:44 AM, Jason Yellick wrote:
-- Brian Behlendorf Executive Director, Hyperledger bbehlendorf@... Twitter: @brianbehlendorf
|
|
Re: Potential project in need of BFT orderers
#consensus
#fabric-orderer
Jason Yellick <jyellick@...>
I've seen some similar confusion to this on Rocketchat as well.
FAB-33 was closed along with hundreds of other items in an overall cleanup of JIRA. Its closure does not indicate any mothballing or abandonment of BFT efforts, in fact, there's been considerably more activity in the space in the recent months; particularly there are some ongoing efforts to develop a golang BFT consensus library that is compatible with Fabric. JIRA can be a good tool for tracking the progress of a designed, approved, and mid-implementation item, but it's the wrong place to look for future work. Future work is to be submitted and approved as an RFC https://github.com/hyperledger/fabric-rfcs/ so I would watch that space for updates. Thanks, ~Jason
----- Original message -----
|
|