当前位置:网站首页>Configuration and startup of Chang'an chain synchronization node
Configuration and startup of Chang'an chain synchronization node
2022-07-01 08:34:00 【Handsome Wutong】
Node certificate generation
1、 The default script generates the synchronization node configuration
In the use of
./prepare_pk.sh
When generating the chain configuration , Default
crypto-config\wx-org1.chainmaker.org\node
The certificate files of two types of nodes are generated inside , One is the consensus node consensus1, One is the synchronization node common1.
2、 adopt chainmaker-cryptogen Or self built CA Certificate Services Generate synchronization node Certificate
Synchronize node configuration generation
In the boot node configuration file , Only the startup configuration of the consensus node , If you need to start the synchronization node , You need to add a new synchronization node configuration , The specific steps are as follows :
1. Copy the deployment package
$ cd build/release
$ cp -rf chainmaker-v2.0.0-wx-org1.chainmaker.org chainmaker-v2.0.0-wx-org1.chainmaker.org_common1
2. hold chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/bin All of them .sh All in the script wx-org1.chainmaker.org Replace with wx-org1.chainmaker.org_common1
3. rename
$ cd build/release/chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config
$ mv wx-org1.chainmaker.org wx-org1.chainmaker.org_common1
4. Copy chainmaker-cryptogen Extension generated crypto-config/wx-org1.chainmaker.org/node/common1 To chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config/wx-org1.chainmaker.org_common1/certs/node Next
5. modify chainmaker.yml
hold chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config/wx-org1.chainmaker.org_common1/chainmaker.yml Included in all paths in wx-org1.chainmaker.org Replace with wx-org1.chainmaker.org_common1. Note that this refers to all paths , Don't put the node Inside the module org_id Changed , This org_id It refers to the organization to which the synchronization node belongs .
modify node modular , hold certs/node/consensus1/consensus1.sign.key It is amended as follows certs/node/common1/common1.sign.key
modify node modular , hold certs/node/consensus1/consensus1.sign.crt It is amended as follows certs/node/common1/common1.sign.crt
modify net modular , hold certs/node/consensus1/consensus1.tls.key It is amended as follows certs/node/common1/common1.tls.key
modify net modular , hold certs/node/consensus1/consensus1.tls.crt It is amended as follows certs/node/common1/common1.tls.crt
modify net modular , hold listen_addr: /ip4/0.0.0.0/tcp/11301 It is amended as follows listen_addr: /ip4/0.0.0.0/tcp/11306
modify rpc modular , hold certs/node/consensus1/consensus1.tls.crt It is amended as follows certs/node/common1/common1.tls.crt
modify rpc modular , hold certs/node/consensus1/consensus1.tls.key It is amended as follows certs/node/common1/common1.tls.key
modify rpc modular , hold port: 12301 It is amended as follows port: 12306
modify monitor modular , hold port: 14321 It is amended as follows port: 14326
modify pprof modular , hold port: 24321 It is amended as follows port: 24326
6. modify chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/config/wx-org1.chainmaker.org_common1/chainconfig/bc1.yml Medium trust_roots modular .
Put all the ../config/wx-org1.chainmaker.org It is amended as follows ../config/wx-org1.chainmaker.org_common1
7. Start node
$ cd build/release/chainmaker-v2.0.0-wx-org1.chainmaker.org_common1/bin
$ ./start.sh
8. EndException resolution
problem 1: The synchronization node cannot start normally
[Blockchain] blockchain/chainmaker_server.go:192 init blockchain[chain1] failed, fail to initialize identity management service: [setup cert member failed, organization information in certificate and in input parameter do not match [certificate: wx-org1.chainmaker.org, parameter: wx-org1.chainmaker.org_common1]]The reason for this exception is to modify chainmaker.yml Included in all paths in wx-org1.chainmaker.org Replace with wx-org1.chainmaker.org_common1 When the node Inside the module org_id Also replace with wx-org1.chainmaker.org_common1 了 , This org_id It refers to the organization to which the synchronization node belongs , Organization of nodes ID by wx-org1.chainmaker.org, So it is reduced to no common1 The suffix of .
problem 2: An error is reported in the synchronization block of the synchronization node
2022-06-29 16:10:37.641 [ERROR] [Storage] @chain1 [email protected]/blockstore_impl.go:525 chain[chain1] failed to write log, block[1], err:out of order
2022-06-29 16:10:37.641 [ERROR] [Core] @chain1 common/committer.go:90 out of order
2022-06-29 16:10:37.641 [ERROR] [Core] @chain1 common/block_helper.go:961 cache add block err: out of order
2022-06-29 16:10:37.641 [ERROR] [Sync] @chain1 sync/routine.go:70 process msg failed, reason: failed add block to chain
2022-06-29 16:11:12.561 [ERROR] [Storage] @chain1 blockfiledb/blockfile.go:478 out of order, b.entry.index: 2 and l.lastIndex+uint64(1): 1
2022-06-29 16:11:12.561 [ERROR] [Storage] @chain1 blockfiledb/blockfile.go:481 your block file db is damaged or not use this feature before, please check your disable_block_file_db setting in chainmaker.yml
The reason for this exception is that some block data has been written to the file or... After startup due to incorrect configuration for the first time db It's in , After modifying the configuration file and restarting , This will cause the new synchronization node to be unable to synchronize to the block data from other consensus nodes , At this time, it is necessary to clean up the block data generated by the incorrect startup of the front side , The cleaning method is... To the node configuration file data Catalog , Delete the folder below , If it works to mysql Need to mysql Delete all databases related to nodes , Restart the node to recover .
边栏推荐
猜你喜欢

TypeError: __init__() got an unexpected keyword argument ‘autocompletion‘
![[redis] it takes you through redis installation and connection at one go](/img/ca/89cb18f0eeb835f021d6a2489681a1.png)
[redis] it takes you through redis installation and connection at one go

使用beef劫持用戶瀏覽器

C basic knowledge review (Part 4 of 4)

The use of word in graduation thesis

使用threejs简单Web3D效果
![[JS reverse] MD5 encryption parameter cracking](/img/06/0610045d287f646479d6eb5021a067.png)
[JS reverse] MD5 encryption parameter cracking

Gateway-88

Mavros sends a custom topic message to Px4

NIO-零拷贝
随机推荐
Provincial election + noi part I dynamic planning DP
挖财打新股安全吗
Mavros sends a custom topic message to Px4
[深度剖析C语言] —— 数据在内存中的存储
Conception et mise en service du processeur - chapitre 4 tâches pratiques
《单片机原理及应用》-片外拓展
SPL-安装与基本使用(二)
【面试必刷101】链表
Precautions and skills in using regular expressions in golang
XX attack - reflective XSS attack hijacking user browser
View drawing process analysis
DID的使用指南,原理
使用beef劫持用戶瀏覽器
量化交易之读书篇 - 《征服市场的人》读书笔记
Learn reptiles for a month and earn 6000 a month? Tell you the truth about the reptile, netizen: I wish I had known it earlier
Yolov5 advanced 7 target tracking latest environment setup
What is the material of 16MnDR, the minimum service temperature of 16MnDR, and the chemical composition of 16MnDR
Introduction to R language
Download jackson codehaus. org jar - downloading jackson. codehaus. org jar
Provincial selection + noi Part II string