# 🪪 Validator Installation

### *Prerequisites & Assumptions*

Before starting validator onboarding, you **must** have:

* A **fully synced Monad full node** (execution + bft + rpc running)
* Access to a **Monad RPC endpoint** (local or remote)
* **SECP and BLS validator keys** already generated by `monad-bft`
* A **funded EVM address** with:
  * Minimum **100,000 MON** self‑stake
  * Additional MON for gas fees

> ⚠️ Production validators **must use a hardware wallet (Ledger)** for funded / authorized addresses.

***

### *Validator Eligibility Requirements*

To become **active**, a validator must satisfy **all** of the following:

| Requirement               | Value            |
| ------------------------- | ---------------- |
| Minimum self‑stake        | 100,000 MON      |
| Minimum total stake       | 10,000,000 MON   |
| Active validator set size | Top 200 by stake |

Once all conditions are met, the validator becomes active **in the next epoch**.

### *Configure Validator Node*

#### *node.toml (Validator Configuration)*

Ensure you are using the **validator‑themed `node.toml`**.

Mandatory check:

```toml
beneficiary = "0x<YOUR_BENEFICIARY_ADDRESS>"
```

* This address receives **block rewards**
* It does **not** have to be the funded or authorized address

Optional but recommended:

* Update `node_name` to a unique validator identifier
* Remove any `full_` prefix from full‑node testing

#### *Reload Config Without Restart*

```bash
monad-debug-node \
  --control-panel-ipc-path /home/monad/monad-bft/controlpanel.sock \
  reload-config
```

### *Install Staking CLI*

#### *Clone Repository*

```bash
git clone https://github.com/monad-developers/staking-sdk-cli.git
cd staking-sdk-cli
```

#### *Create Virtual Environment*

```bash
python -m venv cli-venv
source cli-venv/bin/activate
```

#### *Install Dependencies*

```bash
pip install .
```

> For development or modifications:

```bash
pip install -e .
```

### *Configure Staking CLI*

#### *Create config.toml*

```bash
cp staking-cli/config.toml.example config.toml
```

#### *Funded & Authorized Addresses*

You will need:

* **Funded address** — pays gas + provides stake
* **Authorized address** — controls validator operations on‑chain

These **can be different** addresses.

> 🔐 Recommended:
>
> * Funded address → Ledger
> * Authorized address → Ledger

Never commit `config.toml` to git.

### *Extract Validator Private Keys*

⚠️ **DO NOT** reuse old backup keys.

Always extract keys directly from keystores using `monad-keystore`.

```bash
source /home/monad/.env

monad-keystore recover \
  --password "$KEYSTORE_PASSWORD" \
  --keystore-path /home/monad/monad-bft/config/id-secp \
  --key-type secp

monad-keystore recover \
  --password "$KEYSTORE_PASSWORD" \
  --keystore-path /home/monad/monad-bft/config/id-bls \
  --key-type bls
```

Save outputs **securely** and verify public keys match your node identity.

### *Add Validator (CLI Workflow)*

```bash
python staking-cli/main.py add-validator \
  --secp-privkey "${SECP_PRIVATE_KEY}" \
  --bls-privkey "${BLS_PRIVATE_KEY}" \
  --auth-address "${AUTH_ADDRESS}" \
  --amount 100_000
```

#### *Verification Prompt*

You **must verify** derived public keys:

```
SECP Pubkey: 03bbf6...
BLS  Pubkey: 985d3f...
Do the derived public keys match? [y/n]
```

Confirm **only if keys match** your node.

Successful transaction:

```
Tx status: 1
Tx hash: 0x...
```

### *Add Validator (TUI Workflow)*

```bash
python staking-cli/main.py tui
```

Navigate:

```
1. Add Validator
```

Fill values carefully → confirm → submit.

### *Verify Validator Registration*

#### *Confirm Validator Creation*

```
INFO Validator Created! ID: <validator-id>
```

#### *Check Execution Set*

```bash
python main.py query validator-set \
  --type execution \
  --config-path ~/config.toml | grep <SECP_PUBKEY>
```

#### *Query Validator Info*

```bash
python main.py query validator \
  --validator-id <ID> \
  --config-path ~/config.toml
```

Verify:

* Stake
* Commission
* Status

### *Common Operations*

* Delegate
* Undelegate
* Withdraw
* Claim rewards
* Compound rewards
* Change commission

All available via CLI or TUI.

### *Troubleshooting*

#### *Transaction Failed (status 0)*

1. Fetch tx data via `eth_getTransactionByHash`
2. Replay via `eth_call` for trace

Common errors:

* `insufficient balance`
* `invalid validator id`
* `gas too low`

### *Security Best Practices*

* Use **Ledger hardware wallets** in production
* Never store private keys in git or plaintext
* Restrict RPC access
* Monitor validator health continuously

### *Final Notes*

* Validator activation occurs **next epoch** after requirements met
* Stake ranking determines activation
* Keep node fully synced and stable


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.validexis.com/testnets/monad/validator-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
