YT Series to watch for understanding configuration files in depth (of Fabric 2.0): https://www.youtube.com/playlist?list=PLSBNVhWU6KjW4qo1RlmR7cvvV8XIILub6
Note: After watching Video No. 13, watch No. 18 (the videos are incorrectly numbered/ordered)
- A folder which keeps all crypto material of different entities. -- Orderers and Peers are the two main entities whose crypto material is stored under this folder. -- Organizations providing (hosting) orderers in the network will have their crypto material (all )
NOTE: If you receive any DeltaSet error and find 'unknown authority error' in orderer logs, perform a clean up using the long command given in Cleanup
- Crypto step: After modifications to
crypto-config.yaml
file (if required), run./myscripts/create-crypto.sh
- Genesis step: After modifications to
configtx.yaml
file (if required), run./myscripts/create-genesis.sh
- NetworkUp step: Run
docker-compose down; docker volume prune -f; docker-compose up -d
- ChannelCreate step: To start the channel, Run
./myscripts/createChannel.sh
P.S.: Added ./startLNet.sh
to combine all above 4 steps.
- Update
crypto-config.yaml
with new orderer's name (also give SANS so that it recognizes 'localhost' & '127.0.0.1' if ever referred in createChannel) - Update
configtx.yaml
such as:- The
OrdererEndpoints
key (under 'Organizations/&OrdererOrg') has new orderer's container name with port. - (Since Raft is recommended starting from v2.0)
Add the new Orderer under 'Orderer/EtcdRaft/Consenters' as shown in below example:
Host: ordererN.example.com (or whichever name you gave in crypto-config.. just make sure it is written in the 'Hostname Domain' syntax ~ explained in crypto-config yaml file) Port: 8050 ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/ordererN.example.com/tls/server.crt ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/ordererN.example.com/tls/server.crt
- The
- (Optional) Update the base docker-compose files under 'base' directory (useful if you want to modularize your main docker-compose file) (To know what I changed, check the "Checkpoint commit: Successfully added second orderer" commit diff)
- Use the long cleanup command to remove old crypto material (especially 'crypto' and 'fabric' directories)
- Follow the sequence to start network as it is.
- To verify whether there are two orderers communicating (they will send heartbeat messages ~ a feature of Raft to know if they are present or not), use the following command:
watch --color docker logs --since 5s orderer.example.com
While cleanup, make sure to remove crypto
and fabric
folders from the network's directory (these contain an older version of your network crypto material - the CAs present in these won't recognize the new entities you added in configuration):
sudo rm -r ./{crypto,fabric};
The curly braces is the bash syntax to combine: ../crypto
& ../fabric
Full/Long clean up command:
sudo rm -r ./{crypto,fabric,crypto-config,channel-artifacts/*,sampleapp/hyperledger}
P.S.: Added ./stopLNet.sh
to combine cleanup work.