Welcome to your step-by-step guide to implementing a full Polygon zkEVM network on the Goerli testnet as the L1 network.
Users with good internet connection can schedule a 2-hour window for completing the entire process in one go.
However, in order to allow for in-between breaks, the process is aesthetically split into 6 steps.
First Step: Preliminary Setup, checking system requirements and prerequisites variables.
Second Step: Installing Dependencies and downloading Mainnet Files.
Third Step: Creating wallets and Deploying Contracts.
Fourth Step: Deployment of the zkNode.
Fifth Step: Configuring the Prover and Services.
Sixth Step: Activating forced txs and Bridging/Claiming Assets.
Overview And Setting Up
Implementing the full stack Polygon zkEVM involves more than just running an RPC zkNode or the Prover to validate batches, and deploying Smart Contracts. In its entirety, it encompasses all these processes and more.
The common rollup actors, mainly from the zkNode view, are the Sequencer, the Aggregator, the Synchroniser and the JSON RPC node. All these affect the L2 State.
Also, the Aggregator uses the Prover to avail verifiable proofs of sequenced batches. And the sequenced batches are composed of transactions taken from the Pool DB.
This highlights just a few main components. The rest of the zkEVM components and those working in the background, are listed in the next subsection.
Why You Need Docker
The modular design of the zkEVM allows for most components to be separately instantiated, and we therefore run each of these instances in a separate Docker container.
The below table enlists all the zkEVM components/services and their corresponding container-names.
Our zkEVM Deployment-guide provides CLI commands to automatically create these Docker containers.
The First Step of this Deployment-Guide begins here!
Implementing the Polygon zkEVM requires either a Linux machine or a virtual machine running Linux as a Guest OS.
Since the zkEVM implementation involves running Docker containers, ensure that a Docker daemon is installed on your machine.
Here's how to get setup;
For Linux machines, Install Docker engine directly on the machine.
For other Operating Systems (MacOS, Windows), this is achieved in 4 steps, executed in the given sequential order;
- Install a Hypervisor. (e.g., VirtualBox, VMware Fusion (MacOS), VMware Workstation (Windows), VMware ESXi (Bare Metal Hypervisor)).
- Setup a Virtual Machine. (e.g., If you are using VirtualBox, which is open-source, Vagrant is the quickest way to automatically setup a virtual machine and also set up ssh private/public keys.)
- Install Linux as Guest OS, preferably the latest version of Ubuntu Linux.
- Install Docker.
Search the internet for quick guides on creating virtual machines. Here's an example of a video on How to Create a Linux Virtual Machine on a Mac.
In order to run multiple Docker containers, an extra tool called Docker Compose needs to be downloaded and installed. As you will see, a YAML file is used for configuring all zkEVM services.
One more thing, since the Prover is resource-heavy, you will need to run its container externally. Access to cloud computing services such as AWS EC2 or DigitalOcean will be required.
Next, ensure that you have checked your system specs, and have at hand all the variables listed below.
You'll need the following items to begin:
- INFURA_PROJECT_ID // Same as API Key in your Infura account
- Public IP address
- L1 Goërli node RPC
- Goerli address with 0.5 GöETH
See this guide here for setting up your own Goërli node.
Keep in mind that the mainnet files you will be downloading are 70GB big.
If the Prover is the only container you will be running externally in a cloud, then it is preferable to have a minimum 300GB of storage in the primary machine.
Depending on the user's resources, the zkEVM network can be implemented with either the actual Full Prover or the Mock Prover.
The Full Prover is resource-intensive as it utilises the exact same proving stack employed in the real and live zkEVM network.
The Full Prover's system requirements are:
- 96-core CPU
- Minimum 768GB RAM
The Mock Prover is a dummy prover which simply adds a "Valid ✅" checkmark to every batch.
The Mock Prover, on the other hand only requires:
- 4-core CPU
- 8GB RAM (16GB recommended)
As an example, the equivalent AWS EC2s for each of these two provers are as follows:
- r6a.xlarge for Mock Prover
- r6a.24xlarge for Full Prover
The initial free disk space requirement is minimal (<2TB), but you should monitor available space as the network is always adding more data.
Once all the layers are setup and all prerequisites are in place, you can proceed to the next step of this guide.