Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan-zilliqa committed Sep 9, 2024
1 parent 8091d47 commit 3d52e71
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 31 deletions.
34 changes: 5 additions & 29 deletions zq2/docs/nodes/checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ script, which is generated by the [setup node](../nodes/prototestnetvalidators.m
1. **Download the checkpoints file:**
Download the checkpoint file from the public [GCS bucket](https://console.cloud.google.com/storage/browser/zq2-devnet-checkpoint/data)
into the directory `/my/dir/zq2` that you previously created. Be aware that the bucket
contains multiple checkpoint state files. Select the most recent file from the bucket.
contains multiple checkpoint state files. Select the most recent file from the bucket.
The format of the file is `<block_number>.dat`
To determine the latest file, refer to the [explorer](https://explorer.zq2-prototestnet.zilliqa.com)
and choose the one closest to the current block number.

Expand All @@ -29,8 +30,8 @@ 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
hash = "xxxxx" # block hash corresponding to file block.
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
Expand All @@ -49,30 +50,5 @@ 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.
3. **Update the Validator Start Script**
Modify the validator start script file—start_validator.sh—to ensure that the Docker container can access the downloaded checkpoint file by mapping it within the Docker container.
Before:
```bash
start() {
docker rm zilliqa-${ZQ_VERSION} &> /dev/null || echo 0
docker run -td -p 3333:3333 -p 4201:4201 --net=host --name zilliqa-${ZQ_VERSION} \
-e RUST_LOG="zilliqa=debug" -e RUST_BACKTRACE=1 \
-v $(pwd)/$CHAIN_NAME.toml:/config.toml -v /zilliqa.log:/zilliqa.log -v $(pwd)/data:/data \
$ZQ2_IMAGE $NODE_PRIVATE_KEY --log-json
}
```
After (with the added line):
```bash
start() {
docker rm zilliqa-${ZQ_VERSION} &> /dev/null || echo 0
docker run -td -p 3333:3333 -p 4201:4201 --net=host --name zilliqa-${ZQ_VERSION} \
-e RUST_LOG="zilliqa=debug" -e RUST_BACKTRACE=1 \
-v $(pwd)/$CHAIN_NAME.toml:/config.toml -v /zilliqa.log:/zilliqa.log -v $(pwd)/data:/data \
-v /mydir/zq2/3001:/3000 \ # New line added here to mount the checkpoint file to docker container.
#Please make sure to replace correct file block number.
$ZQ2_IMAGE $NODE_PRIVATE_KEY --log-json
}
```
Notice the added line in the script, `-v /mydir/zq2/3000:/3000`, which mounts the checkpoint directory inside the Docker container. Be sure to replace `/mydir/zq2/3000` with the correct path to the checkpoint file based on the specific block number.
4. **Update the Validator Start Script**
3. **Launch the validator node**
Now the node is ready to launch. Follow the instructions in the [Start the Validator Node](../nodes/prototestnetvalidators.md#start-the-validator-node) section to start your node.
6 changes: 5 additions & 1 deletion zq2/docs/nodes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ title: Overview of Nodes & Validators
---

# Zilliqa nodes and validator documentation
This section provides validator documentation for the current release versions of Zilliqa 2.
This section provides validator documentation for the latest release versions of Zilliqa 2.

As noted in the documentation header, the guidelines apply to both validators and API nodes.

The process of starting a node is the same for both validators and API nodes (full nodes). Node operators can either stake 10 million ZILs to participate as PoS validator nodes, or choose to run API nodes without staking. For consistency, the term 'validator node' is used throughout the documentation."
9 changes: 8 additions & 1 deletion zq2/docs/nodes/prototestnetvalidators.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,16 @@ There are two methods for setting the synchronization rules for the validator.
You can now follow the steps below.

### [Start the validator node](#start-the-validator-node)
* Start the node Without Checkpoint:
```bash
chmod +x start_validator.sh && \
./start_validator.sh $PRIVATE_KEY
./start_validator.sh -k $PRIVATE_KEY
```

* Start the node Without Checkpoint:
```bash
chmod +x start_validator.sh && \
./start_validator.sh -k $PRIVATE_KEY -p <checkpoint_block_num.dat>
```

Great! The validator node should now be syncing with the network. It may
Expand Down
1 change: 1 addition & 0 deletions zq2/mkdocs.in.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ nav:
- Validators:
- Prototestnet Validators: nodes/prototestnetvalidators.md
- Checkpoints: nodes/checkpoint.md
- FAQs: nodes/faq.md
- Tools and SDKs: sdk.md
- APIs:
- apis/index.md
Expand Down

0 comments on commit 3d52e71

Please sign in to comment.