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 when working with this chain.
Indexer Test for X Layer POI
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
Query to grab the POI
Note: Do not modify the query below - the indexer address in the query should be the 0x0 address.
If there is a match for the Consensus POI provided below, it may indicate that the setup allows for syncing other subgraphs and being in majority consensus. If there is a match for the Divergent POI, this can be an indication of a data determinism issue.
Consensus0xa1223b5cbabf16d9896c2bd19099d08e5ce45c7ff308674b3ea7ada5367334bf
# URL of a JSON RPC for Ethereum mainnet or Sepolia testnet
XLAYER_NODE_ETHERMAN_URL = "http://your.L1node.url"
# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
XLAYER_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.sh restore
# If using testnet
./run_xlayer_testnet.sh restore
Start X Layer Node
# mainnet
./run_xlayer_mainnet.sh start
# If using testnet
./run_xlayer_testnet.sh start
docker ps -a
# The following containers should be available:
xlayer-rpc
xlayer-sync
xlayer-state-db
xlayer-pool-db
xlayer-prover
Query X Layer Node
curl -H "Content-Type: application/json" -X POST --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"}