zksync-era-node-guide
zksync-era-node-guide copied to clipboard
Step-by-step guide to setting up a zkSync Era node. Easily start with Docker and Docker Compose.
zkSync Era Node Setup Guide
This guide explains step-by-step how to set up a zkSync Era node on Ubuntu Linux.
System Requirements
- CPU: A relatively modern CPU is recommended.
- RAM: 32 GB
- Storage: 300 GB, with the state growing about 1TB per month.
- Network: 100 Mbps connection (1 Gbps+ recommended)
Server Rental
If you need a server, you can rent one from Hetzner. Additionally, if you sign up using this referral link, you will receive a 20 EUR credit.
Step 1: Install Visual Studio Code (On Local Computer)
-
Download and Install Visual Studio Code: Visual Studio Code Download Page
- Once downloaded, follow the installation wizard to install Visual Studio Code.
-
Install the SSH Extension:
- Open Visual Studio Code.
- Click on the
Extensionsicon in the left sidebar. - Type
Remote - SSHin the search bar and install the extension developed by Microsoft.
Step 2: Connect to the Server via SSH (From Local Computer)
-
Connect to SSH in Visual Studio Code:
- Press
Ctrl+Shift+Pin Visual Studio Code and selectRemote-SSH: Connect to Host.... - Enter your server address in the format
ssh root@ip_address. - Enter your password or SSH key to complete the connection.
Note: Replace
ip_addresswith the actual IP address of your server. - Press
-
Verify the Connection:
- If the connection is successful, the name of the connected server will appear in the lower-left corner of the Visual Studio Code window.
-
Open the Terminal:
- After connecting to the server in Visual Studio Code, you can open the terminal by clicking on
Terminal>New Terminalin the top menu. - Alternatively, you can open the terminal by pressing
Ctrl+(Control key and the backtick key, located below the ESC key).
- After connecting to the server in Visual Studio Code, you can open the terminal by clicking on
Step 3: Install Docker and Docker Compose (On Server)
After successfully connecting to the server, execute these commands on the server.
Docker Installation
-
Update System Packages:
sudo apt update -
Install Docker:
sudo apt install docker.io -
Verify Docker Service is Running:
sudo systemctl status docker -
Verify Docker Installation:
docker --version
Docker Compose Installation
-
Download Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -
Give Execute Permission to Docker Compose:
sudo chmod +x /usr/local/bin/docker-compose -
Verify Installation:
docker-compose --version
Step 4: Start the zkSync Era Node (On Server)
-
Install Git (if not already installed):
sudo apt install git -
Clone the Repository:
git clone https://github.com/matter-labs/zksync-era.git -
Navigate to the Cloned Directories:
cd zksync-era/docs/guides/external-node cd docker-compose-examples -
Start the Node Using Docker Compose:
docker-compose -f mainnet-external-node-docker-compose.yml up -d -
Verify Running Containers:
docker psThis command lists currently running Docker containers. You should see the containers related to the
zkSync Eranode. -
View and Follow the Last 100 Logs:
docker logs -f --tail 100 docker-compose-examples_external-node_1
Press Ctrl+C to exit the log view. This will not stop your node; it will continue to run in the background.
Step 5: Access the Dashboard via Port Forwarding (On Local Computer)
After running Docker, you can access a dashboard on port 3000. To view this dashboard from your local computer, you need to set up port forwarding in Visual Studio Code.
-
Set Up Port Forwarding:
- Press
Ctrl+Shift+Pto open the command palette. - Type
Forward a Portand select the option. - Enter
3000for the port number and press Enter.
Alternatively:
- Click on the
PORTSsection in the bottom right corner of Visual Studio Code. - Select
Forward Port...from the menu. - Enter
3000for the port number and press Enter.
- Press
-
Access the Dashboard:
- Open your web browser and go to
http://localhost:3000/d/0/external-node. - You should now have access to the dashboard.
- Open your web browser and go to
This step allows you to easily view the dashboard of the application running on your remote server from your local computer.
Additional Information
-
View Container Logs:
docker logs <container_id> -
Stop the Node:
docker-compose -f mainnet-external-node-docker-compose.yml down