# Setting up a Validator

Once a Proxy Account has been set up, it can be used to set up a validator by following the same steps as with a Stash Account.

### CLI Instructions <a href="#cli-instructions" id="cli-instructions"></a>

To run a validator node, use the Creditcoin Docker image provided at `gluwa/creditcoin3` and follow the instructions in the [Validator Setup Guide](/wallets/advanced/proxy-accounts/setting-up-a-validator.md).

The minimum amount to stake for a validator is 20 000 CTC.

#### Using the Validator Wizard <a href="#using-the-validator-wizard" id="using-the-validator-wizard"></a>

Run the Validator Wizard with the desired CTC amount to bond and the stash address as the proxied account:

```
$ docker exec -it creditcoin-validator creditcoin wizard --proxy-for "<stash-address>" --amount <ctc-amount>
```

It will show the current staking settings, make sure to check them before continuing.

```
🧙 Running staking wizard...
Using the following parameters:
💰 Stash account: 5CUnLxUCFqtGkre7MZwyX66E3kPMKDXra4FYtiYp5SoDUwKM
🪙  Amount to bond: 20000 CTC
🎁 Reward destination: Staked
📡 Node URL: ws://127.0.0.1:9944
💸 Commission: 0
🔐 Blocked: No
Continue? (y/n): y
```

If your account is already bonded, skip the bonding step by running `wizard` without the amount flag.

After continuing, the Wizard will create all required extrinsics (i.e. transactions) and communicate with the node to pair it with the stash account.

Once the transactions are sent, the new validator should be in the waiting queue.

Use the status command to get information about the status of a particular validator by entering its Stash address.

#### Manual Setup <a href="#manual-setup" id="manual-setup"></a>

Setting a validator can also be done by sending each required command manually.

First bond CTC using your Stash account and enter the CTC amount to stake.&#x20;

```
$ docker exec -it creditcoin-validator creditcoin bond --amount <ctc-amount> --proxy-for <stash-address>
```

Set the validator node keys. The `--rotate` flag specifies that the node will generate new keys. Existing keys can be used with the `--keys <key-string>` option.

```
$ docker exec -it creditcoin-validator creditcoin set-keys --rotate --proxy-for <stash-address>
```

Once keys are set up, the last step is signaling the network the intention to validate. Use the `--commission <commission-percent>` option to set up a portion of the block reward that will not be shared with nominators or the `--blocked` flag to block nominations.

```
$ docker exec -it creditcoin-validator creditcoin validate --commission <commission-percent> --proxy-for <stash-address>
```

#### Stopping a Validator <a href="#stopping-a-validator" id="stopping-a-validator"></a>

Stop a running validator with the `chill` command. This will remove the validator from the active/waiting set in the next session.

```
$ docker exec -it creditcoin-validator creditcoin chill --proxy-for <stash-address>
```

#### Unbonding & withdrawing CTC <a href="#unbonding-and-withdrawing-ctc" id="unbonding-and-withdrawing-ctc"></a>

To unbond locked CTC, validators must first mark their tokens for unbonding, then wait for the unlocking period to end and finally withdraw the unbonded funds.

```
$ docker exec -it creditcoin-validator creditcoin unbond --amount <amount> --proxy-for <stash-address>
```

The status command shows when the next unlocking chunk will be available to withdraw.

```
$ docker exec -it creditcoin-validator creditcoin status --substrate-address <stash-address>
```

```
Validator 5CGBosx2Fw34u9jJtSgEQkoNTtHkPLKgsfjJiE3mDSWb44MW:
┌────────────────┬─────────────────────────────────┐
│ Status         │                                 │
├────────────────┼─────────────────────────────────┤
│ Bonded         │ Yes                             │
├────────────────┼─────────────────────────────────┤
│ Validating     │ Yes                             │
├────────────────┼─────────────────────────────────┤
│ Waiting        │ Yes                             │
├────────────────┼─────────────────────────────────┤
│ Active         │ No                              │
├────────────────┼─────────────────────────────────┤
│ Can withdraw   │ No                              │
├────────────────┼─────────────────────────────────┤
│ Next unlocking │1000 CTC in 6 minutes, 5 seconds │
└────────────────┴─────────────────────────────────┘
```

After the unbonding period has passed, withdraw the funds.

```
$ docker exec -it creditcoin-validator creditcoin withdraw-unbonded --proxy-for <stash-address>
```


---

# 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://docs.creditcoin.org/wallets/advanced/proxy-accounts/setting-up-a-validator.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.
