Skip to content

Commit

Permalink
prepare gnosis node to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
feshchenkod committed Nov 30, 2022
1 parent a176dca commit ee4e47e
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 6 deletions.
45 changes: 43 additions & 2 deletions nethermind/docker-compose.no-proxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3.7"
services:
nethermind:
nethermind-xdai:
image: nethermind/nethermind:latest
container_name: nethermind
restart: always
Expand All @@ -20,6 +20,10 @@ services:
- "${P2P_PORT}"
- --Network.P2PPort
- "${P2P_PORT}"
- --HealthChecks.Enabled
- "true"
- --HealthChecks.UIEnabled
- "true"
- --JsonRpc.Enabled
- "true"
- --JsonRpc.EnabledModules
Expand All @@ -30,6 +34,11 @@ services:
- "${HTTP_PORT}"
- --JsonRpc.WebSocketsPort
- "${WS_PORT}"
- --JsonRpc.EngineHost
- "0.0.0.0"
- --JsonRpc.EnginePort
- "${AUTH_PORT}"
- --JsonRpc.JwtSecretFile=/secrets/jwtsecret
- --Sync.FastSync
- "true"
- --config
Expand All @@ -47,4 +56,36 @@ services:
- --Pruning.FullPruningThresholdMb
- "180000"
volumes:
- ./nethermind-data:/var/lib/nethermind
- ./nethermind-data:/var/lib/nethermind

lighthouse-xdai:
image: sigp/lighthouse:latest-modern
hostname: node
restart: unless-stopped
command: |
lighthouse beacon_node
--network gnosis
--checkpoint-sync-url ${CHECKPOINT_RPC_URL}
--discovery-port ${CL_P2P_PORT}
--port ${CL_P2P_PORT}
--eth1-endpoints ${RPC_URL}
--datadir /home/.eth2/beaconchaindata
--http
--http-address 0.0.0.0
--http-port ${CL_HTTP_PORT}
--enr-address ${PUBLIC_IP}
--enr-udp-port ${CL_P2P_PORT}
--target-peers 80
--metrics
--metrics-address 0.0.0.0
--metrics-allow-origin *
--debug-level info
--execution-endpoint ${EXECUTION_ENDPOINT}
--execution-jwt "/secrets/jwtsecret"
ports:
- '${CL_P2P_PORT}:${CL_P2P_PORT}/tcp'
- '${CL_P2P_PORT}:${CL_P2P_PORT}/udp'
# - '${CL_HTTP_PORT}:${CL_HTTP_PORT}'
volumes:
- ./beaconchaindata:/home/.eth2/beaconchaindata
- ./secrets:/secrets
45 changes: 44 additions & 1 deletion nethermind/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3.7"
services:
nethermind:
nethermind-xdai:
image: nethermind/nethermind:latest
container_name: nethermind
restart: always
Expand All @@ -20,6 +20,10 @@ services:
- "${P2P_PORT}"
- --Network.P2PPort
- "${P2P_PORT}"
- --HealthChecks.Enabled
- "true"
- --HealthChecks.UIEnabled
- "true"
- --JsonRpc.Enabled
- "true"
- --JsonRpc.EnabledModules
Expand All @@ -30,6 +34,11 @@ services:
- "${HTTP_PORT}"
- --JsonRpc.WebSocketsPort
- "${WS_PORT}"
- --JsonRpc.EngineHost
- "0.0.0.0"
- --JsonRpc.EnginePort
- "${AUTH_PORT}"
- --JsonRpc.JwtSecretFile=/secrets/jwtsecret
- --Sync.FastSync
- "true"
- --config
Expand Down Expand Up @@ -69,6 +78,40 @@ services:
networks:
- rpc

lighthouse-xdai:
image: sigp/lighthouse:latest-modern
hostname: node
restart: unless-stopped
command: |
lighthouse beacon_node
--network gnosis
--checkpoint-sync-url ${CHECKPOINT_RPC_URL}
--discovery-port ${CL_P2P_PORT}
--port ${CL_P2P_PORT}
--eth1-endpoints ${RPC_URL}
--datadir /home/.eth2/beaconchaindata
--http
--http-address 0.0.0.0
--http-port ${CL_HTTP_PORT}
--enr-address ${PUBLIC_IP}
--enr-udp-port ${CL_P2P_PORT}
--target-peers 80
--metrics
--metrics-address 0.0.0.0
--metrics-allow-origin *
--debug-level info
--execution-endpoint ${EXECUTION_ENDPOINT}
--execution-jwt "/secrets/jwtsecret"
ports:
- '${CL_P2P_PORT}:${CL_P2P_PORT}/tcp'
- '${CL_P2P_PORT}:${CL_P2P_PORT}/udp'
# - '${CL_HTTP_PORT}:${CL_HTTP_PORT}'
volumes:
- ./beaconchaindata:/home/.eth2/beaconchaindata
- ./secrets:/secrets
networks:
- rpc

networks:
rpc:
name: rpc-shared-network
15 changes: 13 additions & 2 deletions nethermind/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ DOMAIN=domain.org
# Comma-separated list of IP/mask addresses to allow access. Replace 0.0.0.0/0 with your address
ALLOW_FROM=0.0.0.0/0

# Node
# EL
P2P_PORT=30303
HTTP_PORT=8535
WS_PORT=8536
WS_PORT=8536
AUTH_PORT=8531

# CL
RPC_URL=http://nethermind-xdai:8535
CHECKPOINT_RPC_URL=https://rpc-gbc.gnosischain.com/
PUBLIC_IP=
EXECUTION_ENDPOINT=http://nethermind-xdai:8531
CL_P2P_PORT=9003
TARGET_PEERS=50
LOG_LEVEL=info
CL_HTTP_PORT=5053
18 changes: 17 additions & 1 deletion nethermind/nethermind.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ docker-compose pull
docker-compose up -d
```

### 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 down
docker-compose pull
docker-compose up -d nethermind-xdai lighthouse-xdai
```

## Pruning
1. Restart node with admin methods enabled:
```
Expand All @@ -40,4 +56,4 @@ curl --data '{"method":"admin_prune","params":[],"id":1,"jsonrpc":"2.0"}' -H "Co
```
docker logs nethermind --since 60m -f | grep 'Pruning'
```
4. Disable admin methods.
4. Disable admin methods.
Empty file added nethermind/secrets/.gitkeep
Empty file.

0 comments on commit ee4e47e

Please sign in to comment.