Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 35 additions & 34 deletions zq2/docs/nodes/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,47 +52,46 @@ To configure a node and join a Zilliqa 2.0 network, we provide the `z2` utility
base. Follow the step by step guide to setup your node:

1. Cargo and Rust: You need to have Cargo and Rust installed on your system.
You can install them using [rustup](https://rustup.rs/). Once rustup is installed,
you can update Rust to the latest stable version.
You can install them using [rustup](https://rustup.rs/). Once rustup is installed,
you can update Rust to the latest stable version.
2. Install the following requirements:
```bash
sudo add-apt-repository ppa:ethereum/ethereum && sudo apt update && \
sudo apt install -y solc build-essential pkg-config libssl-dev cmake \
protobuf-compiler
```
```bash
sudo add-apt-repository ppa:ethereum/ethereum && sudo apt update && \
sudo apt install -y solc build-essential pkg-config libssl-dev cmake \
protobuf-compiler
```
3. Pick a directory. You'll need quite a lot of space. Let's call it `/my/dir`.
4. Clone [zq2](https://github.com/zilliqa/zq2) sourcecode into that directory to get `/my/dir/zq2`.

5. Build the code using `cargo build`.
6. Source the setenv file:
```bash
source /my/dir/zq2/scripts/setenv
```
This will give you access to the `z2` tool (in `zq2/z2`).
```bash
source /my/dir/zq2/scripts/setenv
```
This will give you access to the `z2` tool (in `zq2/z2`).
7. Generate the startup script and the configuration file for your node by running:
```bash
z2 join --chain zq2-mainnet
```
_NOTE: You can replace zq2-mainnet with `zq2-testnet` or `zq2-devnet` depending on
which network you want your node to join._

```bash
z2 join --chain zq2-mainnet
```
_NOTE: You can replace `zq2-mainnet` with `zq2-testnet` or `zq2-devnet` depending on
which network you want your node to join._
8. (Optional) A Zilliqa node contains various performance and operational metrics compatible with the OpenTelemetry
protocol specification. If you want to export these metrics you can define a [collector](https://opentelemetry.io/docs/collector/)
endpoint with the `--otlp-endpoint` parameter in `z2 join` pointing to your own OpenTelemetry monitoring stack, for example:
```bash
z2 join --chain zq2-mainnet --otlp-endpoint=http://localhost:4317
```
_NOTE: For more details on testing and using the available OpenTelemetry
metrics refer to the [OpenTelemetry](monitoring/opentelemetry.md) page._
protocol specification. If you want to export these metrics you can define a [collector](https://opentelemetry.io/docs/collector/)
endpoint with the `--otlp-endpoint` parameter in `z2 join` pointing to your own OpenTelemetry monitoring stack, for example:
```bash
z2 join --chain zq2-mainnet --otlp-endpoint=http://localhost:4317
```
_NOTE: For more details on testing and using the available OpenTelemetry
metrics refer to the [OpenTelemetry](monitoring/opentelemetry.md) page._

9. Generate the node private key.
```bash
openssl rand -hex 32 > node-private-key.txt
export PRIVATE_KEY=$(cat node-private-key.txt)
```
_NOTE: Please save the node key as described above. You may need it
in the future to restart the node to generate the BLS public
key of the node._
```bash
openssl rand -hex 32 > node-private-key.txt
export PRIVATE_KEY=$(cat node-private-key.txt)
```
_NOTE: Please save the node key as described above. You may need it
in the future to restart the node to generate the BLS public
key of the node._

10. Now it's time to synchronize the node with the network. For networks created using Zilliqa 2, the node can be synchronized from the genesis. However, for networks such as mainnet and testnet that migrated from Zilliqa 1, the node must be synchronized from a checkpoint:

Expand All @@ -109,13 +108,13 @@ Please refer to [Syncing & Pruning](../nodes/passive-pruning.md) for information
### [Starting your node](#starting-your-node)
Since only devnet nodes can sync from the genesis, all other nodes must be started from a checkpoint:

* <b>start the node from a checkpoint:</br></b>
* <b>start the node from a checkpoint:</b>
```bash
chmod +x start_node.sh && \
./start_node.sh -k $PRIVATE_KEY -p <checkpoint_block_num.dat>
```

* <b>start the node from the genesis:</br></b>
* <b>start the node from the genesis:</b>
```bash
chmod +x start_node.sh && \
./start_node.sh -k $PRIVATE_KEY
Expand Down Expand Up @@ -158,6 +157,8 @@ Below is a guide on how to register a validator node for Zilliqa 2.0:

### [Upgrading your node](#upgrading-your-node)

> **Note for ZQ2 Testnet Operators:** The activation block height for the `deposit_v7` contract upgrade has been postponed from `16,934,100` to `17,010,000`. Please ensure your node is running the latest version to stay in sync with the network after this block height.

You should try to keep your node version up-to-date with the latest released version of Zilliqa 2.0.
You can stay informed of new releases via the [repository release page](https://github.com/Zilliqa/zq2/releases).

Expand All @@ -181,7 +182,7 @@ docker pull asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-public/zq
Stop your existing node:

```bash
docker container ls # Identify the container ID of the existing node. This will look a 12 character hex-string (e.g. af6010f3f9ae).
docker container ls # Identify the container ID of the existing node. This will look a 12 charachter hex-string (e.g. af6010f3f9ae).
docker stop <container id>
```

Expand Down
Loading