Files
pezkuwi-subxt/polkadot/scripts/prepare-test-net.sh
T
Adrian Catangiu ce728be008 Add BEEFY capabilities to Westend and Kusama (#7591)
* runtime: add BEEFY and MMR to Westend

Signed-off-by: Adrian Catangiu <adrian@parity.io>

* runtime: add BEEFY and MMR to Kusama

Signed-off-by: Adrian Catangiu <adrian@parity.io>

* node/service: enable BEEFY for Westend and Kusama

Signed-off-by: Adrian Catangiu <adrian@parity.io>

* node/service: regenerate genesis keys for westend-native and kusama-native

Since these keys are only used for development/local chains, also publish
the secret seeds used to generate the public keys, so that developers can
recover/generate the private key pairs if needed.

Signed-off-by: Adrian Catangiu <adrian@parity.io>

* runtime: add session keys migration to add BEEFY to Westend and Kusama

* runtime: fix migration

* fix try-runtime build

* cargo fmt

* fix parachains slashing benchmark

* address review comments

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <git@kchr.de>

* runtime: fix session keys migration

---------

Signed-off-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: parity-processbot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-08-22 09:08:54 +00:00

59 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
if [ "$#" -ne 1 ]; then
echo "Please provide the number of initial validators!"
exit 1
fi
generate_account_id() {
subkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "Account ID" | awk '{ print $3 }'
}
generate_address() {
subkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "SS58 Address" | awk '{ print $3 }'
}
generate_public_key() {
subkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "Public key (hex)" | awk '{ print $4 }'
}
generate_address_and_public_key() {
ADDRESS=$(generate_address $1 $2 $3)
PUBLIC_KEY=$(generate_public_key $1 $2 $3)
printf "//$ADDRESS\nhex![\"${PUBLIC_KEY#'0x'}\"].unchecked_into(),"
}
generate_address_and_account_id() {
ACCOUNT=$(generate_account_id $1 $2 $3)
ADDRESS=$(generate_address $1 $2 $3)
if ${4:-false}; then
INTO="unchecked_into"
else
INTO="into"
fi
printf "//$ADDRESS\nhex![\"${ACCOUNT#'0x'}\"].$INTO(),"
}
V_NUM=$1
AUTHORITIES=""
for i in $(seq 1 $V_NUM); do
AUTHORITIES+="(\n"
AUTHORITIES+="$(generate_address_and_account_id $i stash)\n"
AUTHORITIES+="$(generate_address_and_account_id $i controller)\n"
AUTHORITIES+="$(generate_address_and_account_id $i babe '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i grandpa '--scheme ed25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i im_online '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i para_validator '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i para_assignment '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i authority_discovery '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_public_key $i beefy '--scheme ecdsa' true)\n"
AUTHORITIES+="),\n"
done
printf "$AUTHORITIES"