Adding cli to Hyperledger Fabric¶
Prerequisites¶
To add cli a fully configured Fabric network must be present already, i.e. a Fabric network which has Orderers, Peers, Channels (with all Peers already in the channels). The corresponding crypto materials should also be present in their respective Hashicorp Vault.
NOTE: Addition of cli has been tested on an existing network which is created by Bevel. Networks created using other methods may be suitable but this has not been tested by Bevel team.
Modifying Configuration File¶
Refer this guide for details on editing the configuration file.
While modifying the configuration file(network.yaml
) for adding cli, all the existing organizations should have org_status
tag as existing
and the new organization should have org_status
tag as new
under network.channels
e.g.
# The channels defined for a network with participating peers in each channel
channels:
- channel:
consortium: SupplyChainConsortium
channel_name: AllChannel
chaincodes:
- "chaincode_name"
orderers:
- supplychain
participants:
- organization:
name: carrier
type: creator # creator organization will create the channel and instantiate chaincode, in addition to joining the channel and install chaincode
org_status: existing # Status of the organization for the existing network, can be new / existing
peers:
- peer:
name: peer0
gossipAddress: peer0.carrier-net.org3proxy.blockchaincloudpoc.com:443 # Must include port, External or internal URI of the gossip peer
peerAddress: peer0.carrier-net.org3proxy.blockchaincloudpoc.com:443 # Must include port, External URI of the peer
ordererAddress: orderer1.org1proxy.blockchaincloudpoc.com:443 # Must include port, External or internal URI of the orderer
- organization:
name: warehouse
type: joiner
org_status: existing # Status of the organization for the existing network, can be new / existing
peers:
- peer:
name: peer0
gossipAddress: peer0.warehouse-net.org5proxy.blockchaincloudpoc.com:443
peerAddress: peer0.warehouse-net.org5proxy.blockchaincloudpoc.com:443 # Must include port, External URI of the peer
ordererAddress: orderer1.org1proxy.blockchaincloudpoc.com:443
- organization:
name: manufacturer
type: joiner
org_status: existing # Status of the organization for the existing network, can be new / existing
peers:
- peer:
name: peer0
gossipAddress: peer0.manufacturer-net.org2proxy.blockchaincloudpoc.com:443
peerAddress: peer0.manufacturer-net.org2proxy.blockchaincloudpoc.com:443 # Must include port, External URI of the peer
ordererAddress: orderer1.org1proxy.blockchaincloudpoc.com:443
- organization:
name: store
type: joiner # joiner organization will only join the channel and install chaincode
org_status: new # Status of the organization for the existing network, can be new / existing
peers:
- peer:
name: peer0
gossipAddress: peer0.store-net.org4proxy.blockchaincloudpoc.com:443
peerAddress: peer0.store-net.org4proxy.blockchaincloudpoc.com:443 # Must include port, External URI of the peer
ordererAddress: orderer1.org1proxy.blockchaincloudpoc.com:443
endorsers:
# Only one peer per org required for endorsement
- organization:
name: carrier
peers:
- peer:
name: peer0
corepeerAddress: peer0.carrier-net.org3proxy.blockchaincloudpoc.com:443
certificate: /home/bevel/build/carrier/server.crt # certificate path for peer
- organization:
name: warehouse
peers:
- peer:
name: peer0
corepeerAddress: peer0.warehouse-net.org5proxy.blockchaincloudpoc.com:443
certificate: /home/bevel/build/warehouse/server.crt # certificate path for peer
- organization:
name: manufacturer
peers:
- peer:
name: peer0
corepeerAddress: peer0.manufacturer-net.org2proxy.blockchaincloudpoc.com:443
certificate: /home/bevel/build/manufacturer/server.crt # certificate path for peer
genesis:
name: OrdererGenesis
and under network.organizations
as
# then these services should be listed in this section as well.
organizations:
# Specification for the 1st organization. Each organization maps to a VPC and a separate k8s cluster
- organization:
name: supplychain
country: UK
state: London
location: London
subject: "O=Orderer,OU=Orderer,L=51.50/-0.13/London,C=GB"
type: orderer
external_url_suffix: org1proxy.blockchaincloudpoc.com
org_status: existing # Status of the organization for the existing network, can be new / existing
..
..
- organization:
name: store
country: US
state: New York
location: New York
subject: "O=Store,OU=Store,L=40.73/-74/New York,C=US"
type: peer
external_url_suffix: org4proxy.blockchaincloudpoc.com
org_status: new # Status of the organization for the existing network, can be new / existing
..
..
The network.yaml
file should contain the specific network.organization
details along with the orderer information.
Run playbook¶
The add-cli.yaml playbook is used to add cli to the existing network. This can be done using the following command