From 64e36e70bc147516ec1022d18b8e589e75c0d1f3 Mon Sep 17 00:00:00 2001 From: _den <_den@outlook.com> Date: Fri, 2 Sep 2022 15:40:01 +1000 Subject: [PATCH] prepare Mainnet to The Merge --- geth/docker-compose.no-proxy.yml | 35 ++++++++++++++++++++++++++++++ geth/docker-compose.yml | 37 ++++++++++++++++++++++++++++++++ geth/example.env | 13 ++++++++++- geth/geth.md | 16 ++++++++++++++ geth/secrets/.gitkeep | 0 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 geth/secrets/.gitkeep diff --git a/geth/docker-compose.no-proxy.yml b/geth/docker-compose.no-proxy.yml index 68c3804..58aef71 100644 --- a/geth/docker-compose.no-proxy.yml +++ b/geth/docker-compose.no-proxy.yml @@ -54,12 +54,20 @@ services: - "0" - --rpc.txfeecap - "0" + - --authrpc.addr + - "0.0.0.0" + - --authrpc.port + - "${AUTH_PORT}" + - --authrpc.jwtsecret + - "/secrets/jwtsecret" + - --authrpc.vhosts=* ports: - ${HTTP_PORT}:${HTTP_PORT} - ${WS_PORT}:${WS_PORT} - ${P2P_PORT}:${P2P_PORT} volumes: - ./geth-data:/root/.ethereum + - ./secrets:/secrets stop_grace_period: 3m30s stop_signal: SIGINT healthcheck: @@ -67,3 +75,30 @@ services: interval: 5s timeout: 10s retries: 3 + + lighthouse-mainnet: + image: sigp/lighthouse:latest-modern + hostname: lighthouse-mainnet + restart: unless-stopped + command: | + lighthouse beacon_node + --network mainnet + --eth1-endpoints $RPC_URL + --datadir /home/.eth2/beaconchaindata + --discovery-port ${CL_P2P_PORT} + --port ${CL_P2P_PORT} + --http + --http-address 0.0.0.0 + --enr-address $PUBLIC_IP + --enr-udp-port ${CL_P2P_PORT} + --target-peers $TARGET_PEERS + --debug-level $LOG_LEVEL + --execution-endpoint $EXECUTION_ENDPOINT + --execution-jwt "/secrets/jwtsecret" + # --checkpoint-sync-url $CHECKPOINT_RPC_URL + ports: + - '${CL_P2P_PORT}:${CL_P2P_PORT}/tcp' + - '${CL_P2P_PORT}:${CL_P2P_PORT}/udp' + volumes: + - ./lighthouse-data:/home/.eth2/beaconchaindata + - ./secrets:/secrets \ No newline at end of file diff --git a/geth/docker-compose.yml b/geth/docker-compose.yml index 69c8d19..20bb3f6 100644 --- a/geth/docker-compose.yml +++ b/geth/docker-compose.yml @@ -58,12 +58,20 @@ services: - "0" - --rpc.txfeecap - "0" + - --authrpc.addr + - "0.0.0.0" + - --authrpc.port + - "${AUTH_PORT}" + - --authrpc.jwtsecret + - "/secrets/jwtsecret" + - --authrpc.vhosts=* ports: # - ${HTTP_PORT}:${HTTP_PORT} # - ${WS_PORT}:${WS_PORT} - ${P2P_PORT}:${P2P_PORT} volumes: - ./geth-data:/root/.ethereum + - ./secrets:/secrets stop_grace_period: 3m30s stop_signal: SIGINT healthcheck: @@ -92,6 +100,35 @@ services: networks: - rpc + lighthouse-mainnet: + image: sigp/lighthouse:latest-modern + hostname: lighthouse-mainnet + restart: unless-stopped + command: | + lighthouse beacon_node + --network mainnet + --eth1-endpoints $RPC_URL + --datadir /home/.eth2/beaconchaindata + --discovery-port ${CL_P2P_PORT} + --port ${CL_P2P_PORT} + --http + --http-address 0.0.0.0 + --enr-address $PUBLIC_IP + --enr-udp-port ${CL_P2P_PORT} + --target-peers $TARGET_PEERS + --debug-level $LOG_LEVEL + --execution-endpoint $EXECUTION_ENDPOINT + --execution-jwt "/secrets/jwtsecret" + # --checkpoint-sync-url $CHECKPOINT_RPC_URL + ports: + - '${CL_P2P_PORT}:${CL_P2P_PORT}/tcp' + - '${CL_P2P_PORT}:${CL_P2P_PORT}/udp' + volumes: + - ./lighthouse-data:/home/.eth2/beaconchaindata + - ./secrets:/secrets + networks: + - rpc + networks: rpc: name: rpc-shared-network diff --git a/geth/example.env b/geth/example.env index d43aa6d..10c5388 100644 --- a/geth/example.env +++ b/geth/example.env @@ -7,5 +7,16 @@ ALLOW_FROM=0.0.0.0/0 P2P_PORT=30304 HTTP_PORT=8545 WS_PORT=8546 +WS_PORT=8546 +AUTH_PORT=8554 # Comma-separated list of addresses to treat as "local" -TX_LOCAL_ADDR=0x0000000000000000000000000000000000000000 \ No newline at end of file +TX_LOCAL_ADDR=0x0000000000000000000000000000000000000000 + + +RPC_URL=http://geth:8545 +CHECKPOINT_RPC_URL= +PUBLIC_IP= +EXECUTION_ENDPOINT=http://geth:8554 +CL_P2P_PORT=30304 +TARGET_PEERS=50 +LOG_LEVEL=info \ No newline at end of file diff --git a/geth/geth.md b/geth/geth.md index 876e35e..8813567 100644 --- a/geth/geth.md +++ b/geth/geth.md @@ -25,6 +25,22 @@ docker-compose pull docker-compose up -d geth ``` +### Prepare to The Merge +Set `PUBLIC_IP` in `.env`. + +Create a jwtsecret file: +```bash +openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwtsecret +sudo chmod 644 /secrets/jwtsecret +``` + +Update to latest EL / CL node software: +``` +docker-compose pull +docker-compose up -d geth lighthouse-mainnet +``` + + ## Pruning Use it if the size is approaching 800 GB. At least 120 GB must be free for successful pruning. ```bash diff --git a/geth/secrets/.gitkeep b/geth/secrets/.gitkeep new file mode 100644 index 0000000..e69de29