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?
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
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.