arrows-to-dotZK-node

Authors: [man4ela | catapulta.eth]

System Requirements

CPU
OS
RAM
DISK

4+ cores CPU

Debian 12/Ubuntu 22.04

=> 16 GB RAM

1TB+ (SSD or NVMe)

circle-info

The X Layer archive node has a size of 560GB on November 18th, 2024

Setup XLayer Node

X Layer is an EVM-compatible Layer 2 network built with Polygon CDK, using Zero-Knowledge (ZK) technology to enhance Ethereum’s scalability, security, and efficiency

circle-exclamation

Pre-Requisties

sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y

sudo apt install build-essential libbenchmark-dev libomp-dev libgmp-dev nlohmann-json3-dev postgresql libpqxx-dev libpqxx-doc nasm libsecp256k1-dev grpc-proto libsodium-dev libprotobuf-dev libssl-dev cmake libgrpc++-dev protobuf-compiler protobuf-compiler-grpc uuid-dev
circle-info

Important dependency note: You must install libpqxx version 6.4.5. If your distribution installs a newer version, please compile libpqxx 6.4.5 and install it manually instead

Use dpkg to check the Installed version of libpqxx:

dpkg -l | grep libpqxx

Setting up Firewall

Set explicit default UFW rules

Allow SSH

Allow remote RPC connections with Blast Node

circle-exclamation

Enable Firewall

To check the status of UFW and see the current rules

Install GO

circle-info

Go version 1.21+ is required to build ZKnode

Build ZKnode

Move the xlayer-node binary from the build directory to the designated directory for execution:

Download ZKnode configuration and genesis.json file:

Carefully change the following parameters inside configuration file:

[State.DB]

Host = "xlayer-mainnet-state-db"

#specify Host = "127.0.0.1"

[Pool.DB]

Host = "xlayer-mainnet-pool-db"

#specify Host = "127.0.0.1"

[Etherman]

URL = ""

#input your synced L1 Ethereum RPC endpoint

[Synchronizer]

SyncInterval = "1s"

SyncChunkSize = 100

#add a line L1SynchronizationMode = "sequential"

[MTClient]

URI = "xlayer-mainnet-prover:50061"

#specify URI = "127.0.0.1:50061"

[Executor]

URI = "xlayer-mainnet-prover:50071"

#specify URI = "127.0.0.1:50071"

[Metrics]

Host = "0.0.0.0"

#specify Host = "127.0.0.1"

[HashDB]

Host = "xlayer-mainnet-state-db"

#specify Host = "127.0.0.1"

Compile and build ZKProver

Download necessary files

Download an archive (~75GB). It's a good idea to have it running in the screensession:

The archive will take up an additional 115GB of space once extracted.

Consider to recompile the protobufs:

Run make to compile the main project:

circle-exclamation

Test Vectors

Download configuration files:

Modify prover.config.json:

Replace

with

Create systemd files for the ZKEVM Node components

Zknode:

Paste the configs and save by entering ctrl+X and Y+ENTER:

Synchronizer:

and ZKProver:

Configure Postgresql for ZKProver

Make sure to be inside /root/zknode/zkevm-prover/ directory:

chevron-rightExample of expected outputhashtag

Depending on your Postgresql version (14 or 15) update postgresql.conf:

Set max_connections = 500

Save, Quit and reload postgresql to apply changes by running:

Launch X Layer node:

Monitor logs

During the synchonization, you are expected to get following log messages:

ZKNode:

ZKProver:

Synchronizer:

Run curl command in the terminal to check the status of your node

When it returns false then your node is fully synchronized with the network

References

Last updated