Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 77e4f1d

Browse files
authored
Add syncblocks (#1322)
* add syncblocks * update toc
1 parent 3ffde98 commit 77e4f1d

File tree

11 files changed

+106
-0
lines changed

11 files changed

+106
-0
lines changed

docs/en-us/node/assets/sync_06.png

78.1 KB
Loading

docs/en-us/node/syncblocks.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Synchronizing the blockchain faster
2+
3+
The client must be fully synchronized before use. In order to speed up network synchronization you can download an offline package of the blockchain data up to a certain block height. This means the client will only need to sync the additional blocks from the Neo network rather than the entire blockchain.
4+
5+
## Step 1 - Download the offline package
6+
7+
1. Close the Neo client and go to [offline synchronized package](https://sync.ngd.network/) downloading page.
8+
9+
2. From the offline package downloading page, click **N3 Mainnet** or **N3 Testnet** according to your network and then download one of the following packages (no need to unzip the package):
10+
11+
- **Full offline package**: contains the most complete blockchain data. It is applicable to the client running for the first time. The download file is chain.0.acc.zip.
12+
- **Increment offline package**: contains data in the range from starting height to ending height of the package. It is applicable to the client which has been synchronized up to the block height within the increment offline package coverage. The download file is chain.xxx.acc.zip, where xxx is the package starting height, e.g. chain.378997.acc.zip.
13+
14+
![](../../zh-cn/node/assets/sync_01.png)
15+
16+
## Step 2 - Place the offline package
17+
18+
> [!Warning]
19+
>
20+
> You must not change the default offline package file name (chain.acc.zip or chain.xxx.acc.zip) , otherwise it will not work for synchronization.
21+
22+
For Neo-CLI:
23+
24+
Place the downloaded package (chain.0.acc.zip or chain.xxx.acc.zip) under the Neo-CLI root folder, as shown below:
25+
26+
![](../../zh-cn/node/assets/sync_02.png)
27+
28+
For Neo-GUI:
29+
30+
Place the downloaded package (chain.0.acc.zip or chain.xxx.acc.zip) under the Neo-GUI\resources\build-neo-node folder, as shown below:
31+
32+
![](../../zh-cn/node/assets/sync_05.png)
33+
34+
## Step 3 - Check the client synchronization status
35+
36+
Run the client again and check the blocks downloading status:
37+
38+
- For Neo-CLI,enter `open wallet <path>` to open a wallet, and then enter `show state` to check the blocks downloading status. When you see the connected nodes is 0 and the synchronizing speed is greatly accelerated, that means the offline package is working. When the connected nodes appear, it indicates the synchronization is completed.
39+
40+
![](../../zh-cn/node/assets/sync_03.png)
41+
42+
![](../../zh-cn/node/assets/sync_04.png)
43+
44+
- For Neo-GUI, you can see the client is now synchronized faster.
45+
46+
![](assets/sync_06.png)
47+
48+
> [!Note]
49+
>
50+
> - The client cannot be reached during the process when it is synchronizing with the offline package, thus the connected nodes is 0 and you cannot invoke APIs from the client until it has completed synchronization.
51+
> - You can also use the Neo-CLI command `export blocks`, to export the entire blockchain data to a package or export the specified number of block data from the specified block height . For more information, see [CLI Command Line](cli/cli.md).

docs/en-us/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
href: /docs/en-us/node/gui/contract.md
7171
- name: Advanced Functions
7272
href: /docs/en-us/node/gui/advanced.md
73+
- name: Synchronizing the blockchain faster
74+
href: /docs/en-us/node/syncblocks.md
7375
- name: Development Guide
7476
items:
7577
- name: Neo Network

docs/zh-cn/node/assets/sync_01.png

120 KB
Loading

docs/zh-cn/node/assets/sync_02.png

48.8 KB
Loading

docs/zh-cn/node/assets/sync_03.png

7.86 KB
Loading

docs/zh-cn/node/assets/sync_04.png

52.6 KB
Loading

docs/zh-cn/node/assets/sync_05.png

49.3 KB
Loading

docs/zh-cn/node/assets/sync_06.png

50.3 KB
Loading

docs/zh-cn/node/syncblocks.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# 快速同步区块数据
2+
3+
Neo 客户端必须先完成与区块链的同步才能正常使用。由于区块链数据庞大,客户端同步时间通常很久,建议采用离线同步包加速同步过程。
4+
5+
## 第一步 - 获取离线包
6+
7+
1. 关闭客户端,进入[离线包下载页面](https://sync.ngd.network/)
8+
9+
2. 在离线包下载页面,根据你所在网络点击 **N3主网****N3测试网** 标签,然后选择以下一种离线包进行下载 (无需解压):
10+
11+
- **全量离线包**:包含了最完整的区块高度数据,适用于初次运行的客户端。下载到的文件为 chain.0.acc.zip。
12+
- **增量离线包**:包含起始高度到结束高度范围内的数据,当你的客户端已经同步到增量包的起始高度之上时,可使用增量包继续进行同步。下载到的文件为 chain.x.acc.zip,x 为增量包的起始高度,如 chain.378997.acc.zip。
13+
14+
![](assets/sync_01.png)
15+
16+
## 第二步 - 放置离线包
17+
18+
> [!Caution]
19+
>
20+
> 放置离线包时切勿修改离线包文件名,否则会导致无法同步。
21+
22+
对于 Neo-CLI:
23+
24+
将下载的压缩包文件 chain.0.acc.zip 或 chain.xxx.acc.zip 直接放置到客户端 Neo-CLI 根目录下,如下图所示:
25+
26+
![](assets/sync_02.png)
27+
28+
对于 Neo-GUI:
29+
30+
将下载的压缩包文件 chain.0.acc.zip 或 chain.xxx.acc.zip 放置到客户端 Neo-GUI 根目录下的resources\build-neo-node 文件夹中,如下图所示:
31+
32+
![](assets/sync_05.png)
33+
34+
## 第三步 - 查看同步状态
35+
36+
再次打开客户端查看同步状态:
37+
38+
- 对于 Neo-CLI,输入 `open wallet <path>` 打开钱包后,输入 `show state` 查看区块同步状态,当画面显示连接数为 0 并且同步速度明显加快时, 说明已进入离线同步模式。当同步完成时会出现连接数。
39+
40+
![](assets/sync_03.png)
41+
42+
![](assets/sync_04.png)
43+
44+
- 对于 Neo-GUI,将发现客户端以超快速度进行同步。
45+
46+
![](assets/sync_06.png)
47+
48+
> [!Note]
49+
>
50+
> - 进行离线包同步时,客户端无法与外界通信,此时 node 数为 0,且无法调用 API。当离线包使用完毕后,客户端会自动恢复与外界的通信。
51+
> - 也可以使用 Neo-CLI 的 `export blocks` 命令,将同步好的区块数据导出成离线同步包。 `export blocks` 后面无参数时默认导出所有区块数据,当附加 `<start> [count]` 参数时,可以从指定区块高度导出指定数量的区块数据,方便备份以及在原有区块数据上追加同步。相关信息请参见 [CLI命令参考](cli/cli.md)

docs/zh-cn/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
href: /docs/zh-cn/node/gui/contract.md
7272
- name: 高级功能
7373
href: /docs/zh-cn/node/gui/advanced.md
74+
- name: 快速同步区块
75+
href: /docs/zh-cn/node/syncblocks.md
7476
- name: 开发指南
7577
items:
7678
- name: Neo 网络

0 commit comments

Comments
 (0)