#fabric #hyperledger-fabric #consensus #fabric-questions In hyperleger fabric v2.2, how can I add peers in org? #consensus #fabric-questions #fabric #hyperledger-fabric


conjurer1981@...
 

Dear everyone,

I start to learn hyperledger fabric v2.2 and find that there is only one peer in each org. And the examples including test-network and commercial papers are all in this construction.
I try to change the template count from 1 to 2 in the file crypto-config-org1.yaml and crypto-config-org2.yaml. But I find nothing changed while the application runs. There is still one peer --- for example, peer0.org1.example.com in org1.
I have a question: since there are only two peers, with one peer in one org, how can the consensus be done? 
And I hope you can teach me how to add peers in the org in v2.2.
Thanks a lot.


Trevor Lee Oakley <trevor@...>
 

I am using 2.0 and I assume 2.2 did not change this aspect - but you need to look at the policies in configtx.yaml. That defines the consensus via policies. You ask about endorsement, and that is defined in configtx.yaml.
 
Fabric is not like Ethereum which have various equations to reach consensus. Fabric is permissioned so the orgs decide what is a consensus. 
 
eg
 Policies:
            Readers:
                Type: Signature
                Rule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"
            Writers:
                Type: Signature
                Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
            Admins:
                Type: Signature
                Rule: "OR('Org1MSP.admin')"
            Endorsement:
                Type: Signature
                Rule: "OR('Org1MSP.peer')"
 
 

From: conjurer1981@...
Sent: 28 July 2020 03:51
To: fabric@...
Subject: [Hyperledger Fabric] #fabric #hyperledger-fabric #consensus #fabric-questions In hyperleger fabric v2.2, how can I add peers in org?
 
Dear everyone,

I start to learn hyperledger fabric v2.2 and find that there is only one peer in each org. And the examples including test-network and commercial papers are all in this construction.
I try to change the template count from 1 to 2 in the file crypto-config-org1.yaml and crypto-config-org2.yaml. But I find nothing changed while the application runs. There is still one peer --- for example, peer0.org1.example.com in org1.ri
I have a question: since there are only two peers, with one peer in one org, how can the consensus be done? 
And I hope you can teach me how to add peers in the org in v2.2.
Thanks a lot.


David Enyeart
 

If you want to see an example of two peers per org, look at the old Build Your First Network tutorial and sample in v2.1:
https://hyperledger-fabric.readthedocs.io/en/release-2.1/build_network.html
https://github.com/hyperledger/fabric-samples/tree/v2.1.0/first-network

It was retired in favor of the test network in v2.2 to simplify things, since most people use it to test out chaincode and you only need one peer per org to test chaincode.

Note that ordering service nodes reach consensus on the blocks. The peers independently and deterministically validate and commit blocks. And endorsement policies are org-based. As long as sufficient orgs endorse then the transaction will be validated. Functionally, it doesn't matter how many peers per org you have. You'd create multiple peers per org if you want to load balance endorsements/queries, and for high availability. Peers can be added anytime by generating the org crypto material for a new peer. There is no network/channel configuration required when bringing up a new peer for an org.

You can read the 'Peers' topic for more background:
https://hyperledger-fabric.readthedocs.io/en/release-2.2/peers/peers.html


Dave Enyeart

conjurer1981---07/28/2020 03:24:34 AM---Dear everyone, I start to learn hyperledger fabric v2.2 and find that there is only one peer in each

From: conjurer1981@...
To: fabric@...
Date: 07/28/2020 03:24 AM
Subject: [EXTERNAL] [Hyperledger Fabric] #fabric #hyperledger-fabric #consensus #fabric-questions In hyperleger fabric v2.2, how can I add peers in org?
Sent by: fabric@...





Dear everyone,

I start to learn hyperledger fabric v2.2 and find that there is only one peer in each org. And the examples including test-network and commercial papers are all in this construction.
I try to change the template count from 1 to 2 in the file crypto-config-org1.yaml and crypto-config-org2.yaml. But I find nothing changed while the application runs. There is still one peer --- for example, peer0.org1.example.com in org1.
I have a question: since there are only two peers, with one peer in one org, how can the consensus be done?
And I hope you can teach me how to add peers in the org in v2.2.
Thanks a lot.




conjurer1981@...
 

Thank you for your kind reply, Dr Dave.

However, I think there are still differences between first-network in v2.1 and test-network in v2.2.

When I check the files in v2.2, I find crypto-config-org1.yaml and crypto-config-org2.yaml in fabric-samples/test-network/organizations/cryptogen
like this case:

organizations/

├── ccp-generate.sh

├── ccp-template.json

├── ccp-template.yaml

├── cryptogen

│   ├── crypto-config-orderer.yaml

│   ├── crypto-config-org1.yaml

│   └── crypto-config-org2.yaml

└── fabric-ca

    ├── ordererOrg

    │   ├── fabric-ca-server-config.yaml

    │   └── msp

    │       ├── cacerts

    │       ├── keystore

 

    │       │   ├── 8aea93a28ac65c9141fc585a3eaa5599dec929d183dcacaecd993b52a121711a_sk

...
/Then I do the operation on the tips of https://github.com/hyperledger/fabric-samples/tree/v2.1.0/first-network

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

 

And then the following error appears:

cryptogen: error: unexpected crypto-config-org1.yaml, try --help

 


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

You have a space between `--config=` and the file name. So it's parsing the file name as a flag, not as an input to a flag.
 
Brett Logan
Software Engineer, IBM Blockchain
Phone: 1-984-242-6890
 
 
 

----- Original message -----
From: conjurer1981@...
Sent by: fabric@...
To: fabric@...
Cc:
Subject: [EXTERNAL] Re: [Hyperledger Fabric] #fabric #hyperledger-fabric #consensus #fabric-questions In hyperleger fabric v2.2, how can I add peers in org?
Date: Tue, Jul 28, 2020 8:08 PM
 

Thank you for your kind reply, Dr Dave.

However, I think there are still differences between first-network in v2.1 and test-network in v2.2.

When I check the files in v2.2, I find crypto-config-org1.yaml and crypto-config-org2.yaml in fabric-samples/test-network/organizations/cryptogen
like this case:

organizations/

├── ccp-generate.sh

├── ccp-template.json

├── ccp-template.yaml

├── cryptogen

│   ├── crypto-config-orderer.yaml

│   ├── crypto-config-org1.yaml

│   └── crypto-config-org2.yaml

└── fabric-ca

    ├── ordererOrg

    │   ├── fabric-ca-server-config.yaml

    │   └── msp

    │       ├── cacerts

    │       ├── keystore

 

    │       │   ├── 8aea93a28ac65c9141fc585a3eaa5599dec929d183dcacaecd993b52a121711a_sk

...
/Then I do the operation on the tips of https://github.com/hyperledger/fabric-samples/tree/v2.1.0/first-network

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

 

And then the following error appears:

cryptogen: error: unexpected crypto-config-org1.yaml, try --help

 
 


conjurer1981@...
 

Thanks a lot, Dr Brett.  Please forgive my problem. I am also a layman with linux.