From dcedde1ba212af33f49c6f3e7c1b1d526ce97f1f Mon Sep 17 00:00:00 2001 From: Chetan Phirke Date: Wed, 27 Nov 2024 15:58:59 +0530 Subject: [PATCH 1/6] Update protmainnet documentation --- zq2/docs/endpoints.md | 8 +- zq2/docs/nodes/checkpoint.md | 119 +++++++++++++++------------- zq2/docs/nodes/index.md | 6 +- zq2/docs/nodes/nodefaq.md | 2 +- zq2/docs/nodes/prototestnetnodes.md | 2 +- zq2/mkdocs.in.yaml | 2 +- 6 files changed, 76 insertions(+), 63 deletions(-) diff --git a/zq2/docs/endpoints.md b/zq2/docs/endpoints.md index 016cf0e..c15edd6 100644 --- a/zq2/docs/endpoints.md +++ b/zq2/docs/endpoints.md @@ -8,7 +8,7 @@ keywords: description: Endpoints, Block Explorer & Faucet --- -# Endpoints, Block Explorer & Faucet +# [Endpoints, Block Explorer & Faucet](#endpoints-block-explorer-faucet) As we introduce additional test networks for Zilliqa 2.0, their public RPC node URLs and chain IDs will be published on [ChainList](https://chainlist.org/?search=zilliqa&testnets=true) alongside existing chain information for Zilliqa 1.0.
@@ -25,7 +25,7 @@ Add Zilliqa 2 EVM proto-mainnet

