# How to validate on Kusama¶

This guide works with the Kusama network CC2.

Before setting up the validator, you will most likely want to take a look at the Secure Validator Setup Page to make sure you know what factors you should consider when designing your validator architecture.

You should NOT run a validator if you do not have enough technical knowledge to set up a validator. Any KSM that you stake for your validator is liable to be slashed, meaning that an insecure or improper setup may result in loss of KSM tokens! If you are not confident in your ability to run a validator node, it is recommended to nominate your KSM to a trusted validator node, instead.

If you need help, reach out on the Kusama forum or in the Kusama Validator chat.

For this tutorial, we will use Ubuntu 18.04. No matter which operating system you are using, setup should be very similar. There are many VPS choices out there; feel free to pick the one you like.

## Install Rust¶

Note: Instead of installing Rust and building the Polkadot binary locally, you can use Docker if you already have it installed.

If you have never installed Rust, you should do this first. This command will fetch the latest version of Rust and install it.

curl https://sh.rustup.rs -sSf | sh


Otherwise, if you have already installed Rust, run the following command to make sure you are using the latest version.

rustup update


Finally, run this command to install the necessary dependencies for compiling and running the Kusama node software.

sudo apt install make clang pkg-config libssl-dev build-essential


Note - if you are using OS X, if you have Homebrew installed, you can issue the following equivalent command INSTEAD of the previous one:

brew install cmake pkg-config openssl git llvm


## Building and Installing Your Kusama Node¶

You will need to build your kusama from the polkadot v0.6 branch source code.

git clone https://github.com/paritytech/polkadot.git
# To update your node. Run from this step.
cargo clean
git fetch
git checkout v0.6
./scripts/init.sh
cargo build --release


Note: If you prefer to use SSH rather than HTTPS, you can replace the first line of the above with git clone git@github.com:paritytech/polkadot.git.

This step will take a while (generally 15 - 30 minutes, depending on your hardware).

If you are interested in generating keys locally, you can also install subkey from the same directory. You may then take the generated subkey executable and transfer it to an air-gapped machine for extra security.

cargo install --force --git https://github.com/paritytech/substrate subkey


## Synchronize Chain Data¶

Note: Validators must resync their nodes in archive mode to avoid being slashed. You must first remove the database with polkadot purge-chain and then ensure that you run Polkadot with the --pruning=archive option.

Note: (New to the network) If you do not have a validator that was running on Kusama CC1, you can start to synchronize the chain by executing the following command:

./target/release/polkadot --pruning=archive


Note: (For previous Kusama CC1 validator) Before synchronizing the chain data, you can copy your previous keystore to the new chain ID if you want to use your previous session keys. Otherwise, you are required to set new session keys.

./target/release/polkadot --pruning=archive