Key Generation using Subkey Tool
Subkey is a command-line utility used with Substrate-based chains for managing keys. Here's how you can generate keys for GGX chain using Subkey:
Install Dependencies
You may need to install some dependencies first. You can install them by running:
sudo apt install -y build-essential protobuf-compiler pkg-config libssl-dev clang libclang-dev
Install Rust
If you do not have Rust installed, you can install it with:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
Configure Rust for Substrate Development
rustup install nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
Clone Substrate and Build Subkey
git clone https://github.com/paritytech/substrate.git
cd substrate/bin/utils/subkey
cargo +nightly run
Generate the Key
You can now generate a key with:
For ed25519:
cargo +nightly run -- generate -w 24 --output-type json --scheme ed25519 >$HOME/keys/ed25519key.json
for sr25519:
cargo +nightly run -- generate -w 24 --output-type json --scheme sr25519 >$HOME/keys/sr25519key.json