当前位置:网站首页>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 .
边栏推荐
- [detailed explanation of Huawei machine test] judgment string subsequence [2022 Q1 Q2 | 200 points]
- The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies
- [untitled]
- 【面试必刷101】链表
- Leetcode T34: 在排序数组中查找元素的第一个和最后一个位置
- Using settoolkit to forge sites to steal user information
- Qt的模型与视图
- Audio audiorecord create (I)
- Use threejs simple Web3D effect
- MySQL8.0学习记录17 -Create Table
猜你喜欢

seaborn clustermap矩阵添加颜色块

Using settoolkit to forge sites to steal user information

CPU design practice - Chapter 4 practical tasks - simple CPU reference design and debugging

Airsim radar camera fusion to generate color point cloud

Audio-AudioRecord create(一)

一文纵览主流 NFT 市场平台版税、服务费设计

【C】 Summary of wrong questions in winter vacation

《单片机原理及应用》—定时器、串行通信和中断系统

《MATLAB 神经网络43个案例分析》:第30章 基于随机森林思想的组合分类器设计——乳腺癌诊断

Comprehensive experiment Li
随机推荐
2022 mechanical fitter (primary) examination summary and mechanical fitter (primary) reexamination examination
Vscode customize the color of each area
《MATLAB 神经网络43个案例分析》:第30章 基于随机森林思想的组合分类器设计——乳腺癌诊断
Provincial election + noi part I dynamic planning DP
Review of week 280 of leetcode
[redis] it takes you through redis installation and connection at one go
Model and view of QT
How to use OKR as the leadership framework of marketing department
shardingSphere
使用beef劫持用戶瀏覽器
7-26 word length (input and output in the loop)
MATLAB小技巧(23)矩阵分析--模拟退火
Luogu p3799 demon dream stick
[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)
MATLAB【函数求导】
Manually dig XSS vulnerabilities
挖财打新股安全吗
01 numpy introduction
Leetcode T34: 在排序数组中查找元素的第一个和最后一个位置
【无标题】