With their Eggfruit upgrade in September 2024, the Polygon team made the official recommendation that all infra providers will need to begin running the cdk-erigon RPC Node. While zkEVm Node is still operational, it is no longer being maintained by the Polygon team.
Additionally, we found slight POI divergence in our integration testing. Please use the test below as an initial screening for Proof of Indexing when working with this chain.
Initial Test for Proof of Indexing
Due to POI divergences found with X Layer, we created an initial test below for indexers that may indicate that their setup allows them to sync other subgraphs and be in majority consensus.
Sync the following subgraph: QmWHYMV9mPZ6zoomwWSZbN24sdGSEQhy1efritMiETpxqS
If there is a match for the Consensus POI provided below, it may indicate that their setup allows them to sync other subgraphs and be in the majority consensus. If they get a match for the Divergent POI, this can be an indication of a data determinism issue.
# Add Docker's official GPG key:sudoapt-getupdatesudoapt-getinstallca-certificatescurlsudoinstall-m0755-d/etc/apt/keyringssudocurl-fsSLhttps://download.docker.com/linux/ubuntu/gpg-o/etc/apt/keyrings/docker.ascsudochmoda+r/etc/apt/keyrings/docker.asc# Add the repository to Apt sources:echo \"deb [arch=$(dpkg--print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(./etc/os-release&&echo "$VERSION_CODENAME") stable"| \sudotee/etc/apt/sources.list.d/docker.list>/dev/nullsudoapt-getupdate# Install Docker Packagessudoapt-getinstalldocker-cedocker-ce-clicontainerd.iodocker-buildx-plugindocker-compose-plugin# Verify Docker Installation is Successfulsudodockerrunhello-world# Install Docker-Composesudoapt-getupdatesudoapt-getinstalldocker-compose-plugin# Verify Docker-Compose installation by checking the versiondockercomposeversion# Expected outputDockerComposeversionvN.N.N
Set up X Layer Node
# Make a directorymkdir-p/root/xlayer-node&&cd/root/xlayer-node# Download mainnet X-Layer scriptcurl-fsSLhttps://raw.githubusercontent.com/okx/Deploy/main/setup/zknode/run_xlayer_mainnet.sh|bash-sinit&&cp./mainnet/example.env./mainnet/.env# Alternatively: Download testnet X-Layer scriptcurl-fsSLhttps://raw.githubusercontent.com/okx/Deploy/main/setup/zknode/run_xlayer_testnet.sh|bash-sinit&&cp./testnet/example.env./testnet/.env# Edit mainnet .envnano./mainnet/.env# Alternatively: Edit testnet .envnano./testnet/.env
Values for .env file
# URL of a JSON RPC for Ethereum mainnet or Sepolia testnetXLAYER_NODE_ETHERMAN_URL="http://your.L1node.url"# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATAXLAYER_NODE_STATEDB_DATA_DIR="./xlayer_mainnet_data/statedb"# OR ./xlayer_testnet_datastatedb/ for testnet# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA #XLAYER_NODE_POOLDB_DATA_DIR="./xlayer_mainnet_data/pooldb"# OR ./xlayer_testnet_data/pooldb/ for testnet
Restore latest Layer 2 snapshot
Restoring the Layer 2 snapshot database locally will allow synchronizing of Layer 2 data quickly.
# mainnet./run_xlayer_mainnet.shrestore# If using testnet./run_xlayer_testnet.shrestore
Start X Layer Node
# mainnet./run_xlayer_mainnet.shstart# If using testnet./run_xlayer_testnet.shstartdockerps-a# The following containers should be available: xlayer-rpcxlayer-syncxlayer-state-dbxlayer-pool-dbxlayer-prover
Query X Layer Node
curl-H"Content-Type: application/json"-XPOST--data'{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'http://localhost:8545# The response should resemble the follow{"jsonrpc":"2.0","id":1,"result":"0xcab5ab"}
Additional Commands
# Stop X Layer Node./run_xlayer_mainnet.shstop# Restart./run_xlayer_mainnet.shrestart# Updating./run_xlayer_mainnet.shupdate
Access Logs
# TO VIEW LOGSdockerlogs [container idORcontainername]