Skip to content

Commit 68de311

Browse files
mh0ltclaude
authored andcommitted
claude: add launch-bal-devnet-2 skill (#19548)
Claude Code skill for launching erigon + Lighthouse on the bal-devnet-2 ethpandaops devnet (EIP-7928 Block Access Lists). Provides a complete workflow for start, stop, clean, and monitor operations with proper port offsets and JWT auth between EL and CL clients. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 47dedb9 commit 68de311

File tree

1 file changed

+185
-0
lines changed
  • .claude/skills/launch-bal-devnet-2

1 file changed

+185
-0
lines changed
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
---
2+
name: launch-bal-devnet-2
3+
description: Launch erigon + Lighthouse on the bal-devnet-2 ethpandaops devnet (EIP-7928 Block Access Lists). Manages start/stop of both EL and CL clients with proper port offsets and JWT auth.
4+
allowed-tools: Bash, Read, Write, Edit, Glob
5+
allowed-prompts:
6+
- tool: Bash
7+
prompt: start, stop, and manage erigon and lighthouse processes for bal-devnet-2
8+
---
9+
10+
# Launch bal-devnet-2 (EIP-7928 BAL Devnet)
11+
12+
Run erigon (EL) + Lighthouse (CL) on the bal-devnet-2 ethpandaops devnet for testing EIP-7928 Block Access Lists.
13+
14+
## Network Details
15+
16+
| Parameter | Value |
17+
|-----------|-------|
18+
| Chain ID | 7033429093 |
19+
| Genesis timestamp | 1770388190 |
20+
| Amsterdam timestamp | 1770400508 (epoch 32) |
21+
| Lighthouse image | `ethpandaops/lighthouse:bal-devnet-2-65bb283` |
22+
| Lighthouse version | v8.0.1 (commit 65bb283, branch bal-devnet-2) |
23+
| Explorer | https://explorer.bal-devnet-2.ethpandaops.io |
24+
| Faucet | https://faucet.bal-devnet-2.ethpandaops.io |
25+
| RPC | https://rpc.bal-devnet-2.ethpandaops.io |
26+
| Checkpoint sync | https://checkpoint-sync.bal-devnet-2.ethpandaops.io |
27+
28+
## Working Directory
29+
30+
Ask the user where they want the working directory. Default suggestion: `~/bal-devnet-2/`.
31+
Use `$WORKDIR` throughout to refer to the chosen path.
32+
33+
```
34+
$WORKDIR/
35+
├── genesis.json # EL genesis
36+
├── config.yaml # CL beacon config
37+
├── genesis.ssz # CL genesis state
38+
├── testnet-config/ # Lighthouse testnet dir (config.yaml + genesis.ssz + deploy files)
39+
├── start-erigon.sh # Erigon start script (run FIRST)
40+
├── start-lighthouse.sh # Lighthouse start script (run SECOND)
41+
├── stop.sh # Stop both erigon + Lighthouse
42+
├── clean.sh # Stop, wipe data, re-init genesis
43+
├── erigon-data/ # Erigon datadir (contains jwt.hex)
44+
├── lighthouse-data/ # Lighthouse datadir
45+
├── erigon-console.log # Erigon stdout/stderr
46+
└── lighthouse-console.log # Lighthouse stdout/stderr
47+
```
48+
49+
## Port Assignments (offset +100)
50+
51+
| Service | Port | Protocol |
52+
|---------|------|----------|
53+
| Erigon HTTP RPC | 8645 | TCP |
54+
| Erigon Engine API (authrpc) | 8651 | TCP |
55+
| Erigon WebSocket | 8646 | TCP |
56+
| Erigon P2P | 30403 | TCP+UDP |
57+
| Erigon gRPC | 9190 | TCP |
58+
| Erigon Torrent | 42169 | TCP+UDP |
59+
| Erigon pprof | 6160 | TCP |
60+
| Erigon metrics | 6161 | TCP |
61+
| Lighthouse P2P | 9100 | TCP+UDP |
62+
| Lighthouse QUIC | 9101 | UDP |
63+
| Lighthouse HTTP API | 5152 | TCP |
64+
| Lighthouse metrics | 5264 | TCP |
65+
66+
## Workflow
67+
68+
### Step 1: Check Prerequisites
69+
70+
1. Verify erigon binary exists at `./build/bin/erigon`. If not, invoke `/erigon-build`.
71+
2. Verify the Lighthouse Docker image is available:
72+
```bash
73+
docker image inspect ethpandaops/lighthouse:bal-devnet-2-65bb283 > /dev/null 2>&1
74+
```
75+
If not, pull it:
76+
```bash
77+
docker pull ethpandaops/lighthouse:bal-devnet-2-65bb283
78+
```
79+
3. Verify config files exist in `$WORKDIR` (genesis.json, testnet-config/).
80+
If not, download them:
81+
```bash
82+
mkdir -p $WORKDIR/testnet-config
83+
curl -sL -o $WORKDIR/genesis.json https://config.bal-devnet-2.ethpandaops.io/el/genesis.json
84+
curl -sL -o $WORKDIR/testnet-config/config.yaml https://config.bal-devnet-2.ethpandaops.io/cl/config.yaml
85+
curl -sL -o $WORKDIR/testnet-config/genesis.ssz https://config.bal-devnet-2.ethpandaops.io/cl/genesis.ssz
86+
echo "0" > $WORKDIR/testnet-config/deposit_contract_block.txt
87+
echo "0" > $WORKDIR/testnet-config/deploy_block.txt
88+
```
89+
90+
### Step 2: Initialize Datadir (first run only)
91+
92+
If `$WORKDIR/erigon-data/chaindata` does not exist:
93+
```bash
94+
./build/bin/erigon init --datadir $WORKDIR/erigon-data $WORKDIR/genesis.json
95+
```
96+
97+
### Step 3: Create Scripts (first run only)
98+
99+
If the start/stop/clean scripts don't exist yet, generate them. The scripts must use absolute paths based on `$WORKDIR`. Key details:
100+
101+
**start-erigon.sh** — Runs erigon with `--externalcl`. Must start FIRST (creates JWT secret).
102+
- Env vars: `ERIGON_EXEC3_PARALLEL=true`, `ERIGON_ASSERT=true`, `ERIGON_EXEC3_WORKERS=12`, `LOG_HASH_MISMATCH_REASON=true`
103+
- Flags: `--datadir=$WORKDIR/erigon-data`, `--externalcl`, `--networkid=7033429093`, all 16 EL bootnodes, erigon static peers, `--prune.mode=minimal`, all offset ports (see port table), `--http.api=eth,erigon,engine,debug`, `--pprof`, `--metrics`
104+
- EL bootnodes: fetch from `https://config.bal-devnet-2.ethpandaops.io/api/v1/nodes/inventory` (extract enode URLs from `execution.enode` fields)
105+
106+
**start-lighthouse.sh** — Runs Lighthouse via Docker with `--network=host`. Must start SECOND.
107+
- Checks JWT exists at `$WORKDIR/erigon-data/jwt.hex`
108+
- Docker container name: `bal-devnet-2-lighthouse`
109+
- Mounts: `$WORKDIR/testnet-config:/config:ro`, `$WORKDIR/lighthouse-data:/data`, JWT as `/jwt.hex:ro`
110+
- Flags: `--testnet-dir=/config`, `--execution-endpoint=http://127.0.0.1:8651`, `--execution-jwt=/jwt.hex`, all 15 CL ENR bootnodes, offset ports, `--checkpoint-sync-url=https://checkpoint-sync.bal-devnet-2.ethpandaops.io`
111+
- CL bootnodes: fetch from same inventory URL (extract ENR entries from `consensus.enr` fields)
112+
113+
**stop.sh** — Stops Lighthouse (`docker stop bal-devnet-2-lighthouse`) then erigon (`pkill -f "datadir.*bal-devnet-2/erigon-data"`).
114+
115+
**clean.sh** — Runs `stop.sh`, removes erigon chain data (chaindata, snapshots, txpool, nodes, temp) and lighthouse data, re-initializes genesis.
116+
117+
### Step 4: Start Erigon (FIRST)
118+
119+
Erigon must start first because it creates the JWT secret that Lighthouse needs.
120+
121+
```bash
122+
cd $WORKDIR && nohup bash start-erigon.sh > erigon-console.log 2>&1 &
123+
```
124+
125+
Verify it started:
126+
- Check `tail $WORKDIR/erigon-console.log` for startup messages
127+
- Check JWT exists: `ls $WORKDIR/erigon-data/jwt.hex`
128+
- Check port binding: `ss -tlnp | grep 8651`
129+
130+
### Step 5: Start Lighthouse (SECOND)
131+
132+
After erigon is running and JWT exists:
133+
134+
```bash
135+
cd $WORKDIR && nohup bash start-lighthouse.sh > lighthouse-console.log 2>&1 &
136+
```
137+
138+
Verify it started:
139+
- Check `tail $WORKDIR/lighthouse-console.log` for "Lighthouse started"
140+
- Look for "Loaded checkpoint block and state" (checkpoint sync)
141+
- Look for `peers: "N"` showing peer connections
142+
143+
### Step 6: Monitor
144+
145+
```bash
146+
# Erigon sync progress
147+
tail -f $WORKDIR/erigon-console.log
148+
149+
# Lighthouse sync progress
150+
tail -f $WORKDIR/lighthouse-console.log
151+
152+
# Check erigon block height via RPC
153+
curl -s http://localhost:8645 -X POST -H "Content-Type: application/json" \
154+
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' | python3 -m json.tool
155+
156+
# Check lighthouse sync status
157+
curl -s http://localhost:5152/eth/v1/node/syncing | python3 -m json.tool
158+
```
159+
160+
### Step 7: Stop
161+
162+
```bash
163+
bash $WORKDIR/stop.sh
164+
```
165+
166+
This stops Lighthouse (via `docker stop`) then erigon (via `pkill`).
167+
168+
### Step 8: Clean (wipe data and re-init)
169+
170+
```bash
171+
bash $WORKDIR/clean.sh
172+
```
173+
174+
This runs `stop.sh`, removes erigon chain data (chaindata, snapshots, txpool, nodes, temp) and lighthouse data, then re-initializes genesis. After clean, start again with Steps 4-5.
175+
176+
## Troubleshooting
177+
178+
| Problem | Solution |
179+
|---------|----------|
180+
| JWT auth fails | Ensure erigon started first and `jwt.hex` exists. Lighthouse must mount the same file. |
181+
| No EL peers | Check firewall allows port 30403. Try adding `--nat=extip:<your-ip>`. |
182+
| No CL peers | Check firewall allows port 9100/9101. ENR bootnodes may have changed — re-fetch from inventory. |
183+
| "Head is optimistic" | Normal during initial sync. Erigon is behind Lighthouse. Will resolve as erigon catches up. |
184+
| Engine API timeout | Check erigon is running and authrpc port 8651 is accessible. |
185+
| Port conflict | Check `ss -tlnp | grep <port>`. Kill conflicting process or use higher offset. |

0 commit comments

Comments
 (0)