From fd45db448195273690e4fac022a74fb8065a4639 Mon Sep 17 00:00:00 2001 From: "Zhiwei(Jeffrey) Hu" Date: Mon, 6 Dec 2021 16:18:17 +0800 Subject: [PATCH] add State Sync docs (#2700) Co-authored-by: Yelong Zhang --- docs/get-started/mainnet.md | 2 ++ docs/get-started/state-sync.md | 40 +++++++++++++++++++++++++++++++ docs/zh/get-started/mainnet.md | 2 ++ docs/zh/get-started/state-sync.md | 40 +++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 docs/get-started/state-sync.md create mode 100644 docs/zh/get-started/state-sync.md diff --git a/docs/get-started/mainnet.md b/docs/get-started/mainnet.md index 2de80674b..a1f5a50b9 100644 --- a/docs/get-started/mainnet.md +++ b/docs/get-started/mainnet.md @@ -39,6 +39,8 @@ Next, your node will process all chain upgrades. Between each upgrade, you must You may see some connection errors, it does not matter, the P2P network is trying to find available connections Try to add some of the [Community Peers](https://github.com/irisnet/mainnet/blob/master/config/community-peers.md) to `persistent_peers` in the config.toml + +If you want to quickly start the node and join IRIS Hub without historical data, you can consider using the [state_sync](./state-sync.md) function. ::: ## Upgrade to Validator Node diff --git a/docs/get-started/state-sync.md b/docs/get-started/state-sync.md new file mode 100644 index 000000000..4f40f8373 --- /dev/null +++ b/docs/get-started/state-sync.md @@ -0,0 +1,40 @@ +--- +order: 7 +--- + +# State Sync + +If you want to quickly start the node and join IRIS Hub without historical data, you can consider using the `state_sync` feature. **Note that the data directory must be empty when starting the node.** + +## Procedure + +1. Initialize the mainnet node by referring to [Join The Mainnet](./mainnet.md). +2. Check the block height of the current snapshot, and select the latest height. + +```bash +curl http://34.82.96.8:26658/ +``` + +3. Modify the `config.toml`. + +```toml +[statesync] +enable = true # whether enable stat_sync; set true +rpc_servers = "34.82.96.8:26657,34.77.68.145:26657" # RPC server address which the node connects to +trust_height = # Set to the block height of the latest snapshot +trust_hash = "" #Set to the hash corresponding to the latest snapshot block height (trust height), which can be checked via https://irishub.iobscan.io/#/block/. +trust_period = "168h0m0s" +discovery_time = "15s" +temp_dir = "" +``` + +4. Start the node. + +```bash +iris start +``` + +## Others + +1. If any problem occurs during chain starting, you can execute `iris unsafe-reset-all` to reset the node and repeat the steps above. +2. If you can't find solutions to the current issue, please contact us via [IRISnet Discord channel](https://discord.com/invite/bmhu9F9xbX) for help. diff --git a/docs/zh/get-started/mainnet.md b/docs/zh/get-started/mainnet.md index cbc011ff9..02de8ff83 100644 --- a/docs/zh/get-started/mainnet.md +++ b/docs/zh/get-started/mainnet.md @@ -39,6 +39,8 @@ iris start 您可能会看到一些连接错误,这没关系,P2P网络正在尝试查找可用的连接 可以添加几个[社区公开节点](https://github.com/irisnet/mainnet/blob/master/config/community-peers.md) 到`config.toml`中的`persistent_peers`。 + +如果您在不需要历史数据的情况下要快速启动节点并加入 IRIS Hub,可以考虑使用 [state_sync](./state-sync.md) 功能快速启动节点。 ::: ## 升级为验证人节点 diff --git a/docs/zh/get-started/state-sync.md b/docs/zh/get-started/state-sync.md new file mode 100644 index 000000000..0c72db271 --- /dev/null +++ b/docs/zh/get-started/state-sync.md @@ -0,0 +1,40 @@ +--- +order: 7 +--- + +# State Sync +## 背景 + +如果您在不需要历史数据的情况下要快速启动节点并加入 IRIS Hub,可以考虑使用 `state_sync` 功能快速启动节点。需要注意的是在启动节点的时候要保证节点 data 目录是空的。 + +## 步骤 + +1. 参考 [加入主网](./mainnet.md) 进行主网节点初始化 +2. 查看现存快照的块高,并选取最新块高 + +```bash +curl http://34.82.96.8:26658/ +``` + +3. 修改配置文件 `config.toml` + +```toml +[statesync] +enable = true #是否开启 stat_sync,设置为 true +rpc_servers = "34.82.96.8:26657,34.77.68.145:26657" #链接的 rpc server 地址 +trust_height = # 设置为最新快照的块高 +trust_hash = "" #设置为最新快照块高对应的 hash,可通过浏览器 https://irishub.iobscan.io/#/block/ 进行查看 +trust_period = "168h0m0s" +discovery_time = "15s" +temp_dir = "" +``` + +4. 启动节点 + +```bash +iris start +``` + +## 其他 +1. 如果在启动链的过程中有问题可以执行 `iris unsafe-reset-all` 重置节点,然后重复以上步骤。 +2. 如果出现不能解决的问题,请通过 [Discord](https://discord.com/invite/bmhu9F9xbX) 来联系 IRISnet,我们将帮助您解决遇到的问题。