# Mytherra Validator Troubleshooting

## Quick Fixes

### ❌ "Makefile was missing"
**You do NOT need to build from source.** Use the pre-built binary:
```bash
curl -sSL https://app.mytmessenger.mytherrablockchain.org/dl/become-validator.sh | sudo bash -s -- init --moniker "MyValidator"
```
This downloads the ready-to-use `mytcd` binary automatically. No `make`, no `go install`, no compilation.

---

### ❌ "Validator is jailed"
A validator gets jailed after missing too many blocks (downtime). To unjail:

```bash
curl -sSL https://app.mytmessenger.mytherrablockchain.org/dl/unjail-validator.sh | sudo bash
```

**Requirements:**
- Node must be running and fully synced (`catching_up: false`)
- Wallet needs ~0.01 MYTC for the unjail transaction fee
- Validator must still be in the staking set (not unbonded)

**If unjail fails with "not in validator set":**
Your validator was unbonded completely. You need to re-create it:
```bash
sudo mytc-bootstrap join --amount 1000
```

---

### ❌ "Node stuck at block 1" / "No peers"
Your node cannot find other validators. Check:
```bash
sudo -u mytc mytcd status | jq '.sync_info'
```

**Fix:** Ensure `persistent_peers` is set in `~/.mytc/config/config.toml`:
```toml
persistent_peers = "5c67756024ba0566e5408330e9055b0009bae23a@217.154.114.75:26656,4b1bf1f6447be80665c4da7d040d05d1769e1e01@87.106.31.141:26656"
```

Then restart:
```bash
sudo systemctl restart mytc
```

---

### ❌ "Already claimed" faucet error
The welcome faucet is **one per address**. If you see this:
- You already claimed on this address — check your balance
- Or create a new wallet: `mytcd keys add validator2 --keyring-backend test`

---

### ❌ Low balance after unjail
Your validator needs MYTC for transaction fees. If you are out of MYTC:
1. Ask Foundation in Telegram for a top-up
2. Or use the daily drip in the Mytherra Messenger app (send 5+ messages to 2+ contacts)

---

## Prevention: Avoid Getting Jailed

**Monitor your signing rate:**
```bash
sudo -u mytc mytcd query slashing signing-info \
  $(sudo -u mytc mytcd tendermint show-address --home ~/.mytc) \
  --home ~/.mytc
```

**Common causes of jailing:**
- VPS restarted and node didn't auto-start → check `systemctl status mytc`
- Out of disk space → `df -h`
- Network issues → `ping 217.154.114.75`
- Ran out of MYTC for fees → keep a small balance

**Set up alerting:**
```bash
# Add to crontab (runs every 5 min)
*/5 * * * * /usr/local/bin/mytc-bootstrap status > /dev/null 2>&1 || echo "Validator issue" | mail -s "MYTC Alert" your-email@example.com
```

---

## One-Command Validator Setup

```bash
curl -sSL https://app.mytmessenger.mytherrablockchain.org/dl/become-validator.sh | sudo bash -s -- init --moniker "MyValidator"
```

This single command installs, syncs, funds, and creates your validator.

## One-Command Unjail

```bash
curl -sSL https://app.mytmessenger.mytherrablockchain.org/dl/unjail-validator.sh | sudo bash
```

## Useful Commands

| Task | Command |
|------|---------|
| Check sync | `sudo -u mytc mytcd status \| jq '.sync_info'` |
| Check balance | `sudo -u mytc mytcd query bank balances <addr> --home ~/.mytc` |
| Check validator | `sudo -u mytc mytcd query staking validator <valoper> --home ~/.mytc` |
| View logs | `sudo journalctl -u mytc -f` |
| Restart node | `sudo systemctl restart mytc` |
| Node config | `cat /home/mytc/.mytc/config/config.toml` |

## Support

- Telegram: Mytherra Foundation
- Faucet: https://app.mytmessenger.mytherrablockchain.org/faucet
- Explorer: https://explorer.mytherrablockchain.org
