Blockchain learning 6-Chang'an chain deployment: how to create a chain with a specific number of consensus nodes and synchronization nodes

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:
enter image description here

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:enter image description here

 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 

  1. First perform the operation in step 2, and set the count in crypto_config_template.yml to 20
  2. Modify the bc_10_13.tpl file: chainmaker-go/config/config_tpl/chainconfig/bc_10_13.tpl
  3. Add the yellow part():
  4. In prepare.sh, replace $NODE_CNT -eq 4 with $NODE_CNT -eq 12enter image description here

 

 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:

enter image description here

 Starting from the 13th node, use the synchronization certificate:

 

 

Guess you like

Origin blog.csdn.net/fvafuc/article/details/132169957