# Fix All Remaining Issues

**Status from check**: Some services need attention

## Issues Found

1. ❌ **Redis**: Not responding
2. ⚠️ **Web3Signer**: Keys not loaded
3. ⚠️ **Vault**: Not responding
4. ⚠️ **Allowlist**: Not configured on translators

## Quick Fix

Run the automated fix script:

```bash
cd /home/intlc/projects/proxmox/rpc-translator-138
./scripts/fix-all-remaining-issues.sh
```

## Manual Fix Steps

### 1. Fix Redis

```bash
# Check and start Redis
ssh root@192.168.11.11 "pct exec 106 -- systemctl status redis-server"
ssh root@192.168.11.11 "pct exec 106 -- systemctl start redis-server && sleep 2"

# Verify
ssh root@192.168.11.11 "pct exec 106 -- redis-cli ping"
# Should return: PONG
```

### 2. Fix Vault

```bash
# Check and start Vault
ssh root@192.168.11.11 "pct exec 108 -- systemctl status vault"
ssh root@192.168.11.11 "pct exec 108 -- systemctl start vault && sleep 2"

# Verify
curl http://192.168.11.112:8200/v1/sys/health
# Should return: {"status":"active",...}
```

### 3. Fix Web3Signer Keys

```bash
# Ensure service is enabled and running
ssh root@192.168.11.11 "pct exec 107 -- systemctl daemon-reload && systemctl enable web3signer.service && systemctl restart web3signer.service && sleep 5"

# Check if keys are in the directory
ssh root@192.168.11.11 "pct exec 107 -- ls -la /opt/web3signer/data/keys/"

# Check if keys are loaded
curl http://192.168.11.111:9000/api/v1/eth1/publicKeys

# If keys exist but not loaded, check logs
ssh root@192.168.11.11 "pct exec 107 -- journalctl -u web3signer.service -n 30 --no-pager | tail -20"
```

### 4. Configure Allowlist

Once keys are loaded:

```bash
cd /home/intlc/projects/proxmox/rpc-translator-138

# Get addresses
ADDRESSES=$(curl -s http://192.168.11.111:9000/api/v1/eth1/publicKeys | jq -r '.[]' | tr '\n' ',' | sed 's/,$//')

# Configure
./scripts/configure-wallet-allowlist.sh "$ADDRESSES"

# Restart translators
for IP in 192.168.11.240 192.168.11.241 192.168.11.242; do
    ssh -i ~/.ssh/proxmox_translator root@$IP "systemctl restart rpc-translator-138.service"
done
```

## All-in-One Fix

```bash
# Fix Redis
ssh root@192.168.11.11 "pct exec 106 -- systemctl start redis-server && sleep 2"

# Fix Vault
ssh root@192.168.11.11 "pct exec 108 -- systemctl start vault && sleep 2"

# Fix Web3Signer
ssh root@192.168.11.11 "pct exec 107 -- systemctl daemon-reload && systemctl enable web3signer.service && systemctl restart web3signer.service && sleep 5"

# Configure allowlist (if keys are loaded)
cd /home/intlc/projects/proxmox/rpc-translator-138
ADDRESSES=$(curl -s http://192.168.11.111:9000/api/v1/eth1/publicKeys | jq -r '.[]' | tr '\n' ',' | sed 's/,$//')
if [ -n "$ADDRESSES" ]; then
    ./scripts/configure-wallet-allowlist.sh "$ADDRESSES"
    for IP in 192.168.11.240 192.168.11.241 192.168.11.242; do
        ssh -i ~/.ssh/proxmox_translator root@$IP "systemctl restart rpc-translator-138.service"
    done
fi

# Verify
./scripts/check-all-status.sh
```

---

**Run**: `./scripts/fix-all-remaining-issues.sh` to fix all issues automatically!
