Cherry
  • The Basics
    • Introduction
    • The Cherry Primer
    • Cherry Protocol
    • Cherry Token
      • Wrapped Cherry Token
  • Quickstart
    • Installing the Cherry Node
    • Create an Account
  • Cherry Stack
    • Parachain & Parathread
    • Consensus
      • Become a Validator
      • Become a Nominator
      • Unbonding and Rebonding
      • Validating FAQ
    • Governance
      • Treasury
    • Storage
      • What is IPFS
      • Application Programming Interface
    • EVM Compatibility (pEVM)
    • Identities
  • Build
    • Style Guide
  • Community
    • Ambassador Program
    • Public Grants
  • Cherry Ecosystem
    • Finance
    • Capital Partners
  • Substrate
    • Polkadot
    • Substrate
    • XCM
  • Resources
    • Glossary
    • Blockchain UI
    • Job Board
  • Official Website
Powered by GitBook
On this page
  • Preliminaries
  • Initial Set-up
  • Requirements
  • Note Prerequisites: Install Rust & Dependencies
  • Building the Cherry binary
  • Running the Cherry binary
  • Generating the Session Keys
  • Setup Validator Accounts
  • Setup Validators
  1. Cherry Stack
  2. Consensus

Become a Validator

PreviousConsensusNextBecome a Nominator

Last updated 1 year ago

Preliminaries

Running a validator on a live network is a lot of responsibility! You will be accountable for not only your own stake, but also the stake of your current nominators. If you make a mistake and get slashed, your money and your reputation will be at risk. However, running a validator can also be very rewarding, knowing that you contribute to the security of a decentralized network while growing your stash.

Warning: It is highly recommended that you have significant system administration experience before attempting to run your own validator.

Initial Set-up

Requirements

The most common way for a beginner to run a validator is on a cloud server running Linux. You may choose whatever provider that your prefer, and whatever operating system you are comfortable with. For this guide we will be using Ubuntu 18.04, but the instructions should be similar for other platforms.

Note Prerequisites: Install Rust & Dependencies

This command will fetch the latest version of Rust and install it.

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

To configure your shell, run the following command.

source $HOME/.cargo/env

Finally, run this command to install the necessary dependencies for compiling and running the Cherry Node.

sudo apt update && sudo apt install -y git build-essential clang pkg-config protobuf-compiler curl libssl-dev llvm libudev-dev
rustup default stable
rustup update
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

Building the Cherry binary

# Clone the cherry-relay-node GitHub Repository
git clone https://github.com/CherryNetwork/cherry-relay-node.git
cd cherry-relay-node
# Always build from cherry branch
git checkout cherry
cargo build --release

Running the Cherry binary

If you were running a node previously(especially if the node was not a validator) run the following for purging the previous chain: ./target/release/cherry purge-chain --chain node/service/chain-specs/mainnet-relay-regenesis.json -y on Mainnet or ./target/release/cherry purge-chain --chain cherry-testnet -y on Testnet

1. Mainnet

Methods:

  1. Binary:

    ./target/release/cherry --chain node/service/chain-specs/mainnet-relay-regenesis.json \
     --name "<insert a name of your choice for your validator>" \
     --bootnodes /ip4/13.39.104.56/tcp/30333/p2p/12D3KooWLeBxr6vEwv2vDmQMGgd1P72WvwuhcY1YGBD421B4PfuM \
     --validator --base-path=/tmp/cherry-mainnet \
     --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
     --rpc-methods=unsafe \
     --rpc-cors all \
     --rpc-external \
     --ws external
  2. Docker

    docker run --rm -it -p 9944:9944 -p 9933:9933 -p 30333:30333 -v $(pwd):/tmp/cherry-node cherrylabsorg/cherry-polkadot-node:dev --chain cherry --bootnodes /ip4/13.39.104.56/tcp/30333/p2p/12D3KooWLeBxr6vEwv2vDmQMGgd1P72WvwuhcY1YGBD421B4PfuM --validator --name mainnet-node01 --base-path /tmp/cherry-mainnet-node01 --rpc-methods=unsafe --rpc-cors all --rpc-external --ws external

2. Testnet

Methods:

  1. Binary

    ./target/release/cherry --chain cherry-testnet \
    --name "<insert a name of your choice for you validator>" \
    --bootnodes /ip4/52.47.101.101/tcp/30333/p2p/12D3KooWNdDRo2BkTLfBr88SZpWn43tSbTFkUo5fMMa8byKVg8uz \
    --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
    --validator \
    --rpc-methods=unsafe \
    --rpc-cors all \
    --rpc-external \
    --ws external
  2. Docker

    docker run --rm -it -p 9944:9944 -p 9933:9933 -p 30333:30333 -v $(pwd):/tmp/cherry-node cherrylabsorg/cherry-polkadot-node:dev --chain cherry-testnet --bootnodes /ip4/52.47.101.101/tcp/30333/p2p/12D3KooWNdDRo2BkTLfBr88SZpWn43tSbTFkUo5fMMa8byKVg8uz --validator --name testnet-node01 --base-path /tmp/cherry-testnet-node01 --rpc-methods=unsafe --rpc-cors all --rpc-external --ws external

Generating the Session Keys

You need to tell the chain your Session keys by signing and submitting an extrinsic. This is what associates your validator node with your Controller account on Cherry.

Since you’re using a remote server, it is easier to run this command on the same machine (while the node is running):

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933

The output will have a hex-encoded “result” field. The result is the concatenation of the four public keys. Save this result for a later step.

Setup Validator Accounts

Navigate to Accounts → Add Account and create two accounts, one for your Controller and one for your Stash.

Setup Validators

Navigate to Network → Staking → Account Actions → +Validator

Select your Stash & Controller

Finally select Bond & Validate

You can restart your node at this point. Simply be pressing Ctrl-C(or docker restart if running via docker) and type the same command from section.

Open in your browser

Add your keys from the in the Keys from rotateKeys field

VPS
Running the cherry binary
https://cherry.place/#/explorer
Generating the Session Keys