# Set up vald and tofnd (https://docs.axelar.dev/infrastructure/validators/setup/vald-tofnd)



Axelar validators run two companion processes next to `axelard`: `vald`, which votes and signs on behalf of your validator, and `tofnd`, which holds the key shares used for threshold signing.

## Install vald and tofnd [#install-vald-and-tofnd]

Similar to [Node setup](https://docs.axelar.dev/llms.mdx/infrastructure/node/setup/content.md), run `setup-validator.sh` to download and configure `vald` and `tofnd` binaries. In the [`axelerate-community`](https://github.com/axelarnetwork/axelarate-community) repo do:

```bash
./scripts/setup-validator.sh -n [mainnet|testnet]
```

The binary `tofnd` is placed in your `${AXELARD_HOME}/bin` directory. The binary `vald` is actually part of `axelard`.

Binaries are verified against the commonprefix PGP key by default; see [Verifying binaries](https://docs.axelar.dev/llms.mdx/infrastructure/node/setup/content.md#verifying-binaries) to verify them manually.

## Create and back up accounts and keys [#create-and-back-up-accounts-and-keys]

You must store backup copies of the following data in a safe place:

1. Tendermint validator secret key
2. `validator` account secret mnemonic
3. `broadcaster` account secret mnemonic
4. `tofnd` secret mnemonic

### Back up your Tendermint validator secret key [#back-up-your-tendermint-validator-secret-key]

As described in [Basic node management](https://docs.axelar.dev/llms.mdx/infrastructure/node/basic/content.md) BACKUP the file `${AXELARD_HOME}/config/priv_validator_key.json`.

### Create and back up accounts [#create-and-back-up-accounts]

Each validator needs two accounts, which we call `validator` and `broadcaster`. Create those accounts and back them up.

```bash
axelard keys add validator --home $AXELARD_HOME
axelard keys add broadcaster --home $AXELARD_HOME
```

As described in [Basic node management](https://docs.axelar.dev/llms.mdx/infrastructure/node/basic/content.md), BACKUP the secret mnemonics for these accounts that are printed to stdout when you create them.

### Create and back up the tofnd mnemonic [#create-and-back-up-the-tofnd-mnemonic]

Similar to your [Axelar keyring](https://docs.axelar.dev/llms.mdx/infrastructure/node/keyring/content.md), your `tofnd` storage is encrypted with a password you choose. Your password must have at least 8 characters.

Set `tofnd` password and create `tofnd` mnemonic:

```bash
tofnd -m create -d ${AXELARD_HOME}/tofnd
```

BACKUP and DELETE `${AXELARD_HOME}/tofnd/export`.

## Launch tofnd [#launch-tofnd]

You may wish to redirect log output to a file. Enter the `tofnd` password on stdin after the process is launched.

```bash
$AXELARD_HOME/bin/tofnd -m existing -d $AXELARD_HOME/tofnd >> $AXELARD_HOME/logs/tofnd.log 2>&1
```

View your logs in real time:

```bash
tail -f $AXELARD_HOME/logs/tofnd.log
```

## Launch vald [#launch-vald]

Learn the `valoper` address associated with your `validator` account:

```bash
$AXELARD_HOME/bin/axelard keys show validator --bech val -a --home $AXELARD_HOME
```

Let `{VALOPER_ADDR}` denote this address.

Launch `vald`. Here are two ways to do it:

1. **Basic.**

```bash
$AXELARD_HOME/bin/axelard vald-start --validator-addr {VALOPER_ADDR} --chain-id $AXELARD_CHAIN_ID --log_level debug --home $AXELARD_HOME
```

2. **Redirect logs to file.** The password prompt may not be visible because `stdout` is redirected to the log file. In this case you may wish to pipe in your keyring password. See [Keyring backend](https://docs.axelar.dev/llms.mdx/infrastructure/node/keyring/content.md) for more info.

```bash
echo $KEYRING_PASSWORD | $AXELARD_HOME/bin/axelard vald-start --validator-addr {VALOPER_ADDR} --chain-id $AXELARD_CHAIN_ID --log_level debug --home $AXELARD_HOME >> ${AXELARD_HOME}/logs/vald.log 2>&1
```

View your logs in real time (if you selected option 2 above):

```bash
tail -f ${AXELARD_HOME}/logs/vald.log
```

## Directory structure of a running validator [#directory-structure-of-a-running-validator]

Later, after you've launched your companion processes and created your validator, your directory structure should look like:

```
.axelar
├── bin
│   ├── axelard -> /Users/gus/.axelar/bin/axelard-vx.y.z
│   ├── axelard-vx.y.z
│   ├── tofnd -> /Users/gus/.axelar/bin/tofnd-va.b.c
│   └── tofnd-va.b.c
├── config
│   ├── app.toml
│   ├── config.toml
│   ├── genesis.json
│   ├── node_key.json
│   ├── priv_validator_key.json
│   ├── priv_validator_state.json
│   └── seeds.toml
├── data
├── logs
├── tofnd
└── vald
    └── state.json
```

Relevant files:

* `priv_validator_key.json`, `node_key.json` : Created when you first launched your node as described in [Basic node management](https://docs.axelar.dev/llms.mdx/infrastructure/node/basic/content.md).
* `priv_validator_state.json` : Last block height signed by the validator. This prevents double signing old blocks. If it’s content is `{}`, it’ll start signing from a synced node’s latest block
* `vald/state.json` : State file specifying the last block processed. If it’s not present, or is too old, vald starts from the latest block instead.


---

All pages of these docs, as Markdown: https://docs.axelar.dev/llms.txt