# Quick Setup Guide - Optional User Actions

This guide helps you complete the optional user actions for the RPC Translator 138.

---

## Option 1: Automated Complete Setup (Recommended)

Run the complete setup script to generate keys and configure allowlist automatically:

```bash
cd /home/intlc/projects/proxmox/rpc-translator-138
./scripts/setup-complete.sh [key-count] [password]
```

**Example:**
```bash
# Generate 3 test keys with password "mypassword"
./scripts/setup-complete.sh 3 mypassword
```

This will:
1. ✅ Generate test keystore files
2. ✅ Copy keys to Web3Signer
3. ✅ Get public keys (addresses)
4. ✅ Configure wallet allowlist on all translators

---

## Option 2: Step-by-Step Manual Setup

### Step 1: Generate Test Keys

```bash
./scripts/generate-test-keys.sh [count] [password]
```

**Example:**
```bash
./scripts/generate-test-keys.sh 3 mypassword
```

### Step 2: Setup Web3Signer Keys

```bash
./scripts/setup-web3signer-keys.sh [keystore-directory]
```

**Example:**
```bash
./scripts/setup-web3signer-keys.sh ./keystores
```

### Step 3: Get Public Keys

```bash
./scripts/get-web3signer-public-keys.sh
```

This will show you the addresses (public keys) that you can use in the allowlist.

### Step 4: Configure Wallet Allowlist

```bash
./scripts/configure-wallet-allowlist.sh "address1,address2,..."
```

**Example:**
```bash
./scripts/configure-wallet-allowlist.sh "0x1234...,0xabcd..."
```

---

## Available Scripts

| Script | Purpose |
|--------|---------|
| `scripts/setup-complete.sh` | Complete automated setup |
| `scripts/generate-test-keys.sh` | Generate test keystore files |
| `scripts/setup-web3signer-keys.sh` | Copy keys to Web3Signer |
| `scripts/get-web3signer-public-keys.sh` | Get public keys from Web3Signer |
| `scripts/configure-wallet-allowlist.sh` | Configure wallet allowlist |

---

## Current Status

Check current configuration:

```bash
# Check Web3Signer keys
./scripts/get-web3signer-public-keys.sh

# Check wallet allowlist
./scripts/configure-wallet-allowlist.sh
```

---

## Security Notes

⚠️ **Important Security Considerations:**

1. **Test Keys**: The generated keys are for testing only
2. **Password**: Change default passwords for production
3. **Backup**: Always backup keys securely (encrypted)
4. **Allowlist**: Always configure allowlist in production
5. **Keys**: Store production keys securely

---

## Documentation

- **WEB3SIGNER_KEY_SETUP.md**: Detailed Web3Signer key setup guide
- **WALLET_ALLOWLIST_CONFIG.md**: Detailed wallet allowlist configuration guide

---

## Troubleshooting

### Keys Not Loading

```bash
# Check Web3Signer status
curl http://192.168.11.111:9000/upcheck

# Check Web3Signer logs
ssh -i ~/.ssh/proxmox_translator root@192.168.11.111 "journalctl -u web3signer -n 50"
```

### Allowlist Not Working

```bash
# Check translator logs
ssh -i ~/.ssh/proxmox_translator root@192.168.11.240 "journalctl -u rpc-translator-138.service -n 50 | grep -i allowlist"

# Verify .env file
ssh -i ~/.ssh/proxmox_translator root@192.168.11.240 "grep WALLET_ALLOWLIST /opt/rpc-translator-138/.env"
```
