From a6ac627f62ed10d8f61036b4ab35581eb06a6d96 Mon Sep 17 00:00:00 2001 From: "xianrui.qin" Date: Wed, 9 Apr 2025 14:22:07 +0800 Subject: [PATCH 1/2] add snapshots doc --- .DS_Store | Bin 6148 -> 6148 bytes developer/snapshots/setup-erigon-rpc.md | 105 ++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 developer/snapshots/setup-erigon-rpc.md diff --git a/.DS_Store b/.DS_Store index 11bbc1ad5290cd7f2bffe5316aaeeb9c2071adc4..a9e55444936421be1e94daf7d5e65b066bcbf926 100644 GIT binary patch delta 40 wcmZoMXfc@J&&a+pU^g=(`(z%LN%#fv(I4!W@QTRF^WPPd>nUYBM{> GUw!~meLZ&o diff --git a/developer/snapshots/setup-erigon-rpc.md b/developer/snapshots/setup-erigon-rpc.md new file mode 100644 index 0000000..53fd6e2 --- /dev/null +++ b/developer/snapshots/setup-erigon-rpc.md @@ -0,0 +1,105 @@ +# Setup production erigon +cdk-erigon is a fork of Erigon, optimized for syncing with the XLayer network. + +### Minimum System Requirements +- **16 GB RAM** +- **8 core CPU** +- **500 GB Storage** (This will increase over time) +- **Ubuntu 20.04+ (or use Docker)** + +### Start Erigon RPC Node + +#### Build +``` bash +git clone https://github.com/0xPolygonHermez/cdk-erigon.git +cd cdk-erigon +git checkout v2.61.0 #[checkout the latest release version] + +make cdk-erigon +``` + +#### Config +``` bash +cp xlayerconfig-mainnet.yaml.example xlayerconfig-mainnet.yaml +``` +Modfiy and replace params like this: +``` bash +datadir: /your/data/dir +zkevm.l1-rpc-url: http://your-l1-rpc-url:8545 + +zkevm.address-sequencer: "0xAF9d27ffe4d51eD54AC8eEc78f2785D7E11E5ab1" +zkevm.address-zkevm: "0x2B0ee28D4D51bC9aDde5E58E295873F61F4a0507" +zkevm.address-admin: "0x491619874b866c3cDB7C8553877da223525ead01" +zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2" +zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb" +``` + +#### Recommended method to start (Using Docker) +To avoid compatibility issues with GCC, GLIBC, and Go versions, we recommend using Docker: +```bash +docker build -t cdk-erigon:latest . +docker run -it --rm \ + -p 8545:8545 \ + -p 30303:30303 \ + -v "$PWD/xlayerconfig-mainnet.yaml:/home/erigon/xlayerconfig-mainnet.yaml" \ + cdk-erigon:latest \ + --config=/home/erigon/xlayerconfig-mainnet.yaml +``` + +If you prefer a manual installation, follow the steps below. + +#### Start Erigon Node +``` +./build/bin/cdk-erigon --config="./xlayerconfig-mainnet.yaml" +``` + +### Quick Start with Snapshot (Recommended) +To avoid the time-consuming process of syncing from genesis, you can download the latest snapshots from our official snapshot page: + +Access the Official Snapshot Page +Visit our official snapshot repository at: +https://static.okex.org/cdn/chain/xlayer/snapshot/index.html + +This page provides the latest snapshots for both X Layer mainnet and testnet. Snapshots are updated every Webnesday and Sunday, with the latest update timestamp displayed on the page. + +#### Downloading and Using Snapshots +##### Downloading snapshots + +``` +# Create a directory for your data +mkdir -p /data/erigon +cd /data/erigon +# Download the snapshot from the snapshot page +# Replace with the actual download link from the snapshot page +wget +``` + +##### Extract the snapshot +``` +# Extract the snapshot (this may take some time) +tar -xzf +``` + +##### Update your configuration +Edit your xlayerconfig-mainnet.yaml file to point to the extracted data directory: +``` +datadir: /data/erigon/extracted-snapshot-directory +``` +##### Start Erigon with the snapshot data +``` +./build/bin/cdk-erigon --config="./xlayerconfig-mainnet.yaml" +``` + +#### Using Snapshots with Docker +If you're using Docker, mount the extracted data directory as a volume: +``` +docker run -it --rm \ + -p 8545:8545 \ + -p 30303:30303 \ + -v "/data/erigon/extracted-snapshot-directory:/home/erigon/data" \ + -v "$PWD/xlayerconfig-mainnet.yaml:/home/erigon/xlayerconfig-mainnet.yaml" \ + cdk-erigon:latest \ + --config=/home/erigon/xlayerconfig-mainnet.yaml +``` +Make sure to update your config file's datadir to point to /home/erigon/data. The rest steps are same as that outlined in the instructions above. + From 3f88ee7193a06babe987e5ba6bd6569c2c84efdc Mon Sep 17 00:00:00 2001 From: "xianrui.qin" Date: Wed, 9 Apr 2025 17:33:22 +0800 Subject: [PATCH 2/2] add snapshots doc --- developer/snapshots/setup-erigon-rpc.md | 37 ++++++------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/developer/snapshots/setup-erigon-rpc.md b/developer/snapshots/setup-erigon-rpc.md index 53fd6e2..fdf411a 100644 --- a/developer/snapshots/setup-erigon-rpc.md +++ b/developer/snapshots/setup-erigon-rpc.md @@ -34,25 +34,6 @@ zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2" zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb" ``` -#### Recommended method to start (Using Docker) -To avoid compatibility issues with GCC, GLIBC, and Go versions, we recommend using Docker: -```bash -docker build -t cdk-erigon:latest . -docker run -it --rm \ - -p 8545:8545 \ - -p 30303:30303 \ - -v "$PWD/xlayerconfig-mainnet.yaml:/home/erigon/xlayerconfig-mainnet.yaml" \ - cdk-erigon:latest \ - --config=/home/erigon/xlayerconfig-mainnet.yaml -``` - -If you prefer a manual installation, follow the steps below. - -#### Start Erigon Node -``` -./build/bin/cdk-erigon --config="./xlayerconfig-mainnet.yaml" -``` - ### Quick Start with Snapshot (Recommended) To avoid the time-consuming process of syncing from genesis, you can download the latest snapshots from our official snapshot page: @@ -70,7 +51,7 @@ This page provides the latest snapshots for both X Layer mainnet and testnet. Sn mkdir -p /data/erigon cd /data/erigon # Download the snapshot from the snapshot page -# Replace with the actual download link from the snapshot page +# Replace with the actual download link from the snapshot page, or you can directly download it from https://static.okex.org/cdn/chain/xlayer/snapshot/index.html wget ``` @@ -85,21 +66,21 @@ Edit your xlayerconfig-mainnet.yaml file to point to the extracted data director ``` datadir: /data/erigon/extracted-snapshot-directory ``` -##### Start Erigon with the snapshot data + + +#### Start Erigon Node ``` ./build/bin/cdk-erigon --config="./xlayerconfig-mainnet.yaml" ``` -#### Using Snapshots with Docker -If you're using Docker, mount the extracted data directory as a volume: -``` +#### Recommended method to start (Using Docker) +To avoid compatibility issues with GCC, GLIBC, and Go versions, we recommend using Docker: +```bash +docker build -t cdk-erigon:latest . docker run -it --rm \ -p 8545:8545 \ -p 30303:30303 \ - -v "/data/erigon/extracted-snapshot-directory:/home/erigon/data" \ -v "$PWD/xlayerconfig-mainnet.yaml:/home/erigon/xlayerconfig-mainnet.yaml" \ cdk-erigon:latest \ --config=/home/erigon/xlayerconfig-mainnet.yaml -``` -Make sure to update your config file's datadir to point to /home/erigon/data. The rest steps are same as that outlined in the instructions above. - +``` \ No newline at end of file