-## Networks +## [Networks](#networks) Details for the current network versions of Zilliqa 2.0 are listed below. @@ -38,14 +38,14 @@ Details for the current network versions of Zilliqa 2.0 are listed below. _**Note** that this is currently a proto-testnet and proto-mainnet versions of Zilliqa 2.0 designed primarily for testing purposes, and therefore its state and uptime are not guaranteed_ -## Block Explorer +## [Block Explorer](#block-explorer) The current version of Zilliqa 2.0 is compatible with the Otterscan block explorer and does not support Devex. The block explorer for the Zilliqa 2.0 proto-testnet is [available here](https://explorer.zq2-prototestnet.zilliqa.com/). The block explorer for the Zilliqa 2.0 proto-mainnet is [available here](https://explorer.zq2-protomainnet.zilliqa.com/). -## Faucet +## [Faucet](#faucet) The faucet sends an amount of 100 ZIL to the supplied address for use in testing the network. diff --git a/zq2/docs/nodes/checkpoint.md b/zq2/docs/nodes/checkpoint.md index 400e1b2..56bf727 100644 --- a/zq2/docs/nodes/checkpoint.md +++ b/zq2/docs/nodes/checkpoint.md @@ -1,62 +1,71 @@ --- id: nodes/checkpoint -title: Checkpoint +title: Checkpoint --- -Checkpoints in nodes serve as specific reference points within the blockchain, -allowing nodes to synchronize more efficiently when joining or rejoining the network. -Instead of processing the entire blockchain from the genesis block, nodes can start from -a known, validated state. Below is a detailed guide on how to set up checkpoints. - -## [Syncing a node from a checkpoint](#checkpoint-sync) -Assuming that you have already completed -[setup node](../nodes/prototestnetnodes.md#setting-up-your-environment-and-building-zq2-node) section. - -For prototestnet network, you should have `zq2-prototestnet.toml` and the `start_node.sh` -script, which is generated by the [setup node](../nodes/prototestnetnodes.md#setting-up-your-environment-and-building-zq2-node) guide. - -### Step by step guide to do checkpoint configuration - -1. Ensure that you are in directory `/my/dir/zq2` that you created before during the setup. -2. **Download the checkpoints file:** -Here are the steps for downloading the latest checkpoint file. - - Visit the public [checkpoint url](https://checkpoints.zq2-prototestnet.zilliqa.com/) , where you will see an XML file. - - Look for the `` tag, which indicates the checkpoint file's name. The checkpoint file follows `block_num.dat` format. For eg `000291600.dat`. - - Copy the file name from the topmost key. This file contains the latest checkpoint data. - - If you prefer to sync from an older checkpoint, copy the desired file from the `previous/` directory. You can skip this step if you have already decided to sync from the latest checkpoint. - - To download, replace in the URL with the appropriate block number: - - For the latest checkpoint file: `https://checkpoints.zq2-prototestnet.zilliqa.com/` - - For an older file: `https://checkpoints.zq2-prototestnet.zilliqa.com/previous/` - - Use `wget` or paste the link in your browser to download the file to the `/my/dir/zq2` directory: +# Checkpoints in Nodes + +Checkpoints in nodes serve as specific reference points within the blockchain, allowing nodes to synchronize more efficiently when joining or rejoining the network. Instead of processing the entire blockchain from the genesis block, nodes can start from a known, validated state. Below is a detailed guide on how to set up checkpoints. + +## Syncing a Node from a Checkpoint + +Before proceeding, ensure you have completed the [Node Setup](../nodes/nodes.md#setting-up-your-environment-and-building-zq2-node) section. + +For **prototestnet**, you will need the `zq2-prototestnet.toml` configuration file and the `start_node.sh` script, both generated during the setup process. Similarly, for **protomainnet**, you will use the `zq2-protomainnet.toml` configuration file. + +The following steps apply to both networks. + +### Step-by-Step Guide to Configure Checkpoints + +1. **Ensure Proper Directory** + Navigate to the directory you created during the setup process, e.g., `/my/dir/zq2`. + +2. **Download the Checkpoint File** + Follow these steps to download the latest checkpoint file for your chosen network: + + - **Prototestnet**: + Visit the public [checkpoint URL](https://checkpoints.zq2-prototestnet.zilliqa.com/). + + - **Protomainnet**: + Visit the public [checkpoint URL](https://checkpoints.zq2-protomainnet.zilliqa.com/). + + From the XML file at the respective URL: + - Look for the `` tag, which contains the checkpoint file's name. The file follows the `block_num.dat` format (e.g., `000291600.dat`). + - Copy the file name of the latest checkpoint from the topmost `` tag. For older checkpoints, explore the `previous/` directory. + - Download the checkpoint file using the `wget` command or paste the link in your browser: + ```bash + wget https://checkpoints.zq2-.zilliqa.com/ + ``` + Replace `` with `prototestnet` or `protomainnet` based on your selected network. + + **Note**: It is recommended to use the latest checkpoint file to speed up synchronization. + +3. **Configure Checkpoints in the Configuration File** + Open the respective configuration file (`zq2-prototestnet.toml` or `zq2-protomainnet.toml`) and add the following lines to enable checkpoint settings: + ```toml + [nodes.load_checkpoint] + file = "xxxxx..." # File name of the checkpoint block. for eg: 3000.dat + hash = "xxxxx..." # Block hash corresponding to the file block (Remove '0x' prefix from hash if present) + ``` + + `file` : This parameter specifies the name of the checkpoint or block number file, which + can be obtained from the public GCS bucket. It’s recommended to download the latest checkpoint + file from this source. + + `hash` : The hash is used to verify the validity of the state data and ensure that no + tampering has occurred. You can obtain the block hash corresponding to the checkpoint height from the + public explorer of your chosen network. For example, if the downloaded + checkpoint file is 3000, you can use the `eth_getBlockByNumber` API to query the block hash: + ```bash - wget https://checkpoints.zq2-prototestnet.zilliqa.com/ + curl --request POST --url https://api.zq2-prototestnet.zilliqa.com/ \ + --header 'Content-Type: application/json' \ + --data '{"method":"eth_getBlockByNumber","params":["0xBB8",false],"id":1,"jsonrpc":"2.0"}' \ + | grep -o '"hash":"[^"]*"' | awk -F':' '{print $2}' | tr -d '"' ``` -_NOTE : We recommend that node operators use the latest checkpoint file to speed up the syncing process._ - -3. **Configure Checkpoints in zq2-prototestnet.toml file:** -Open the `zq2-prototestnet.toml` file and add the following lines to enable - checkpoint settings: -```toml -[nodes.load_checkpoint] -file = "xxxxx..." # File name of the checkpoint block. for eg: 3000.dat -hash = "xxxxx..." # Block hash corresponding to the file block (Remove '0x' prefix from hash if present) -``` -`file` : This parameter specifies the name of the checkpoint or block number file, which -can be obtained from the public GCS bucket. It’s recommended to download the latest checkpoint -file from this source. -`hash` : The hash is used to verify the validity of the state data and ensure that no -tampering has occurred. You can obtain the block hash corresponding to the checkpoint height from the -public [explorer](https://explorer.zq2-prototestnet.zilliqa.com/). For example, if the downloaded -checkpoint file is 3000, you can use the `eth_getBlockByNumber` API to query the block hash: -```bash -curl --request POST --url https://api.zq2-prototestnet.zilliqa.com/ \ ---header 'Content-Type: application/json' \ ---data '{"method":"eth_getBlockByNumber","params":["0xBB8",false],"id":1,"jsonrpc":"2.0"}' \ -| grep -o '"hash":"[^"]*"' | awk -F':' '{print $2}' | tr -d '"' -``` -Alternatively, you can retrieve the block hash directly from the public -[explorer](https://explorer.zq2-prototestnet.zilliqa.com/) by searching -for the block number. -By this stage, your checkpoints configuration should be set up in the `zq2-prototestnet.toml` file. + Alternatively, you can retrieve the block hash directly from the + public explorer of your chosen network by searching for the block number. + By this stage, your checkpoints configuration should be set up in the `zq2-prototestnet.toml` or `zq2-protomainnet.toml` file. + 4. **Launch the node** -Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/prototestnetnodes.md#start-the-node) section to start your node. +Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/nodes.md#start-the-node) section to start your node. diff --git a/zq2/docs/nodes/index.md b/zq2/docs/nodes/index.md index e6defba..01a8f63 100644 --- a/zq2/docs/nodes/index.md +++ b/zq2/docs/nodes/index.md @@ -4,4 +4,8 @@ title: Overview of Nodes & Validators --- # Zilliqa nodes and validator documentation -This section provides documentation on nodes and outlines the process of becoming a validator in the Zilliqa Proof of Stake network. \ No newline at end of file +This section serves as a comprehensive guide to Zilliqa nodes and explains the process of becoming a validator in the Zilliqa Proof of Stake network. + +The documentation provides a step-by-step guide to setting up a node in the ZQ2 network and joining as a validator node in both the Zilliqa prototestnet and protomainnet networks. While prototestnet is used as the reference network throughout this guide, the instructions are equally applicable to the protomainnet network. + +For more details, please refer to the [Networks section](../endpoints.md#networks). \ No newline at end of file diff --git a/zq2/docs/nodes/nodefaq.md b/zq2/docs/nodes/nodefaq.md index 9e2df8c..84cb20e 100644 --- a/zq2/docs/nodes/nodefaq.md +++ b/zq2/docs/nodes/nodefaq.md @@ -35,7 +35,7 @@ If you see the following error message in the logs. The workaround at present is as follows. In the `zq2-prototestnet.toml` file, append following settings in the `[nodes.consensus]` section and -[start the node](../nodes/prototestnetnodes.md#start-the-node). +[start the node](../nodes/nodes.md#start-the-node). ```bash ... # some content [nodes.consensus] diff --git a/zq2/docs/nodes/prototestnetnodes.md b/zq2/docs/nodes/prototestnetnodes.md index 6d7f36d..1b15156 100644 --- a/zq2/docs/nodes/prototestnetnodes.md +++ b/zq2/docs/nodes/prototestnetnodes.md @@ -3,7 +3,7 @@ id: nodes/prototestnetnodes title: Prototestnet nodes --- -# Prototestnet Nodes +# Nodes The current proto-testnet version of Zilliqa 2.0 allows users to setup a node and join the network. diff --git a/zq2/mkdocs.in.yaml b/zq2/mkdocs.in.yaml index 5985bac..c60f852 100644 --- a/zq2/mkdocs.in.yaml +++ b/zq2/mkdocs.in.yaml @@ -5,7 +5,7 @@ nav: - Endpoints, Block Explorer & Faucet: endpoints.md - Nodes & Validators: - Overview: nodes/index.md - - Prototestnet Nodes: nodes/prototestnetnodes.md + - Nodes: nodes/prototestnetnodes.md - Checkpoints: nodes/checkpoint.md - Node FAQ: nodes/nodefaq.md - Tools and SDKs: sdk.md From 745f00e12b6985843dc2ed784be9d74f0c830e4b Mon Sep 17 00:00:00 2001 From: Chetan Phirke Date: Wed, 27 Nov 2024 17:11:36 +0530 Subject: [PATCH 2/6] fix broken links --- zq2/docs/nodes/checkpoint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zq2/docs/nodes/checkpoint.md b/zq2/docs/nodes/checkpoint.md index 56bf727..38a4945 100644 --- a/zq2/docs/nodes/checkpoint.md +++ b/zq2/docs/nodes/checkpoint.md @@ -68,4 +68,4 @@ The following steps apply to both networks. By this stage, your checkpoints configuration should be set up in the `zq2-prototestnet.toml` or `zq2-protomainnet.toml` file. 4. **Launch the node** -Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/nodes.md#start-the-node) section to start your node. +Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/prototestnetnodes.md#start-the-node) section to start your node. From 6e879d541687729043dfe1f1253ba1290f985fbc Mon Sep 17 00:00:00 2001 From: Chetan Phirke Date: Wed, 27 Nov 2024 20:17:54 +0530 Subject: [PATCH 3/6] update --- zq2/docs/nodes/checkpoint.md | 2 +- zq2/docs/nodes/{prototestnetnodes.md => node.md} | 13 ++++++++++++- zq2/mkdocs.in.yaml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) rename zq2/docs/nodes/{prototestnetnodes.md => node.md} (96%) diff --git a/zq2/docs/nodes/checkpoint.md b/zq2/docs/nodes/checkpoint.md index 38a4945..56bf727 100644 --- a/zq2/docs/nodes/checkpoint.md +++ b/zq2/docs/nodes/checkpoint.md @@ -68,4 +68,4 @@ The following steps apply to both networks. By this stage, your checkpoints configuration should be set up in the `zq2-prototestnet.toml` or `zq2-protomainnet.toml` file. 4. **Launch the node** -Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/prototestnetnodes.md#start-the-node) section to start your node. +Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/nodes.md#start-the-node) section to start your node. diff --git a/zq2/docs/nodes/prototestnetnodes.md b/zq2/docs/nodes/node.md similarity index 96% rename from zq2/docs/nodes/prototestnetnodes.md rename to zq2/docs/nodes/node.md index 1b15156..a15fb5f 100644 --- a/zq2/docs/nodes/prototestnetnodes.md +++ b/zq2/docs/nodes/node.md @@ -1,5 +1,5 @@ --- -id: nodes/prototestnetnodes +id: nodes/nodes title: Prototestnet nodes --- @@ -19,6 +19,17 @@ and join the network. - **Disk**: - 100 GB or more +## Zilliqa 2.0 (proto-mainnet) node Prerequisites + +### [Hardware requirements](#hardware-requirements) + +- **CPU**: + - 4 Core / 8 threads or more +- **RAM**: + - 16 GB or more +- **Disk**: + - 300 GB or more + We are running our Zilliqa 2.0 Nodes on Google Cloud Platform, GCP, GCE VM `e2-standard-2` instance with 256 GB SSD (`pd-ssd`). diff --git a/zq2/mkdocs.in.yaml b/zq2/mkdocs.in.yaml index c60f852..3f93101 100644 --- a/zq2/mkdocs.in.yaml +++ b/zq2/mkdocs.in.yaml @@ -5,7 +5,7 @@ nav: - Endpoints, Block Explorer & Faucet: endpoints.md - Nodes & Validators: - Overview: nodes/index.md - - Nodes: nodes/prototestnetnodes.md + - Nodes: nodes/node.md - Checkpoints: nodes/checkpoint.md - Node FAQ: nodes/nodefaq.md - Tools and SDKs: sdk.md From 738c2d2b600c48e789218953c07c0ec919b46546 Mon Sep 17 00:00:00 2001 From: Chetan Phirke Date: Thu, 28 Nov 2024 12:20:51 +0530 Subject: [PATCH 4/6] add more info --- zq2/docs/endpoints.md | 13 +++++++------ zq2/docs/nodes/checkpoint.md | 2 +- zq2/docs/nodes/node.md | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/zq2/docs/endpoints.md b/zq2/docs/endpoints.md index c15edd6..fbb0c66 100644 --- a/zq2/docs/endpoints.md +++ b/zq2/docs/endpoints.md @@ -30,10 +30,10 @@ Add Zilliqa 2 EVM proto-mainnet Details for the current network versions of Zilliqa 2.0 are listed below.
-| Name | Version | ChainId | API | Otterscan | Faucet | -| ------ | ------- | ------- | --- | --------- | ------ | -| proto-testnet | v0.1.0 | 33103 | https://api.zq2-prototestnet.zilliqa.com | https://explorer.zq2-prototestnet.zilliqa.com | https://faucet.zq2-prototestnet.zilliqa.com | -| proto-mainnet | v0.1.0 | 32770 | https://api.zq2-protomainnet.zilliqa.com | https://explorer.zq2-protomainnet.zilliqa.com | https://faucet.zq2-protomainnet.zilliqa.com | +| Name | Version | ChainId | API | Otterscan | Faucet | Checkpoint Bucket | +| ------ | ------- | ------- | --- | --------- | ------ | ----------------- | +| proto-testnet | v0.1.0 | 33103 | https://api.zq2-prototestnet.zilliqa.com | https://explorer.zq2-prototestnet.zilliqa.com | https://faucet.zq2-prototestnet.zilliqa.com | https://checkpoints.zq2-prototestnet.zilliqa.com | +| proto-mainnet | v0.1.0 | 32770 | https://api.zq2-protomainnet.zilliqa.com | https://explorer.zq2-protomainnet.zilliqa.com | https://faucet.zq2-protomainnet.zilliqa.com | https://checkpoints.zq2-protomainnet.zilliqa.com |
_**Note** that this is currently a proto-testnet and proto-mainnet versions of Zilliqa 2.0 designed primarily for testing purposes, and therefore its state and uptime are not guaranteed_ @@ -42,8 +42,9 @@ _**Note** that this is currently a proto-testnet and proto-mainnet versions of Z The current version of Zilliqa 2.0 is compatible with the Otterscan block explorer and does not support Devex. -The block explorer for the Zilliqa 2.0 proto-testnet is [available here](https://explorer.zq2-prototestnet.zilliqa.com/). -The block explorer for the Zilliqa 2.0 proto-mainnet is [available here](https://explorer.zq2-protomainnet.zilliqa.com/). +- Proto-testnet: [Prototestnet Explorer URL](https://explorer.zq2-prototestnet.zilliqa.com). + +- Proto-mainnet: [Protomainnet Explorer URL](https://explorer.zq2-protomainnet.zilliqa.com). ## [Faucet](#faucet) diff --git a/zq2/docs/nodes/checkpoint.md b/zq2/docs/nodes/checkpoint.md index 56bf727..ca65696 100644 --- a/zq2/docs/nodes/checkpoint.md +++ b/zq2/docs/nodes/checkpoint.md @@ -68,4 +68,4 @@ The following steps apply to both networks. By this stage, your checkpoints configuration should be set up in the `zq2-prototestnet.toml` or `zq2-protomainnet.toml` file. 4. **Launch the node** -Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/nodes.md#start-the-node) section to start your node. +Now the node is ready to launch. Follow the instructions in the [Start the Node](../nodes/node.md#start-the-node) section to start your node. diff --git a/zq2/docs/nodes/node.md b/zq2/docs/nodes/node.md index a15fb5f..60ad24e 100644 --- a/zq2/docs/nodes/node.md +++ b/zq2/docs/nodes/node.md @@ -10,7 +10,7 @@ and join the network. ## Zilliqa 2.0 (proto-testnet) node Prerequisites -### [Hardware requirements](#hardware-requirements) +### [Hardware requirements](#hardware-requirements-prototestnet) - **CPU**: - 1 Core / 2 threads or more @@ -21,7 +21,7 @@ and join the network. ## Zilliqa 2.0 (proto-mainnet) node Prerequisites -### [Hardware requirements](#hardware-requirements) +### [Hardware requirements](#hardware-requirements-protomainnet) - **CPU**: - 4 Core / 8 threads or more From 553025e5064b17a898c25655d28262d723cd1004 Mon Sep 17 00:00:00 2001 From: Chetan Phirke Date: Thu, 28 Nov 2024 12:23:26 +0530 Subject: [PATCH 5/6] update --- zq2/docs/nodes/nodefaq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zq2/docs/nodes/nodefaq.md b/zq2/docs/nodes/nodefaq.md index 84cb20e..1ca550c 100644 --- a/zq2/docs/nodes/nodefaq.md +++ b/zq2/docs/nodes/nodefaq.md @@ -35,7 +35,7 @@ If you see the following error message in the logs. The workaround at present is as follows. In the `zq2-prototestnet.toml` file, append following settings in the `[nodes.consensus]` section and -[start the node](../nodes/nodes.md#start-the-node). +[start the node](../nodes/node.md#start-the-node). ```bash ... # some content [nodes.consensus] From fd3f9bb6fb4714c94733e17c4ad594834a601995 Mon Sep 17 00:00:00 2001 From: Chetan Phirke Date: Thu, 28 Nov 2024 12:42:55 +0530 Subject: [PATCH 6/6] Update --- zq2/docs/nodes/checkpoint.md | 4 ++-- zq2/docs/nodes/node.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/zq2/docs/nodes/checkpoint.md b/zq2/docs/nodes/checkpoint.md index ca65696..678a013 100644 --- a/zq2/docs/nodes/checkpoint.md +++ b/zq2/docs/nodes/checkpoint.md @@ -63,8 +63,8 @@ The following steps apply to both networks. --data '{"method":"eth_getBlockByNumber","params":["0xBB8",false],"id":1,"jsonrpc":"2.0"}' \ | grep -o '"hash":"[^"]*"' | awk -F':' '{print $2}' | tr -d '"' ``` - Alternatively, you can retrieve the block hash directly from the - public explorer of your chosen network by searching for the block number. + Alternatively, you can retrieve the block hash directly from the public explorer of your chosen network by searching for the block number. + Refer to [block explorers](../endpoints.md#block-explorer) section for public explorer. By this stage, your checkpoints configuration should be set up in the `zq2-prototestnet.toml` or `zq2-protomainnet.toml` file. 4. **Launch the node** diff --git a/zq2/docs/nodes/node.md b/zq2/docs/nodes/node.md index 60ad24e..b423f5b 100644 --- a/zq2/docs/nodes/node.md +++ b/zq2/docs/nodes/node.md @@ -134,6 +134,7 @@ There are two methods for setting the synchronization rules for the node. chmod +x start_node.sh && \ ./start_node.sh -k $PRIVATE_KEY -p ``` + _NOTE: The `` file is the one you previously downloaded. Refer to [syncing-from-checkpoint](../nodes/checkpoint.md#syncing-a-node-from-a-checkpoint)_ Great! The node should now be syncing with the network. It may