Normal prepare only supports 4 7 13 16 nodes. If you want to create 10 nodes, 5 of them are consensus nodes. How to achieve it?
1. Comment out these lines in prepare.sh:
2. Modify the crytogen template file:
If in cert mode: chainmaker-cryptogen/config/crypto_config_template.yml
If it is pk mode: chainmaker-cryptogen/config/pk_config_template.yml
For example, in the configuration file, the configuration generates 10 node certificates, and when preparing, specify 5 consensus nodes, and the remaining 5 are regarded as synchronization nodes:
3. How to configure more than 4, 7, 13 nodes?
If there are more than 7 consensus nodes, for example, there are 12 consensus nodes out of 20 nodes, the template can be modified
- First perform the operation in step 2, and set the count in crypto_config_template.yml to 20
- Modify the bc_10_13.tpl file: chainmaker-go/config/config_tpl/chainconfig/bc_10_13.tpl
- Add the yellow part():
- In prepare.sh, replace $NODE_CNT -eq 4 with $NODE_CNT -eq 12
5. Run prepare.sh 12 1
The obtained bc1 configuration file is as shown in the figure. There are 12 master nodes and 20 trust_root nodes.
The number of seed nodes in chainmakeryml is 12:
The first 12 nodes use consensus certificates:
Starting from the 13th node, use the synchronization certificate: