Preparation: Generate the Collator's Address
Collator's address can be input with Magnet stack and writeen into default configation file for your parachain template. You can manually define the collator's address by specifying a custom key pair when starting the node.
To generate a key pair using the Substrate CLI, you can use the subkey
utility that comes with Substrate. Here’s how you can do it:
Steps to Generate a Key Pair
Install Subkey (if not already installed):
If you have Substrate installed, you already have
subkey
. If not, you can install it using the following command:
Generate a Key Pair:
Run the following command to generate a new key pair:
This will output something like:
The
Secret phrase
is your mnemonic seed phrase, which you can use to regenerate the keys. TheSS58 Address
is the public address derived from the public key.
Generate a Key Pair for a Specific Network:
If you want to generate a key pair for a specific network like Polkadot or Kusama, you can add the network option:
This ensures that the generated address is compatible with the specific network’s format.
Specify a Custom Seed Phrase:
If you want to generate a key pair from a specific seed phrase, you can use:
This will output the corresponding public key and address for that seed phrase.
Get a Key Pair for Specific Cryptography Type:
Subkey supports various cryptography types, such as
sr25519
(default),ed25519
, andecdsa
. You can specify one using:
Example Output
Saving the Keys
You can save the secret seed and public key to a file for later use. Ensure that the seed phrase or secret seed is stored securely, as it provides full control over the corresponding account.
By following these steps, you can generate key pairs for your Substrate-based projects or networks, which you can use for collators, validators, or any other accounts on the network.
Last updated