Skip to content

Commit ce013e3

Browse files
authored
Mainnet support (#57)
Closes: https://linear.app/thesis-co/issue/TET-607/mainnet-support-in-v-kit Here we adjust all V-Kit components and documentation to support the incoming Mezo Mainnet. I recommend reviewing commit-by-commit to better understand all the changes.
2 parents 192540b + 4b06388 commit ce013e3

25 files changed

+255
-11268
lines changed

README.md

Lines changed: 94 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
## Overview
77

88
This repository contains the Validator Kit for Mezo chain. The Validator Kit is
9-
a collection of tools and documentation to help you run a validator node on Mezo chain.
9+
a collection of tools and documentation to help you run a Mezo chain node.
10+
11+
Although the Validator Kit is primarily designed for validator nodes, it can be
12+
used to run [non-validator nodes](#non-validator-nodes) as well.
1013

1114
### Main components
1215

@@ -27,13 +30,10 @@ As a validator you can choose between the above options to run your validator no
2730

2831
### Auxiliary components
2932

30-
Moreover, there are several auxiliary components of the Validator Kit that
31-
can help you with various operational tasks:
33+
Moreover, there are auxiliary components of the Validator Kit that can help you with various
34+
operational tasks:
3235

33-
1. [`tools`](./tools): provides a collection of Hardhat tasks designed to simplify
34-
interactions with the blockchain’s Proof-of-Authority (PoA) based network.
35-
For example, you can submit your application to become one of the PoA validators.
36-
2. [`docker-monitoring`](./docker-monitoring): contains files to run a monitoring
36+
1. [`docker-monitoring`](./docker-monitoring): contains files to run a monitoring
3737
stack for your validator node using Docker. This is an optional way to monitor
3838
your validator node. The monitoring stack is dedicated to the `docker` setup.
3939
You can use it for the `native` variant after some adjustments (not covered in this repo).
@@ -42,15 +42,30 @@ can help you with various operational tasks:
4242

4343
Regardless of the chosen way to run a validator node, you may want to use
4444
pre-built artifacts provided by the Mezo team. These include Docker images and
45-
binary files for the `mezod` node software.
45+
binary files for the `mezod` node software. Alternatively, you can build the
46+
necessary artifacts yourself.
47+
48+
### Stable releases (Mainnet)
49+
50+
Stable releases are ready to be rolled out on Mainnet nodes. You can find relevant
51+
artifacts in the following locations (substitute `VERSION` with the desired
52+
stable version, e.g. `v1.0.0`):
53+
54+
- Docker image (DockerHub): `mezo/mezod:VERSION`
55+
- Binary (amd64): `https://github.com/mezo-org/mezod/releases/download/VERSION/linux-amd64.tar.gz`
56+
57+
### Candidate releases (Testnet)
58+
59+
>[!WARNING]
60+
> Candidate releases are **NOT READY** for Mainnet use.
61+
62+
Candidate releases are intended to be rolled out on Testnet nodes. You can find
63+
relevant artifacts in the following locations (substitute `VERSION` with the
64+
desired candidate version, e.g. `v1.0.0-rc0`):
4665

47-
You can find the mentioned artifacts in the following locations (substitute
48-
`VERSION` with the desired version, e.g. `v0.5.0-rc0`):
4966
- Docker image: `us-central1-docker.pkg.dev/mezo-test-420708/mezo-staging-docker-public/mezod:VERSION`
5067
- Binary (amd64): `https://artifactregistry.googleapis.com/download/v1/projects/mezo-test-420708/locations/us-central1/repositories/mezo-staging-binary-public/files/mezod:VERSION:linux-amd64.tar.gz:download?alt=media`
5168

52-
Alternatively, you can build the necessary artifacts yourself.
53-
5469
## Node synchronization
5570

5671
There are two ways to synchronize your node with the Mezo blockchain.
@@ -67,15 +82,20 @@ a long time depending on your network connection and the number of blocks in
6782
the network. Moreover, you need to start with the initial version
6883
of `mezod` and upgrade along the way to handle on-chain upgrades properly.
6984

70-
Version ordering for Mezo Matsnet testnet:
85+
#### Version ordering for Mezo Matsnet testnet
86+
7187
- `v0.2.0-rc3`: initial version from genesis to block 1093500
7288
- `v0.3.0-rc3`: from block 1093500 to block 1745000
7389
- `v0.4.0-rc1`: from block 1745000 to block 2213000
7490
- `v0.5.0-rc1`: from block 2213000 to block 2563000
7591
- `v0.6.0-rc2`: from block 2563000 to block 3078794
7692
- `v0.7.0-rc0`: from block 3078794 to block 3569000
7793
- `v1.0.0-rc0`: from block 3569000 to block 3712500
78-
- `v1.0.0-rc*`: from block 3712500 to the current chain tip (pick the latest `-rc*`)
94+
- `v1.0.0-rc1`: from block 3712500 to the current chain tip
95+
96+
#### Version ordering for Mezo Mainnet
97+
98+
- `v1.*.*`: from genesis to the current chain tip (pick the latest minor/patch version)
7999

80100
### State sync from snapshot
81101

@@ -90,32 +110,70 @@ apply the snapshot to get the latest state of the chain. The downside here
90110
is the fact that your node won't have the chain history prior to the snapshot.
91111
Moreover, you need to trust the source of the snapshot.
92112

93-
Mezo team provides snapshots for Mezo Matsnet testnet. Please refer to
94-
[this runbook](./manual/README.md#State-sync-from-snapshot)
95-
for details. Alternatively, you can ask trusted community members for a snapshot.
113+
Mezo team provides snapshots only for Mezo Matsnet testnet. Mezo team **DOES NOT**
114+
provide snapshots for Mezo Mainnet. In any case, you can ask trusted community members
115+
for a snapshot.
116+
117+
Please refer to [this runbook](./manual/README.md#State-sync-from-snapshot)
118+
to learn how to sync your node from a snapshot in practice.
96119

97120
## PoA application submission
98121

99122
The final step to becoming a PoA validator is submitting your application to the Mezo
100-
team. Before you proceed, ensure you have sufficient funds in your validator's node
101-
address. You have several ways to submit your application:
102-
103-
1. Using a CLI command exposed by `mezod` (recommended):
104-
```bash
105-
mezod --home=<mezod_home_path> poa submit-application <key_name>
106-
```
107-
where `key_name` denotes the private key from your node's keyring that
108-
corresponds to the aforementioned validator's node address.
109-
110-
2. Alternatively, you can run the `submit-application.sh` script from the
111-
[tools/hardhat](tools/hardhat/README.md#how-to-submit-an-application-to-validator-pool) toolbox.
112-
113-
Both options are valid, and you can choose either. Once you submit your application,
114-
the Mezo team will verify your node status and approve your application if everything
115-
is in order. Please provide your public IP, your node address, and any custom port
116-
settings. If you wish to close the CometBFT RPC port (note that the CometBFT
117-
P2P port must remain open), please whitelist the following IP
118-
address: `34.57.120.151` so that we can verify your status.
123+
team. Before you proceed, ensure you have sufficient funds on your validator's node
124+
address. You can submit your application using a CLI command exposed by `mezod`:
125+
126+
```bash
127+
mezod --home=<mezod_home_path> poa submit-application <key_name>
128+
```
129+
where `key_name` denotes the private key from your node's keyring that corresponds to
130+
the aforementioned validator's node address.
131+
132+
Once you submit your application, the Mezo team will verify your node status and approve
133+
your application if everything is in order. Please provide your public IP, your node address,
134+
and any custom port settings. If you wish to close the CometBFT RPC port (note that the
135+
CometBFT P2P port must remain open), please whitelist the following IP address: `34.57.120.151`
136+
so that we can verify your status.
137+
138+
## Non-validator nodes
139+
140+
### Network seed nodes
141+
142+
If you want to run a seed node to help network peer discovery, follow the configuration
143+
process as for a validator node but:
144+
- Do not submit an application to PoA.
145+
- Set the `p2p.seed_mode` parameter in your node's `config.toml` file to `true`.
146+
147+
Ensure your CometBFT P2P port is open and accessible from the outside.
148+
This is `26656` by default, but can be changed using the `p2p.laddr` or
149+
`p2p.external_address` parameters in the `config.toml` file.
150+
151+
### RPC node
152+
153+
To run an RPC node (serving both EVM JSON-RPC and CometBFT RPC), follow the configuration
154+
process as for a validator node but:
155+
- Do not submit an application to PoA.
156+
- If you want to run an archiving node (i.e. with full history of the chain),
157+
set the `pruning` parameter in your node's `app.toml` file to `nothing`.
158+
159+
Ensure the following ports are open and accessible from the outside:
160+
- EVM JSON-RPC HTTP port: `8545` by default. Can be changed using the
161+
`json-rpc.address` parameter in the `app.toml` file.
162+
- EVM JSON-RPC WebSocket port: `8546` by default. Can be changed using the
163+
`json-rpc.ws-address` parameter in the `app.toml` file.
164+
- CometBFT RPC port: `26657` by default. Can be changed using the `rpc.laddr`
165+
parameter in the `config.toml` file.
166+
167+
## Hardware requirements
168+
169+
Here are the minimum recommended hardware requirements for running different
170+
types of Mezo chain nodes:
171+
172+
| Node Type | vCPU | RAM | Disk |
173+
|-----------|------|-------|---------|
174+
| Validator | 4 | 16 GB | 256 GB |
175+
| RPC | 8 | 32 GB | 512 GB |
176+
| Seed | 2 | 8 GB | 128 GB |
119177

120178
## Acknowledgements
121179

docker/README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44

55
The following instruction will guide you through the process of configuring
66
and running a validator node. Before continuing, decide which network you want
7-
to join. There are two options: `testnet` and `mainnet`. The following
8-
instruction will use `testnet` as an example.
7+
to join. There are two options: `testnet` and `mainnet`.
8+
9+
> [!IMPORTANT]
10+
> The following instruction uses `mainnet` environment as an example.
11+
> For `testnet`, follow the same steps but use `testnet.env`
12+
> (from the `testnet.env.example` template) as your configuration file and
13+
> explicitly set the `NETWORK=testnet` environment variable while running
14+
> the `v-kit.sh` script.
915
1016
> [!NOTE]
1117
> Run `./v-kit.sh` (without arguments) to see the list of available commands.
@@ -14,7 +20,7 @@ instruction will use `testnet` as an example.
1420

1521
```mermaid
1622
sequenceDiagram
17-
participant testnet.env
23+
participant mainnet.env
1824
participant v-kit.sh
1925
box Docker Compose
2026
participant compose.yaml
@@ -23,8 +29,8 @@ sequenceDiagram
2329
participant mezod-and-sidecars as Service 'mezod' with sidecars
2430
end
2531
26-
Note over testnet.env: (USER) Adjust the configuration
27-
v-kit.sh -->> testnet.env: load
32+
Note over mainnet.env: (USER) Adjust the configuration
33+
v-kit.sh -->> mainnet.env: load
2834
2935
critical One-time setup
3036
v-kit.sh ->> compose.yaml: v-kit.sh init-keyring
@@ -46,13 +52,13 @@ sequenceDiagram
4652

4753
### 1. Prepare configuration file
4854

49-
1. Copy the `testnet.env.example` to `testnet.env`:
50-
55+
#### Copy the `mainnet.env.example` to `mainnet.env`
56+
5157
```shell
52-
cp testnet.env.example testnet.env
58+
cp mainnet.env.example mainnet.env
5359
```
5460

55-
2. Edit the `testnet.env` file:
61+
#### Edit the `mainnet.env` file
5662

5763
* `NETWORK` - the network you want to join (`testnet` or `mainnet`)
5864
* `DOCKER_IMAGE` - the latest version of mezod image
@@ -107,11 +113,11 @@ The URL must be WebSocket, i.e. start with `wss://` (recommended) or `ws://`.
107113
./v-kit.sh init-genval
108114
```
109115

110-
### 3. Submit joining request
116+
### 3. Submit PoA application
111117

112-
TBD
118+
See [PoA application submission](../README.md#poa-application-submission) in the root README for details.
113119

114-
### 5. Run the validator
120+
### 4. Run the validator
115121

116122
```shell
117123
./v-kit.sh start
@@ -133,7 +139,8 @@ TBD
133139

134140
### Edit the configuration manually
135141

136-
Keep in mind that some parts of the configuration are managed by the [entrypoint.sh](./entrypoint.sh) script
142+
Keep in mind that some parts of the configuration are managed by the
143+
[entrypoint.sh](https://github.com/mezo-org/mezod/blob/main/entrypoint.sh) script
137144
within the container. These parts will be overwritten when the container is started.
138145

139146
```shell

docker/compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ services:
4949
- ethereum-sidecar
5050
- --log_format=json
5151
- --ethereum-sidecar.server.ethereum-node-address=${MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS}
52+
- --ethereum-sidecar.server.network=${MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK}
5253
restart: always
5354
expose:
5455
- 7500

docker/mainnet.env.example

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# Docker
3+
#
4+
NETWORK=mainnet
5+
DOCKER_IMAGE="<change me>" # mezo/mezod:VERSION
6+
#DOCKER_LOG_DRIVER="json-file" # uncomment when running on MacOS
7+
8+
#
9+
# Network
10+
#
11+
PUBLIC_IP="<change me>"
12+
13+
#
14+
# Storage
15+
#
16+
LOCAL_BIND_PATH=/var/mezod
17+
18+
#
19+
# Keyring
20+
#
21+
KEYRING_NAME="localkey"
22+
KEYRING_PASSWORD="<change me>" # Can be generated. Check out README.md
23+
KEYRING_MNEMONIC="<change me>" # Can be generated. Check out README.md
24+
25+
#
26+
# Mezod
27+
#
28+
MEZOD_CHAIN_ID="mezo_31612-1"
29+
MEZOD_HOME="/var/mezod"
30+
MEZOD_MONIKER="<change me>"
31+
MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="<change me>" # Ethereum Mainnet WS RPC
32+
MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="mainnet"
33+
MEZOD_LOG_LEVEL=info
34+
MEZOD_LOG_FORMAT=json # json|plain
35+
MEZOD_PORT_P2P=26656 # Default. It should be changed in case of a custom setup
36+
37+
# Custom configuration
38+
#LOCAL_CUSTOM_CONF_APP_TOML="file/path"
39+
#MEZOD_CUSTOM_CONF_APP_TOML=/config/app.toml.txt
40+
#LOCAL_CUSTOM_CONF_CLIENT_TOML="file/path"
41+
#MEZOD_CUSTOM_CONF_CLIENT_TOML=/config/client.toml.txt
42+
#LOCAL_CUSTOM_CONF_CONFIG_TOML="file/path"
43+
#MEZOD_CUSTOM_CONF_CONFIG_TOML=/config/config.toml.txt

docker/testnet.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ MEZOD_CHAIN_ID="mezo_31611-1"
2929
MEZOD_HOME="/var/mezod"
3030
MEZOD_MONIKER="<change me>"
3131
MEZOD_ETHEREUM_SIDECAR_SERVER_ETHEREUM_NODE_ADDRESS="<change me>"
32+
MEZOD_ETHEREUM_SIDECAR_SERVER_NETWORK="sepolia"
3233
MEZOD_LOG_LEVEL=info
3334
MEZOD_LOG_FORMAT=json # json|plain
3435
MEZOD_PORT_P2P=26656 # Default. It should be changed in case of a custom setup

docker/v-kit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -o pipefail # Exit on pipe error
88
################################################################################
99
# Variables
1010
################################################################################
11-
NETWORK="${NETWORK:-testnet}"
11+
NETWORK="${NETWORK:-mainnet}"
1212
DOCKER_COMPOSE_CMD="docker compose --env-file ${NETWORK}.env"
1313

1414
# Load NETWORK.env

helm-chart/mezod/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v2
22
name: mezod
3-
version: 1.6.0
4-
appVersion: v1.0.0-rc1
3+
version: 2.0.0
4+
appVersion: v1.0.0

helm-chart/mezod/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Helm chart for Mezod
22

3-
The chart contains configuration for testnet on Sepolia so far.
4-
Eventually, it will be updated to support mainnet by default.
3+
The chart is configured for mainnet by default.
54

65
## Pre-requisites
76

@@ -37,18 +36,18 @@ kubectl -n <NAMESPACE> create secret generic <SECRET_NAME> \
3736
3837
# mezod
3938

40-
![Version: 1.6.0](https://img.shields.io/badge/Version-1.6.0-informational?style=flat-square) ![AppVersion: v1.0.0-rc1](https://img.shields.io/badge/AppVersion-v1.0.0--rc1-informational?style=flat-square)
39+
![Version: 2.0.0](https://img.shields.io/badge/Version-2.0.0-informational?style=flat-square) ![AppVersion: v1.0.0](https://img.shields.io/badge/AppVersion-v1.0.0-informational?style=flat-square)
4140

4241
## Values
4342

4443
| Key | Type | Default | Description |
4544
|-----|------|---------|-------------|
46-
| image | string | `"us-central1-docker.pkg.dev/mezo-test-420708/mezo-staging-docker-public/mezod"` | |
47-
| tag | string | `"v1.0.0-rc1"` | |
45+
| image | string | `"mezo/mezod"` | |
46+
| tag | string | `"v1.0.0"` | |
4847
| imagePullPolicy | string | `"Always"` | |
49-
| env.NETWORK | string | `"testnet"` | Select the network to connect to |
48+
| env.NETWORK | string | `"mainnet"` | Select the network to connect to (mainnet or testnet) |
5049
| env.PUBLIC_IP | string | `"CHANGE_ME"` | Set public IP address of the validator |
51-
| env.MEZOD_CHAIN_ID | string | `"mezo_31611-1"` | Set the chain ID (mezo_31611-1 is the testnet) |
50+
| env.MEZOD_CHAIN_ID | string | `"mezo_31612-1"` | Set the chain ID (mezo_31612-1 is mainnet, mezo_31611-1 is testnet) |
5251
| env.MEZOD_HOME | string | `"/var/mezod"` | |
5352
| env.MEZOD_MONIKER | string | `"CHANGE_ME"` | Set the moniker (name of the validator) |
5453
| env.MEZOD_ETHEREUM_SIDECAR_SERVER | string | `"localhost:7500"` | |

helm-chart/mezod/README.md.gotmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Helm chart for Mezod
22

3-
The chart contains configuration for testnet on Sepolia so far.
4-
Eventually, it will be updated to support mainnet by default.
3+
The chart is configured for mainnet by default.
54

65
## Pre-requisites
76

helm-chart/mezod/templates/statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ spec:
136136
- --home=/tmp/dummy-data
137137
- --log_format=json
138138
- --ethereum-sidecar.server.ethereum-node-address=$(ETHEREUM_ENDPOINT)
139+
{{- if eq .Values.env.NETWORK "mainnet" }}
140+
- --ethereum-sidecar.server.network=mainnet
141+
{{- else if eq .Values.env.NETWORK "testnet" }}
142+
- --ethereum-sidecar.server.network=sepolia
143+
{{- end }}
139144
env:
140145
- name: ETHEREUM_ENDPOINT
141146
valueFrom:

0 commit comments

Comments
 (0)