Coder Social home page Coder Social logo

zkevm-mn-node's Introduction

Setup Mainnet Polygon zkEVM node

This is a guide on how to setup a Polygon zkEVM node

Requirements:

  1. 500GB HDD Space
  2. Go version 19.4
  3. 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

Step 1: Download the following snapshots

  1. https://zkevm-mai.s3.eu-west-1.amazonaws.com/zkevmmainnetdbhash_1695053524_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz
  2. https://zkevm-mai.s3.eu-west-1.amazonaws.com/zkevmmainnetdbstate_1695050997_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz

Step 2: Edit the .env file with your Ethereum L1 endpoint

Edit the .env file with your Ethereum L1 endpoint here

ZKEVM_NODE_ETHERMAN_URL = "http://your.L1node.url"

Step 3: Start the Docker container for zkevm-state-db

docker-compose up -d zkevm-state-db

Step 4: Clear the statedb

cd data
rm -rf statedb && mkdir statedb

Step 5: Install the zkevm-node binary by following the below script

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

Step 6: Run the following commands to restore the db

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 &

Step 7: Spin up the other containers

# Run this in the root directory of this repository
docker-compose up -d

Resources

  1. https://polygontechnology.notion.site/zkEVM-mainnet-beta-Instructions-for-permissionless-nodes-to-rehash-the-network-53b525498bc94c03ab02bba621f8d8e3

zkevm-mn-node's People

Contributors

jacquesvcritien avatar

Stargazers

Andrew Paulicek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.