# GP5 (geth-pr5) Apothem Testnet Sync — Verified Working

## Status
✅ Verified syncing XDC Apothem testnet without any bypasses or workarounds.

## Docker Image
```
anilchinchawale/gx:latest   # latest build
anilchinchawale/gx:apothem-v1  # verified working tag
```

## Verified
- Genesis hash: `0xbdea512b4f12ff1135ec92c00dc047ffb93890c2ea1aa0eefe9b013d80640075` ✅
- Block 900 state root matches stable geth ✅
- HookReward (checkpoint rewards) applying correctly ✅
- No state root bypasses needed ✅
- No receipt bypasses needed ✅

## Run Command
```bash
docker run -d --name xdc-apothem-gp5 \
  --restart unless-stopped \
  --network root_xdc-apothem \
  -v /root/apothem-gp5-data:/root/datadir \
  -p 8555:8555 -p 30305:30305 \
  anilchinchawale/gx:latest \
  --config=/root/datadir/config.toml \
  --networkid=51 \
  --port=30305 \
  --http --http.addr=0.0.0.0 --http.port=8555 \
  --http.vhosts="*" --http.corsdomain="*" \
  --http.api=eth,net,web3,admin,debug,txpool \
  --ws --ws.addr=0.0.0.0 --ws.port=8556 \
  --bootnodes="enode://ee1e11e3f56b015b2b391eb9c45292159713583b4adfe29d24675238f73d33e6ec0a62397847823e2bca622c91892075c517fc383c9355d43a89bb7532e834a0@157.173.120.219:30312,enode://729d763db071595bacbbf33037a8e7639d8e9a97bfcfcda3afe963435d919cb95634f27375f0aadf6494dad47e506c888bf15cb5633d5f81dbb793b05b27e676@207.90.192.100:30312" \
  --syncmode=full --gcmode=archive --verbosity=3
```

## genesis-init Procedure
```bash
# 1. Create config.toml with static peers
# 2. Init with genesis
docker run --rm \
  -v /root/apothem-gp5-data:/root/datadir \
  -v /path/to/genesis-geth.json:/genesis.json:ro \
  anilchinchawale/gx:latest \
  --datadir=/root/datadir init /genesis.json

# 3. Start with run command above
```

## Notes
- State scheme: `path` (default for geth-pr5) — do NOT pass `--state.scheme=hash`
- Do NOT pass `--apothem` flag — use `--networkid=51` instead
- config.toml must have `[Node.P2P] StaticNodes` and `TrustedNodes`
- P2P port: 30305 (must be different from stable on 30303)

## Key Differences from Stable (v2.6.8)
- Uses path-based state trie (not hash-based)
- Supports newer P2P protocol versions
- XDPoS V2 switch block: 56,828,700 (Apothem), 80,370,000 (Mainnet)
