Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a new peer to an existing Hyperledger Fabric network?

When you create a hyperledger fabric network, you define organizations, orderers and peers in crypto-config.yaml and configtx.yaml.

But how do you add a new organization or a new peer to an existing organization in a network that is already setup? Run cryptogen and configtxgen pointing to config files that contain only the new organizations/peers? Re-generate everything?

like image 604
Joaquim Oliveira Avatar asked Sep 22 '17 18:09

Joaquim Oliveira


People also ask

Can we update the role of peers in Hyperledger?

Although ledger-updating applications also connect to peers to invoke a chaincode, unlike with ledger-querying applications, an individual peer cannot perform a ledger update at this time, because other peers must first agree to the change — a process called consensus.

What is endorsing peer in Hyperledger Fabric?

Here in our already defined network, we have 5 endorsing peers set as a blue dot. These endorsing peers are defined in configtx. yaml file and is set as an endorsement policy while creating it. Each endorsing peer has a chaincode installed and has a copy of ledger which is sync between all peers.

Can a participant belong to more than one Hyperledger Fabric Blockchain network?

This ledger is not visible to anyone else than the member participating in the channel. A participant can belong to multiple Hyperledger Fabric blockchain networks through channels.


2 Answers

The whole point of using cryptogen is to help user to settle the crypto material for peer and organizations defined in the crypto-config.yaml file. However one can simply leverage openssl to generate keys and certificates of organization root CA, next generate user certificates and arrange them into the folder similar to what cryptogen is producing and startup your network. Therefore adding a new peer will stand up to simply generating a new set of keys and certificate signed by the root CA. Finally you can simply start new peer and join it to the channel by providing genesis block, which could be fetched from ordering service.

Now, the configtxgen tool helps you to configure your Hyperledger Fabric network it terms of which organizations will form a consortium and will have rights to join the channel. Extending this configuration is a bit more involved process than simply adding a new peer, in order to complete you will have to leverage the configtxlator tool, more details and example of how to use it you can find in the following tutorial. In high level, you will have to read current channel configuration, parse it into the json format, update with new participants, compute the delta and generate configuration update transaction and the last step is to submit the update to the ordering service so it will take effect. Once you will accomplished config update you will be able to add new peers from new organization to the channel.

like image 93
Artem Barger Avatar answered Oct 05 '22 23:10

Artem Barger


You can achieve this by generating the crypto material (using cryptogen extends) for the new peer, spawning the new peer and joining that peer to the existing channel on the network to sync-up.

You can find the complete guide at

Extending Hyperledger Fabric Network: Adding a new peer

like image 40
Abdul Wahab Avatar answered Oct 06 '22 00:10

Abdul Wahab