# Key Loading - Execution Ready

**Date**: 2026-01-05  
**Status**: ✅ **All Scripts and Documentation Ready**

---

## Summary

All scripts and documentation have been created and are ready for execution. Due to shell environment constraints, the actual execution needs to be run manually, but all necessary tools are prepared.

---

## Created Resources

### ✅ Scripts (All Executable)

1. **`scripts/generate-and-load-keys.sh`**
   - Generates 3 test keystore files
   - Creates keys in `/tmp/web3signer-keys/`
   - Usage: `./scripts/generate-and-load-keys.sh 3 TestWallet123!`

2. **`scripts/load-keys-complete.sh`**
   - Loads keys into Web3Signer container
   - Run from Proxmox host
   - Usage: `ssh root@ml110 'bash -s' < scripts/load-keys-complete.sh`

3. **`scripts/verify-keys-loaded.sh`**
   - Verifies keys are loaded in Web3Signer
   - Usage: `./scripts/verify-keys-loaded.sh`

4. **`scripts/configure-wallet-allowlist.sh`**
   - Configures allowlist on all translator VMIDs
   - Usage: `./scripts/configure-wallet-allowlist.sh "<addresses>"`

### ✅ Documentation

1. **`COMPLETE_KEY_LOADING_INSTRUCTIONS.md`** - Complete step-by-step guide
2. **`KEY_LOADING_EXECUTION_COMPLETE.md`** - Execution status and verification
3. **`KEYS_LOADED_STATUS.md`** - Status tracking document
4. **`LOAD_KEYS_NOW.md`** - Quick reference guide

---

## Quick Execution Guide

### Step 1: Generate Keys

```bash
cd /home/intlc/projects/proxmox/rpc-translator-138
./scripts/generate-and-load-keys.sh 3 TestWallet123!
```

**Output**: Keys in `/tmp/web3signer-keys/`

### Step 2: Copy to Proxmox Host

```bash
scp /tmp/web3signer-keys/keystore-*.json root@ml110:/tmp/web3signer-keys/
```

### Step 3: Load into Web3Signer

**Option A - Automated:**
```bash
ssh root@ml110 'bash -s' < /home/intlc/projects/proxmox/rpc-translator-138/scripts/load-keys-complete.sh
```

**Option B - Manual:**
```bash
ssh root@ml110
pct exec 107 -- mkdir -p /opt/web3signer/data/keys
pct push 107 /tmp/web3signer-keys/keystore-test-1.json /opt/web3signer/data/keys/
pct push 107 /tmp/web3signer-keys/keystore-test-2.json /opt/web3signer/data/keys/
pct push 107 /tmp/web3signer-keys/keystore-test-3.json /opt/web3signer/data/keys/
pct exec 107 -- chmod 644 /opt/web3signer/data/keys/*.json
pct exec 107 -- systemctl restart web3signer
sleep 5
exit
```

### Step 4: Verify Keys Loaded

```bash
curl http://192.168.11.111:9000/api/v1/eth1/publicKeys
```

**Expected**: JSON array with 3 addresses

### Step 5: Configure Allowlist

```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"
```

---

## Verification Checklist

After execution, verify:

- [ ] Keys generated in `/tmp/web3signer-keys/`
- [ ] Keys copied to Proxmox host `/tmp/web3signer-keys/`
- [ ] Keys in Web3Signer container `/opt/web3signer/data/keys/`
- [ ] Web3Signer service restarted
- [ ] Keys visible via API: `curl http://192.168.11.111:9000/api/v1/eth1/publicKeys`
- [ ] Allowlist configured on all translators (2400, 2401, 2402)

---

## Troubleshooting

### If Keys Don't Load

1. **Check Web3Signer logs:**
   ```bash
   ssh root@ml110 "pct exec 107 -- journalctl -u web3signer.service -n 50"
   ```

2. **Verify files:**
   ```bash
   ssh root@ml110 "pct exec 107 -- ls -la /opt/web3signer/data/keys/"
   ```

3. **Check file format:**
   ```bash
   ssh root@ml110 "pct exec 107 -- cat /opt/web3signer/data/keys/keystore-test-1.json | jq ."
   ```

4. **Restart service:**
   ```bash
   ssh root@ml110 "pct exec 107 -- systemctl restart web3signer"
   ```

---

## All-in-One Command

If you have SSH access to Proxmox host configured:

```bash
cd /home/intlc/projects/proxmox/rpc-translator-138 && \
./scripts/generate-and-load-keys.sh 3 TestWallet123! && \
scp /tmp/web3signer-keys/keystore-*.json root@ml110:/tmp/web3signer-keys/ && \
ssh root@ml110 'bash -s' < scripts/load-keys-complete.sh && \
sleep 3 && \
ADDRESSES=$(curl -s http://192.168.11.111:9000/api/v1/eth1/publicKeys | jq -r '.[]' | tr '\n' ',' | sed 's/,$//') && \
./scripts/configure-wallet-allowlist.sh "$ADDRESSES"
```

---

## Status

✅ **All scripts created and ready**  
✅ **All documentation complete**  
✅ **Process fully automated**  
⏳ **Ready for execution**

**Execute the steps above to complete key loading.**
