This guide provides step-by-step instructions on how to become a validator on a Substrate-based blockchain. It covers the installation of necessary tools, generation of cryptographic keys, and configuration of a blockchain node.
- Rust: Ensure that Rust and
rustup
are installed on your system. You can check your current Rust version by runningrustc --version
. - Substrate Node: A compiled Substrate node ready to be configured for your specific blockchain (named
argochain
).
To compile subkey
and other blockchain-related tools, your Rust toolchain needs to be up to date:
rustup update stable
rustc --version
subkey
is a tool for generating and managing cryptographic keys used in Substrate and Polkadot networks:
cargo install subkey --force --locked
You need to generate several types of keys for different roles within the network. Here are the commands to generate keys using subkey
:
subkey generate --scheme sr25519 --password-interactive
subkey generate --scheme sr25519 --password-interactive
subkey generate --scheme Sr25519 --password-interactive
subkey generate --scheme Ed25519 --password-interactive
subkey generate --scheme Sr25519 --password-interactive
subkey generate --scheme Sr25519 --password-interactive
After generating your keys, use them to configure your blockchain node. Replace with your actual generated seed phrase.
./target/release/argochain key insert --base-path /tmp/node03 \
--chain ./customSpecRaw.json \
--scheme Sr25519 \
--suri <seed-phrase> \
--password-interactive \
--key-type babe
./target/release/argochain key insert --base-path /tmp/node03 \
--chain ./customSpecRaw.json \
--scheme Ed25519 \
--suri <seed-phrase> \
--password-interactive \
--key-type gran
./target/release/argochain key insert --base-path /tmp/node03 \
--chain ./customSpecRaw.json \
--scheme Sr25519 \
--suri <seed-phrase> \
--password-interactive \
--key-type imon
./target/release/argochain key insert --base-path /tmp/node03 \
--chain ./customSpecRaw.json \
--scheme Sr25519 \
--suri <seed-phrase> \
--password-interactive \
--key-type audi
./target/release/argochain \
--base-path /tmp/node03 \
--chain ./customSpecRaw.json \
--port 30335 \
--rpc-port 9947 \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
--validator \
--rpc-methods Unsafe \
--rpc-max-connections 2500 \
--name MyNode03 \
--bootnodes /ip4/127.0.0.1/tcp/30333/p2p/<local-identiry>
This command includes parameters for networking, RPC configuration, and telemetry among others. Adjust these settings based on your network setup and requirements.