This is a guide on how to setup a Polygon zkEVM node
- 500GB HDD Space
- Go version 19.4
- Make sure to have PostgreSQL pg_restore v15.4 installed. You can install it by following the below script:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
sudo apt update
sudo apt install postgresql-client-15
- https://zkevm-mai.s3.eu-west-1.amazonaws.com/zkevmmainnetdbhash_1695053524_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz
- https://zkevm-mai.s3.eu-west-1.amazonaws.com/zkevmmainnetdbstate_1695050997_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz
Edit the .env file with your Ethereum L1 endpoint here
ZKEVM_NODE_ETHERMAN_URL = "http://your.L1node.url"
docker-compose up -d zkevm-state-db
cd data
rm -rf statedb && mkdir statedb
git clone https://github.com/0xPolygonHermez/zkevm-node.git
cd zkevm-node
git checkout release/v0.3.0
make build
mv dist/zkevm-node ~/zkevm-node-bin
cd config/environments/mainnet
nohup ~/zkevm-node-bin restore --cfg ./node.snapshot.config.toml -is ~/zkevmmainnetdbstate_1695050997_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz -ih ~/zkevmmainnetdbhash_1695053524_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz &
# Run this in the root directory of this repository
docker-compose up -d