├── README.md └── setup.sh /README.md: -------------------------------------------------------------------------------- 1 | # Sepolia RPC 节点搭建 (Geth + Prysm) 2 | 3 | ## 🙂 更新 VPS 4 | 5 | ```bash 6 | 7 | sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt install git -y 8 | 9 | ``` 10 | ## 🚀 一键部署 11 | 12 | 执行如下命令 13 | 14 | ```bash 15 | bash <(curl -s https://raw.githubusercontent.com/Cryptoxiaoxiang/Sepolia-RPC/refs/heads/main/setup.sh) 16 | ``` 17 | 18 | 看到如下截图就是对了: 19 | 20 | ![Screenshot 2025-05-19 020345](https://github.com/user-attachments/assets/4763da84-e823-4dec-a142-17866b99b1b5) 21 | 22 | > 💡 按 `CTRL + C` 退出日志. 23 | 24 | ## 🕒 同步节点 25 | 26 | ⏳ 部署完成后需要 2–5 小时来同步数据 27 | --- 28 | 29 | ## ✅ 检查同步是否完成 30 | 31 | ### ➡️ 执行层 (Geth) 32 | 33 | 使用命令: 34 | 35 | ```bash 36 | curl -X POST -H "Content-Type: application/json" \ 37 | --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' \ 38 | http://localhost:8545 39 | ``` 40 | 41 | - ✅ 同步完成会显示 42 | 43 | ```json 44 | {"jsonrpc":"2.0","id":1,"result":false} 45 | ``` 46 | 47 | - 🚫 还在同步会显示 48 | 49 | ```json 50 | { 51 | "jsonrpc":"2.0", 52 | "id":1, 53 | "result":{ 54 | "startingBlock":"0x0", 55 | "currentBlock":"0x1a2b3c", 56 | "highestBlock":"0x1a2b4d" 57 | } 58 | } 59 | ``` 60 | 61 | --- 62 | 63 | ### ➡️ 共识层节点 (Prysm) 64 | 65 | 检查同步状态: 66 | 67 | ```bash 68 | curl http://localhost:3500/eth/v1/node/syncing 69 | ``` 70 | 71 | - ✅ 同步完成的话会显示 72 | 73 | ```json 74 | { 75 | "data": { 76 | "head_slot": "12345", 77 | "sync_distance": "0", 78 | "is_syncing": false 79 | } 80 | } 81 | ``` 82 | 83 | - 🚫 正在同步会显示 84 | 85 | ```json 86 | { 87 | "data": { 88 | "head_slot": "12345", 89 | "sync_distance": "100", 90 | "is_syncing": true 91 | } 92 | } 93 | ``` 94 | 95 | 96 | 97 | 98 | ## 🌐 获取RPC地址 99 | 100 | ### ⚙️ 执行层(Geth) 101 | 你的地址就是 102 | 103 | `http://你的服务器IP:8545` 比如 `http://203.0.113.5:8545` 104 | 105 | 106 | --- 107 | 108 | ### 🔗 共识层 (Prysm) 109 | 110 | 111 | 你的地址就是 112 | `http://localhost:3500` 113 | 114 | 添加防火墙规则 115 | 在你的RPC节点上使用: 116 | ```bash 117 | `sudo ufw allow from "你的Aztec节点IP" to any port 8545 proto tcp` 118 | ``` 119 | 120 | --- 121 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "Starting MeG Sepolia Node Setup (Geth + Prysm v6.x, checkpoint-sync clean)..." 5 | 6 | # ====== user-config ====== 7 | FEE_RECIPIENT="0xYourFeeRecipientAddressHere" # 建议填你自己的以太坊地址 8 | CHECKPOINT_URL="https://checkpoint-sync.sepolia.ethpandaops.io" 9 | PRYSM_IMAGE="gcr.io/offchainlabs/prysm/beacon-chain:v6.1.4" # 可改为 :stable 10 | GETH_IMAGE="ethereum/client-go:stable" 11 | BASE_DIR="/root/ethereum" 12 | EXEC_DIR="$BASE_DIR/execution" 13 | CONS_DIR="$BASE_DIR/consensus" 14 | JWT_FILE="$BASE_DIR/jwt.hex" 15 | DC_FILE="$BASE_DIR/docker-compose.yml" 16 | # ========================== 17 | 18 | # Update & deps 19 | sudo apt-get update && sudo apt-get upgrade -y 20 | sudo apt install -y curl iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip 21 | 22 | # Remove old docker variants if any 23 | for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do 24 | sudo apt-get remove -y "$pkg" || true 25 | done 26 | 27 | # Docker repo 28 | sudo apt-get update 29 | sudo apt-get install -y ca-certificates curl gnupg 30 | sudo install -m 0755 -d /etc/apt/keyrings 31 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 32 | sudo chmod a+r /etc/apt/keyrings/docker.gpg 33 | ARCH=$(dpkg --print-architecture) 34 | CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME") 35 | echo "deb [arch=$ARCH signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $CODENAME stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 36 | sudo apt update -y && sudo apt upgrade -y 37 | 38 | # Install Docker 39 | sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 40 | sudo systemctl enable docker 41 | sudo systemctl restart docker 42 | 43 | # Quick test 44 | sudo docker run --rm hello-world || true 45 | 46 | # Dirs 47 | sudo mkdir -p "$EXEC_DIR" "$CONS_DIR" 48 | 49 | # JWT 50 | if [ ! -f "$JWT_FILE" ]; then 51 | openssl rand -hex 32 | sudo tee "$JWT_FILE" > /dev/null 52 | fi 53 | 54 | # Compose file 55 | sudo tee "$DC_FILE" > /dev/null <